4 use Digest::SHA qw(sha384_hex sha512_hex);
5 use File::Basename qw(dirname);
19 "34aa973cd4c4daa4f61eeb2bdbad27316534016f",
20 "cdc76e5c9914fb9281a1c7e284d73e67f1809a48a497200e046d39ccc7112cd0",
21 "9d0e1809716474cb086e834e310a4a1ced149e9c00f248527972cec5704c2a5b07b8b3dc38ecc4ebae97ddd87f3d8985",
22 "e718483d0ce769644e2e42c7bc15b4638e1f98b13b2044285632a803afa973ebde0ff244877ea60a4cb0432ce577c31beb009c5c2c49aa2e4eadb217ad8cc09b"
24 plan tests => scalar(@sharsp);
27 my @ext = (1, 256, 384, 512);
28 my $data = "a" x 990000;
30 my $tmpfile = File::Spec->catfile(dirname($0), "dumpload.tmp");
32 for (my $i = 0; $i < @sharsp; $i++) {
34 if ($ext[$i] == 384) {
35 $skip = sha384_hex("") ? 0 : 1;
37 if ($ext[$i] == 512) {
38 $skip = sha512_hex("") ? 0 : 1;
43 my $file = File::Spec->catfile(dirname($0),
44 "state", "state.$ext[$i]");
45 unless ($state = Digest::SHA->load($file)) {
46 $state = Digest::SHA->new($ext[$i]);
51 $state->add_bits($data, 79984)->dump($tmpfile);
52 $state->load($tmpfile)->add_bits($data, 16);
54 $digest = $state->hexdigest;
56 skip($skip, $digest, $sharsp[$i]);