1 #!/usr/local/bin/perl -w
5 # FIPS test descriptions
9 ["dsa", "PQGGen", "fips_dssvs pqg"],
10 ["dsa", "KeyPair", "fips_dssvs keypair"],
11 ["dsa", "SigGen", "fips_dssvs siggen"],
12 ["dsa", "SigVer", "fips_dssvs sigver"],
16 ["sha", "SHA1LongMsg", "fips_shatest"],
17 ["sha", "SHA1Monte", "fips_shatest"],
18 ["sha", "SHA1ShortMsg", "fips_shatest"],
19 ["sha", "SHA224LongMsg", "fips_shatest"],
20 ["sha", "SHA224Monte", "fips_shatest"],
21 ["sha", "SHA224ShortMsg", "fips_shatest"],
22 ["sha", "SHA256LongMsg", "fips_shatest"],
23 ["sha", "SHA256Monte", "fips_shatest"],
24 ["sha", "SHA256ShortMsg", "fips_shatest"],
25 ["sha", "SHA384LongMsg", "fips_shatest"],
26 ["sha", "SHA384Monte", "fips_shatest"],
27 ["sha", "SHA384ShortMsg", "fips_shatest"],
28 ["sha", "SHA512LongMsg", "fips_shatest"],
29 ["sha", "SHA512Monte", "fips_shatest"],
30 ["sha", "SHA512ShortMsg", "fips_shatest"],
32 # AES tests, file search mode
33 ["aes", "\@dir", "fips_aesavs -f"],
35 # DES tests, file search mode
36 ["tdes", "\@dir", "fips_desmovs -f"],
40 ["hmac", "HMAC", "fips_hmactest"],
44 ["rng", "ANSI931_AES128MCT", "fips_rngvs mct"],
45 ["rng", "ANSI931_AES192MCT", "fips_rngvs mct"],
46 ["rng", "ANSI931_AES256MCT", "fips_rngvs mct"],
47 ["rng", "ANSI931_AES128VST", "fips_rngvs vst"],
48 ["rng", "ANSI931_AES192VST", "fips_rngvs vst"],
49 ["rng", "ANSI931_AES256VST", "fips_rngvs vst"],
53 ["rsa", "SigGen15", "fips_rsastest"],
54 ["rsa", "SigVer15", "fips_rsavtest"],
55 ["rsa", "SigGenPSS", "fips_rsastest -saltlen 0"],
56 ["rsa", "SigVerPSS", "fips_rsavtest -saltlen 0"],
57 ["rsa", "SigGenRSA", "fips_rsastest -x931"],
58 ["rsa", "SigVerRSA", "fips_rsavtest -x931"],
59 ["rsa", "KeyGenRSA", "fips_rsagtest"],
60 ["rsa_salt_62", "SigGenPSS", "fips_rsastest -saltlen 62"],
61 ["rsa_salt_62", "SigVerPSS", "fips_rsavtest -saltlen 62"]
80 elsif ($_ eq "--onedir")
88 elsif (/--tprefix=(.*)$/)
92 elsif (/--tvprefix=(.*)$/)
96 elsif (/--shwrap_prefix=(.*)$/)
100 elsif (/--outfile=(.*)$/)
106 $tvdir = "testvectors" unless defined $tvdir;
112 $tvprefix = "" unless defined $tvprefix;
116 $tvprefix = "..\\fips-1.0\\" unless defined $tvprefix;
118 $tprefix = ".\\" unless defined $tprefix;
119 $outfile = "fipstests.bat" unless defined $outfile;
120 open(OUT, ">$outfile");
124 rem Test vector run script
125 rem Auto generated by mkfipsscr.pl script
133 $tvprefix = "" unless defined $tvprefix;
136 $tprefix = "./" unless defined $tprefix;
137 $shwrap_prefix = "./" unless defined $shwrap_prefix;
141 $tprefix = "../test/" unless defined $tprefix;
142 $shwrap_prefix = "../util/" unless defined $shwrap_prefix;
144 $outfile = "fipstests.sh" unless defined $outfile;
145 open(OUT, ">$outfile");
150 # Test vector run script
151 # Auto generated by mkfipsscr.pl script
160 my ($tdir, $fprefix, $tcmd) = @$_;
165 test_dir($win32, $ltdir);
167 test_line($win32, $tdir, $fprefix, $tcmd);
172 my ($win32, $tdir) = @_;
175 my $rsp = "$tvprefix$tvdir\\$tdir\\rsp";
179 if exist $rsp rd /s /q $rsp
185 my $rsp = "$tvdir/$tdir/rsp";
198 my ($win32, $tdir, $fprefix, $tcmd) = @_;
199 if ($fprefix =~ /\@/)
201 foreach(<$tvprefix$tvdir/$tdir/req/*.req>)
206 print OUT "$tprefix$tcmd $_\n";
211 ${shwrap_prefix}shlib_wrap.sh $tprefix$tcmd $_
219 my $req = "$tvprefix$tvdir\\$tdir\\req\\$fprefix.req";
220 my $rsp = "$tvprefix$tvdir\\$tdir\\rsp\\$fprefix.rsp";
221 print OUT "$tprefix$tcmd < $req > $rsp\n";
226 my $req = "$tvdir/$tdir/req/$fprefix.req";
227 my $rsp = "$tvdir/$tdir/rsp/$fprefix.rsp";
229 if [ -f $req ] ; then ${shwrap_prefix}shlib_wrap.sh $tprefix$tcmd < $req > $rsp; fi