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.2 by root, Sat Mar 28 19:42:35 2015 UTC vs.
Revision 1.3 by root, Sun Mar 29 06:21:41 2015 UTC

1BEGIN { $| = 1; print "1..1081\n"; } 1BEGIN { $| = 1; print "1..1621\n"; }
2 2
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
19 my ($seed, $pub, $s, $m) = splice @tv, -4, 4; 19 my ($seed, $pub, $s, $m) = splice @tv, -4, 4;
20 20
21 my $pub_ = Crypt::Ed25519::eddsa_public_key $seed; 21 my $pub_ = Crypt::Ed25519::eddsa_public_key $seed;
22 print $pub_ eq $pub ? "" : "not ", "ok ", ++$i, "\n"; 22 print $pub_ eq $pub ? "" : "not ", "ok ", ++$i, "\n";
23 23
24 my ($pub__, $priv) = Crypt::Ed25519::generate_keypair $seed;
25 print $pub_ eq $pub__ ? "" : "not ", "ok ", ++$i, "\n";
26
24 my $s_ = Crypt::Ed25519::eddsa_sign $m, $pub, $seed; 27 my $s_ = Crypt::Ed25519::eddsa_sign $m, $pub, $seed;
28 print $s eq $s_ ? "" : "not ", "ok ", ++$i, "\n";
29
30 my $s__ = Crypt::Ed25519::sign $m, $pub, $priv;
25 print $s eq $s_ ? "" : "not ", "ok ", ++$i, "\n"; 31 print $s eq $s_ ? "" : "not ", "ok ", ++$i, "\n";
26 32
27 my $valid = Crypt::Ed25519::eddsa_verify $m, $pub, $s; 33 my $valid = Crypt::Ed25519::eddsa_verify $m, $pub, $s;
28 print $valid ? "" : "not ", "ok ", ++$i, "\n"; 34 print $valid ? "" : "not ", "ok ", ++$i, "\n";
29 35

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines