#!/usr/local/bin/perl -w my @fips_tests = ( # FIPS test descriptions # DSA tests ["dsa", "PQGGen", "fips_dssvs pqg"], ["dsa", "KeyPair", "fips_dssvs keypair"], ["dsa", "SigGen", "fips_dssvs siggen"], ["dsa", "SigVer", "fips_dssvs sigver"], # SHA tests ["sha", "SHA1LongMsg", "fips_shatest"], ["sha", "SHA1Monte", "fips_shatest"], ["sha", "SHA1ShortMsg", "fips_shatest"], ["sha", "SHA224LongMsg", "fips_shatest"], ["sha", "SHA224Monte", "fips_shatest"], ["sha", "SHA224ShortMsg", "fips_shatest"], ["sha", "SHA256LongMsg", "fips_shatest"], ["sha", "SHA256Monte", "fips_shatest"], ["sha", "SHA256ShortMsg", "fips_shatest"], ["sha", "SHA384LongMsg", "fips_shatest"], ["sha", "SHA384Monte", "fips_shatest"], ["sha", "SHA384ShortMsg", "fips_shatest"], ["sha", "SHA512LongMsg", "fips_shatest"], ["sha", "SHA512Monte", "fips_shatest"], ["sha", "SHA512ShortMsg", "fips_shatest"], # AES tests, file search mode ["aes", "\@dir", "fips_aesavs -f"], # DES tests, file search mode ["tdes", "\@dir", "fips_desmovs -f"], # HMAC ["hmac", "HMAC", "fips_hmactest"], # RAND tests ["rng", "ANSI931_AES128MCT", "fips_rngvs mct"], ["rng", "ANSI931_AES192MCT", "fips_rngvs mct"], ["rng", "ANSI931_AES256MCT", "fips_rngvs mct"], ["rng", "ANSI931_AES128VST", "fips_rngvs vst"], ["rng", "ANSI931_AES192VST", "fips_rngvs vst"], ["rng", "ANSI931_AES256VST", "fips_rngvs vst"], # RSA tests ["rsa", "SigGen15", "fips_rsastest"], ["rsa", "SigVer15", "fips_rsavtest"], ["rsa", "SigGenPSS", "fips_rsastest -saltlen 0"], ["rsa", "SigVerPSS", "fips_rsavtest -saltlen 0"], ["rsa", "SigGenRSA", "fips_rsastest -x931"], ["rsa", "SigVerRSA", "fips_rsavtest -x931"], ["rsa", "KeyGenRSA", "fips_rsagtest"], ["rsa_salt_62", "SigGenPSS", "fips_rsastest -saltlen 62"], ["rsa_salt_62", "SigVerPSS", "fips_rsavtest -saltlen 62"] ); my $lnum = 0; my $win32 = 0; my $onedir = 0; my $ltdir = ""; my $tvdir; my $tvprefix; my $tprefix; my $shwrap_prefix; foreach (@ARGV) { if ($_ eq "--win32") { $win32 = 1; } elsif ($_ eq "--onedir") { $onedir = 1; } elsif (/--dir=(.*)$/) { $tvdir = $1; } elsif (/--tprefix=(.*)$/) { $tprefix = $1; } elsif (/--tvprefix=(.*)$/) { $tvprefix = $1; } elsif (/--shwrap_prefix=(.*)$/) { $shwrap_prefix = $1; } elsif (/--outfile=(.*)$/) { $outfile = $1; } } $tvdir = "testvectors" unless defined $tvdir; if ($win32) { if ($onedir) { $tvprefix = "" unless defined $tvprefix; } else { $tvprefix = "..\\fips-1.0\\" unless defined $tvprefix; } $tprefix = ".\\" unless defined $tprefix; $outfile = "fipstests.bat" unless defined $outfile; open(OUT, ">$outfile"); print OUT <$outfile"); print OUT <) { if ($win32) { $_ =~ tr|/|\\|; print OUT "$tprefix$tcmd $_\n"; } else { print OUT < $rsp\n"; END } else { my $req = "$tvdir/$tdir/req/$fprefix.req"; my $rsp = "$tvdir/$tdir/rsp/$fprefix.rsp"; print OUT < $rsp; fi END } }