]> git.saurik.com Git - apple/security.git/blob - SecurityTests/cspxutils/aesVect/testVectors
Security-57031.1.35.tar.gz
[apple/security.git] / SecurityTests / cspxutils / aesVect / testVectors
1 #! /bin/csh -f
2 #
3 # Generate AES test vectors for Known Asnwers Test, compare against NIST standards.
4 ##
5 if ( $#argv != 1 ) then
6 echo Usage: testVectors r\|t\|c
7 exit(1)
8 endif
9 #
10 # header, known vectors, output file
11 #
12 set vk_hdr=ecb_vk.hdr
13 set vk_ref=ecb_vk.txt
14 set vk_out=/tmp/vk_out
15 #
16 set vt_hdr=ecb_vt.hdr
17 set vt_ref=ecb_vt.txt
18 set vt_out=/tmp/vt_out
19 #
20 echo Generating Variable Key Known Answer Test vectors in $vk_out....
21 ./makeVectors $argv[1] k $vk_hdr $vk_out || exit(1)
22 echo Generating Variable Text Known Answer Test vectors in $vt_out....
23 ./makeVectors $argv[1] p $vt_hdr $vt_out || exit(1)
24 echo Comparing against reference vectors....
25 diff $vk_out $vk_ref || exit(1)
26 diff $vt_out $vt_ref || exit(1)
27 echo === Known Answer Test PASSED ===