X-Git-Url: https://git.distorted.org.uk/u/mdw/catacomb/blobdiff_plain/0f3faccdf5f2f0cfa40bd9bec495c4930052a51f..38b901110909d19388502b487f0529514cf853ff:/g-ec.c diff --git a/g-ec.c b/g-ec.c index dcf8a10..32220ff 100644 --- a/g-ec.c +++ b/g-ec.c @@ -1,6 +1,6 @@ /* -*-c-*- * - * $Id: g-ec.c,v 1.3 2004/04/04 19:04:11 mdw Exp $ + * $Id: g-ec.c,v 1.5 2004/04/17 09:58:37 mdw Exp $ * * Abstraction for elliptic curve groups * @@ -27,24 +27,6 @@ * MA 02111-1307, USA. */ -/*----- Revision history --------------------------------------------------* - * - * $Log: g-ec.c,v $ - * Revision 1.3 2004/04/04 19:04:11 mdw - * Raw I/O of elliptic curve points and group elements. - * - * Revision 1.2 2004/04/03 03:32:05 mdw - * General robustification. - * - * Revision 1.1 2004/04/01 12:50:09 mdw - * Add cyclic group abstraction, with test code. Separate off exponentation - * functions for better static linking. Fix a buttload of bugs on the way. - * Generally ensure that negative exponents do inversion correctly. Add - * table of standard prime-field subgroups. (Binary field subgroups are - * currently unimplemented but easy to add if anyone ever finds a good one.) - * - */ - /*----- Header files ------------------------------------------------------*/ #include @@ -168,7 +150,7 @@ static int gfromint(group *gg, ec *d, mp *x) { static int gtoec(group *gg, ec *d, ec *x) { gctx *g = (gctx *)gg; EC_OUT(g->ei.c, d, x); return (0); } -static int gfromec(group *gg, ec *d, ec *x) { +static int gfromec(group *gg, ec *d, const ec *x) { gctx *g = (gctx *)gg; ec t = EC_INIT; int rc; EC_IN(g->ei.c, &t, x); rc = EC_CHECK(g->ei.c, &t); if (!rc) EC_COPY(d, &t); EC_DESTROY(&t); return (rc);