]> www.wagner.pp.ru Git - openssl-gost/engine.git/blob - test/01-digest.t
Started test suite. Added .gitignore file
[openssl-gost/engine.git] / test / 01-digest.t
1 #!/usr/bin/perl 
2 use Test::More tests => 3;
3 use Cwd 'abs_path';
4
5 # prepare data for 
6
7 open F,">","testdata.dat";
8 print F "12345670" x 128;
9 close F;
10
11 # Set OPENSSL_ENGINES environment variable to just build engine
12 $ENV{'OPENSSL_ENGINES'} = abs_path("../.libs");
13 # Set engine name from environment to allow testing of different engines
14 $engine=$ENV{'ENGINE_NAME'}||"gost";
15 # Reopen STDERR to eliminate extra output
16 open STDERR, ">>","tests.err";
17
18 is(`openssl dgst -engine ${engine} -md_gost94 testdata.dat`,
19 "md_gost94(testdata.dat)= f7fc6d16a6a5c12ac4f7d320e0fd0d8354908699125e09727a4ef929122b1cae\n",
20 "GOST R 34.11-94");
21
22 is(`openssl dgst -engine ${engine} -md_gost12_256 testdata.dat`,
23 "md_gost12_256(testdata.dat)= d38a79cb15db40651051ef6879881fe25d84cdbb23ecec9f56126f8803f5fc88\n",
24 "GOST R 34.11-2012 256bit");
25
26 is(`openssl dgst -engine ${engine} -md_gost12_512 testdata.dat`,
27 "md_gost12_512(testdata.dat)= ac48be903716d9b9701fd8cdd75417b9085b5b642191926afd92310e645c52d465e36bbd5ccb356c5b1b8020a868915d5d8cc18ed2c07c28d24ba914b867f144\n",
28 "GOST R 34.11-2012 512bit");
29
30 unlink("testdata.dat");