ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/cvsroot/Crypt-Ed25519/t/01_python.t
(Generate patch)

Comparing cvsroot/Crypt-Ed25519/t/01_python.t (file contents):
Revision 1.1 by root, Fri Mar 27 20:23:13 2015 UTC vs.
Revision 1.2 by root, Sat Mar 28 19:42:35 2015 UTC

3use Crypt::Ed25519; 3use Crypt::Ed25519;
4 4
5# test vectors generated from ed25519's website sign.input via extract-sign.input 5# test vectors generated from ed25519's website sign.input via extract-sign.input
6 6
7my @tv = unpack "(a32 a32 a64 w/a*)*", do { 7my @tv = unpack "(a32 a32 a64 w/a*)*", do {
8 open my $fh, "<t/sign.input" 8 open my $fh, "<:raw", "t/sign.input"
9 or die "t/sign.input: $!"; 9 or die "t/sign.input: $!";
10 local $/; 10 local $/;
11 readline $fh 11 readline $fh
12}; 12};
13 13
25 print $s eq $s_ ? "" : "not ", "ok ", ++$i, "\n"; 25 print $s eq $s_ ? "" : "not ", "ok ", ++$i, "\n";
26 26
27 my $valid = Crypt::Ed25519::eddsa_verify $m, $pub, $s; 27 my $valid = Crypt::Ed25519::eddsa_verify $m, $pub, $s;
28 print $valid ? "" : "not ", "ok ", ++$i, "\n"; 28 print $valid ? "" : "not ", "ok ", ++$i, "\n";
29 29
30 my $valid = !Crypt::Ed25519::eddsa_verify "x$m", $pub, $s; 30 my $notvalid = !Crypt::Ed25519::eddsa_verify "x$m", $pub, $s;
31 print $valid ? "" : "not ", "ok ", ++$i, "\n"; 31 print $notvalid ? "" : "not ", "ok ", ++$i, "\n";
32} 32}
33 33

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines