Codebase list libcryptx-perl / v0.040 _generators / Mac.t.tt
v0.040

Tree @v0.040 (Download .tar.gz)

Mac.t.tt @v0.040raw · history · blame

[%comment%]

use strict;
use warnings;

[%- IF t_strings_count %]
use Test::More tests => [%t_strings_count * 6%];
[%- ELSE %]
use Test::More tests => 0;
[%- END %]

use Crypt::Mac::[%orig_name%] qw( [%lc_name%] [%lc_name%]_hex [%lc_name%]_b64 [%lc_name%]_b64u );

[%- FOREACH v IN t_strings %]
is( unpack('H*', Crypt::Mac::[%orig_name%]->new([%v.args%])->add([%v.data%])->mac), '[%v.mac%]', '[%orig_name%]/oo+raw/[%loop.count%]');
is( Crypt::Mac::[%orig_name%]->new([%v.args%])->add([%v.data%])->hexmac, '[%v.mac%]', '[%orig_name%]/oo+hex/[%loop.count%]');
is( unpack('H*', [%lc_name%]([%v.args%],[%v.data%])), '[%v.mac%]', '[%orig_name%]/func+raw/[%loop.count%]');
is( [%lc_name%]_hex([%v.args%],[%v.data%]), '[%v.mac%]', '[%orig_name%]/func+hex/[%loop.count%]');
is( [%lc_name%]_b64([%v.args%],[%v.data%]), '[%v.b64mac%]', '[%orig_name%]/func+b64/[%loop.count%]');
is( [%lc_name%]_b64u([%v.args%],[%v.data%]), '[%v.b64umac%]', '[%orig_name%]/func+b64u/[%loop.count%]');
[%- END %]