General utilities cleanup. Add signature support to catcrypt. Throw in
[u/mdw/catacomb] / ectab-canonify.pl
1 #! /usr/bin/perl
2
3 while (<>) {
4 print, next if /^\s*(\#|$)/;
5 @F = split;
6 $k = shift @F;
7 print, next if $k eq "curve";
8 $n = lc(join("", @F));
9 if ($n =~ m"^/") {
10 $p = join(" + ", map("2^$_", split(m"/", substr($n, 1))));
11 $n = `calc 'printf("%x", $p)'`;
12 } elsif ($n =~ /../ && $n !~ /^0x/) {
13 $n = "0x$n";
14 }
15 print " $k $n\n";
16 }