7 $MODULE = ($ENV{PERL_CORE} || -e "SHA.pm") ? "Digest::SHA" : "Digest::SHA::PurePerl";
8 eval "require $MODULE" || die $@;
13 if ($ENV{PERL_CORE}) {
19 # David Ireland's test vector - SHA-256 digest of "a" x 536870912
21 # Adapted from Julius Duque's original script (t/24-ireland.tmp)
22 # - modified to use state cache via dump()/load() methods
26 my $tempfile = "ireland.tmp";
27 END { 1 while unlink $tempfile }
29 my $fh = FileHandle->new($tempfile, "w");
30 while (<DATA>) { print $fh $_ } close($fh);
32 my $rsp = "b9045a713caed5dff3d3b783e98d1ce5778d8bc331ee4119d707072312af06a7";
35 if ($sha = $MODULE->load($tempfile)) {
37 print "not " unless $sha->hexdigest eq $rsp;
40 else { print "not ok 1\n" }
44 H:dd75eb45:02d4f043:06b41193:6fda751d:73064db9:787d54e1:52dc3fe0:48687dfa
45 block:61:61:61:61:61:61:61:61:61:61:61:61:61:61:61:61:61:61:61:61:61:61:61:61:61:61:61:61:61:61:61:61:61:61:61:61:61:61:61:61:61:61:61:61:61:61:61:61:61:61:61:61:61:61:61:61:61:61:61:61:61:61:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00