1 use Catacomb qw(:const);
4 @ISA = qw(Catacomb::MP::Prime::Gen::Proc);
5 sub pgen_begin { my ($me, $ev) = @_; print $ev->name(), ": "; }
6 sub pgen_pass { print "*"; }
7 sub pgen_fail { print "."; }
8 sub pgen_done { print "*\n"; }
9 sub new { my $me = bless { FLUSH => $| }, $_[0]; $| = 1; return $me; }
10 sub DESTROY { my $me = shift; $| = $me->{FLUSH}; }
14 $mm = Catacomb::MP->factorial(16);
17 print join(", ", $mm2->gcd(19)), "\n";
19 $md5 = Catacomb::HashClass->find("md5");
23 print length($hh), "\n";
24 print unpack("H*", $hh), "\n";
26 foreach $i (Catacomb::CipherClass->list()) {
27 print $i->name(), "\n";
30 $p = Catacomb::MP::Prime::gen("p", $Catacomb::random->mp(512, 3),
31 0, Catacomb::MP::Prime::Filter->stepper(4),
32 5, Catacomb::MP::Prime::Rabin->tester(),
34 $q = Catacomb::MP::Prime::gen("q", $Catacomb::random->mp(512, 3),
35 0, Catacomb::MP::Prime::Filter->stepper(4),
36 5, Catacomb::MP::Prime::Rabin->tester(),
39 print "p = $p\nq = $q\n";