2 use Test::More tests => 10;
7 open F,">","testdata.dat";
8 print F "12345670" x 128;
11 open F,">","testbig.dat";
12 print F "12345670" x 1024;
14 # Set OPENSSL_ENGINES environment variable to just build engine
15 $ENV{'OPENSSL_ENGINES'} = abs_path("../.libs");
17 $key='0123456789abcdef' x 2;
19 $engine=$ENV{'ENGINE_NAME'}||"gost";
21 # Reopen STDERR to eliminate extra output
22 open STDERR, ">>","tests.err";
24 is(`openssl dgst -engine ${engine} -mac gost-mac -macopt key:${key} testdata.dat`,
25 "GOST-MAC-gost-mac(testdata.dat)= 2ee8d13d\n",
26 "GOST MAC - default size");
28 for ($i=1;$i<=8; $i++) {
29 is(`openssl dgst -engine ${engine} -mac gost-mac -macopt key:${key} -sigopt size:$i testdata.dat`,
30 "GOST-MAC-gost-mac(testdata.dat)= ".substr("2ee8d13dff7f037d",0,$i*2)."\n",
31 "GOST MAC - size $i bytes");
36 is(`openssl dgst -engine ${engine} -mac gost-mac -macopt key:${key} testbig.dat`,
37 "GOST-MAC-gost-mac(testbig.dat)= d3978b1a\n",
38 "GOST MAC - big data");
40 unlink('testdata.dat');
41 unlink('testbig.dat');