X-Git-Url: https://git.distorted.org.uk/u/mdw/catacomb/blobdiff_plain/dbfee00a86609283c4633df870692be3db9bc5e4..bc985cefafea2e1b02095a2ff2a9982c4c647d17:/calc/ecp.cal diff --git a/calc/ecp.cal b/calc/ecp.cal index 82600f5..3834359 100644 --- a/calc/ecp.cal +++ b/calc/ecp.cal @@ -1,6 +1,6 @@ /* -*-apcalc-*- * - * $Id: ecp.cal,v 1.1.4.1 2003/06/10 13:43:53 mdw Exp $ + * $Id: ecp.cal,v 1.3 2004/03/23 15:19:32 mdw Exp $ * * Testbed for elliptic curve arithmetic over prime fields * @@ -30,6 +30,15 @@ /*----- Revision history --------------------------------------------------* * * $Log: ecp.cal,v $ + * Revision 1.3 2004/03/23 15:19:32 mdw + * Test elliptic curves more thoroughly. + * + * Revision 1.2 2004/03/21 22:52:06 mdw + * Merge and close elliptic curve branch. + * + * Revision 1.1.4.2 2004/03/20 00:13:31 mdw + * Projective coordinates for prime curves + * * Revision 1.1.4.1 2003/06/10 13:43:53 mdw * Simple (non-projective) curves over prime fields now seem to work. * @@ -103,6 +112,8 @@ define ecp_pt_dbl(a) { local e, alpha; local obj ecp_pt d; + if (istype(a, 1)) + return (0); e = a.e; alpha = (3 * a.x^2 + e.a) * minv(2 * a.y, e.p) % e.p; d.x = (alpha^2 - 2 * a.x) % e.p;