Commit | Line | Data |
6bc89f92 |
1 | use Test; |
2 | use strict; |
3 | use integer; |
4 | use Digest::SHA qw(sha1_base64 sha224_base64 sha256_base64 sha384_base64 sha512_base64); |
5 | |
41c686de |
6 | BEGIN { |
77d2a621 |
7 | if ($ENV{PERL_CORE}) { |
8 | chdir 't' if -d 't'; |
9 | @INC = '../lib'; |
10 | } |
41c686de |
11 | } |
12 | |
6bc89f92 |
13 | my(@vec, $data); |
14 | |
77d2a621 |
15 | BEGIN { |
6bc89f92 |
16 | $data = "abc"; |
17 | @vec = ( |
18 | \&sha1_base64, "qZk+NkcGgWq6PiVxeFDCbJzQ2J0", |
19 | \&sha224_base64, "Iwl9IjQF2CKGQqR3vaJVsyqtvOS9oLP342ydpw", |
20 | \&sha256_base64, "ungWv48Bz+pBQUDeXa4iI7ADYaOWF3qctBD/YfIAFa0", |
21 | \&sha384_base64, "ywB1P0WjXou1oD1pmsZQBycsMqsO3tFjGotgWkP/W+2AhgcroefMI1i67KE0yCWn", |
22 | \&sha512_base64, "3a81oZNherrMQXNJriBBMRLm+k6JqX6iCp7u5ktV05ohkpkqJ0/BqDa6PCOj/uu9RU1EI2Q86A4qmslPpUyknw" |
23 | ); |
24 | |
25 | plan tests => scalar(@vec) / 2; |
26 | } |
27 | |
28 | my $fcn; |
29 | my $rsp; |
30 | my $skip; |
31 | |
32 | while (@vec) { |
33 | $fcn = shift(@vec); |
34 | $rsp = shift(@vec); |
35 | $skip = &$fcn("") ? 0 : 1; |
36 | skip($skip, &$fcn($data), $rsp); |
37 | } |