+ $cmd = $mac_cmd->(-mac => 'gost-mac', -key => $key,
+ -args => $module_args, -infile => 'testdata.dat');
+ $expected = $mac_expected->(-mac => 'GOST-MAC-gost-mac',
+ -infile => 'testdata.dat',
+ -result => '2ee8d13d');
+ unless (is(`$cmd`, $expected, "GOST MAC - default size")) {
+ diag("Command was: $cmd");
+ }
+
+ my $i;
+ for ($i=1;$i<=8; $i++) {
+ $cmd = $mac_cmd->(-mac => 'gost-mac', -key => $key, -size => $i,
+ -args => $module_args, -infile => 'testdata.dat');
+ $expected = $mac_expected->(-mac => 'GOST-MAC-gost-mac',
+ -infile => 'testdata.dat',
+ -result => substr("2ee8d13dff7f037d",0,$i*2));
+ unless (is(`$cmd`, $expected, "GOST MAC - size $i bytes")) {
+ diag("Command was: $cmd");
+ }
+ }
+
+
+
+ $cmd = $mac_cmd->(-mac => 'gost-mac', -key => $key,
+ -args => $module_args, -infile => 'testbig.dat');
+ $expected = $mac_expected->(-mac => 'GOST-MAC-gost-mac',
+ -infile => 'testbig.dat',
+ -result => '5efab81f');
+ unless (is(`$cmd`, $expected, "GOST MAC - big data")) {
+ diag("Command was: $cmd");
+ }
+
+ $cmd = $mac_cmd->(-mac => 'gost-mac-12', -key => $key,
+ -args => $module_args, -infile => 'testdata.dat');
+ $expected = $mac_expected->(-mac => 'GOST-MAC-12-gost-mac-12',
+ -infile => 'testdata.dat',
+ -result => 'be4453ec');
+ unless (is(`$cmd`, $expected, "GOST MAC parameters 2012 - default size")) {
+ diag("Command was: $cmd");
+ }
+ for ($i=1;$i<=8; $i++) {
+ $cmd = $mac_cmd->(-mac => 'gost-mac-12', -key => $key, -size => $i,
+ -args => $module_args, -infile => 'testdata.dat');
+ $expected = $mac_expected->(-mac => 'GOST-MAC-12-gost-mac-12',
+ -infile => 'testdata.dat',
+ -result => substr("be4453ec1ec327be",0,$i*2));
+ unless (is(`$cmd`, $expected, "GOST MAC parameters 2012 - size $i bytes")) {
+ diag("Command was: $cmd");
+ }
+ }
+ }