X-Git-Url: https://git.distorted.org.uk/u/mdw/catacomb/blobdiff_plain/59b2b448afd977128c84bcea6b18adaf37d4be69..f46efa79cd2bb9adc81541f1218965f85a6b2eef:/ec-test.c diff --git a/ec-test.c b/ec-test.c index 6d42a70..59acf4e 100644 --- a/ec-test.c +++ b/ec-test.c @@ -1,6 +1,6 @@ /* -*-c-*- * - * $Id: ec-test.c,v 1.1 2004/03/23 15:19:32 mdw Exp $ + * $Id: ec-test.c,v 1.2 2004/03/27 00:04:46 mdw Exp $ * * Code for testing elliptic-curve stuff * @@ -30,6 +30,9 @@ /*----- Revision history --------------------------------------------------* * * $Log: ec-test.c,v $ + * Revision 1.2 2004/03/27 00:04:46 mdw + * Implement efficient reduction for pleasant-looking primes. + * * Revision 1.1 2004/03/23 15:19:32 mdw * Test elliptic curves more thoroughly. * @@ -189,7 +192,7 @@ static void ecvcvt(const char *buf, dstr *d) int i; static const char *fnames[] = { - "prime", "binpoly", 0 + "prime", "niceprime", "binpoly", 0 }; static const char *ecnames[] = { "prime", "primeproj", "bin", "binproj", 0 @@ -197,7 +200,8 @@ static void ecvcvt(const char *buf, dstr *d) switch (i = ckstring(&p, fnames), ckchar(&p, ':'), i) { case 0: m = getmp(&p); f = field_prime(m); mp_drop(m); break; - case 1: m = getmp(&p); f = field_binpoly(m); mp_drop(m); break; + case 1: m = getmp(&p); f = field_niceprime(m); mp_drop(m); break; + case 2: m = getmp(&p); f = field_binpoly(m); mp_drop(m); break; default: abort(); } ckchar(&p, '/');