X-Git-Url: https://git.distorted.org.uk/~mdw/catacomb-perl/blobdiff_plain/68e68e18c457d31c1c61bc08dd14a56e7e7ac21e..a1a90aaf554eb974e39e34b513747eb666180776:/test.pl diff --git a/test.pl b/test.pl index 01b9f63..8d7e82c 100644 --- a/test.pl +++ b/test.pl @@ -1,39 +1,6 @@ use Catacomb qw(:const); -package EV; -@ISA = qw(Catacomb::MP::Prime::Gen::Proc); -sub pgen_begin { my ($me, $ev) = @_; print $ev->name(), ": "; } -sub pgen_pass { print "*"; } -sub pgen_fail { print "."; } -sub pgen_done { print "*\n"; } -sub new { my $me = bless { FLUSH => $| }, $_[0]; $| = 1; return $me; } -sub DESTROY { my $me = shift; $| = $me->{FLUSH}; } - -package main; - -$mm = Catacomb::MP->factorial(16); -$mm2 = $mm; -$mm++; -print join(", ", $mm2->gcd(19)), "\n"; - -$md5 = Catacomb::HashClass->find("md5"); -$h = $md5->init(); -$h->hash("abc"); -$hh = $h->done(); -print length($hh), "\n"; -print unpack("H*", $hh), "\n"; - -foreach $i (Catacomb::CipherClass->list()) { - print $i->name(), "\n"; -} - -$p = Catacomb::MP::Prime::gen("p", $Catacomb::random->mp(512, 3), - 0, Catacomb::MP::Prime::Filter->stepper(4), - 5, Catacomb::MP::Prime::Rabin->tester(), - EV->new()); -$q = Catacomb::MP::Prime::gen("q", $Catacomb::random->mp(512, 3), - 0, Catacomb::MP::Prime::Filter->stepper(4), - 5, Catacomb::MP::Prime::Rabin->tester(), - EV->new()); - -print "p = $p\nq = $q\n"; +($c, $g, $r, $h) = Catacomb::EC::Curve->getinfo("secp160r1"); +print $g->atinfp(), ": ", $g->x, ", ", $g->y, "\n"; +$p = $c->mul($g, $r); +print $p->atinfp(), "\n";