math/mpreduce.h: Missing include files.
[u/mdw/catacomb] / utils / ecentry-prettify.pl
CommitLineData
38b90111 1#! /usr/bin/perl
2
3sub gather {
4 my ($what) = @_;
5 print "$what?\n";
6 my $x = "";
7 while (<>) {
8 chomp;
9 last if $_ eq ".";
10 $x .= $_;
11 }
12 $x =~ s/\s+//g;
13 $x =~ s/[.,]//g;
14 return lc($x);
15}
16
17my %CTYPE = ("niceprime" => "primeproj",
18 "prime" => "primeproj",
19 "binpoly" => "binproj",
20 "binnorm" => "binproj");
21
22my $name = shift;
23my $kind = shift;
24
25my $p = gather("p");
389d8222 26my $beta = ($kind eq "binnorm") ? "0x".gather("beta") : "";
38b90111 27my $a = gather("a");
28my $b = gather("b");
29my $r = gather("r");
30my $h = gather("h");
31my $g = gather("g");
32
33print "curve $name $kind\n";
34$p = "0x".$p if $kind =~ /bin/;
389d8222 35my @l = ("./ecptd", "$kind $p $beta $CTYPE{$kind} 0x$a 0x$b", "0x$r", $h, $g);
36# print join(" ", @l), "\n";
37system @l;