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";
