X-Git-Url: https://git.distorted.org.uk/u/mdw/catacomb/blobdiff_plain/432c4e184d44704511a5991b80224a87cb1d4613..8404fd750e8d1a635ccb3895e4f0e155e5f5e3cf:/ectab.h diff --git a/ectab.h b/ectab.h index d8d4302..d75e79c 100644 --- a/ectab.h +++ b/ectab.h @@ -1,8 +1,8 @@ /* -*-c-*- * - * $Id: ectab.h,v 1.1 2004/03/27 17:54:11 mdw Exp $ + * $Id: ectab.h,v 1.3 2004/04/01 21:28:41 mdw Exp $ * - * Table of standard elliptic curves (internal) + * Table of standard elliptic curves * * (c) 2004 Straylight/Edgeware */ @@ -30,6 +30,18 @@ /*----- Revision history --------------------------------------------------* * * $Log: ectab.h,v $ + * Revision 1.3 2004/04/01 21:28:41 mdw + * Normal basis support (translates to poly basis internally). Rewrite + * EC and prime group table generators in awk, so that they can reuse data + * for repeated constants. + * + * Revision 1.2 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.) + * * Revision 1.1 2004/03/27 17:54:11 mdw * Standard curves and curve checking. * @@ -50,24 +62,23 @@ typedef struct ecdata { unsigned ftag; /* The kind of curve this is */ - const mpw *p; size_t psz; /* Modulus */ - const mpw *a; size_t asz; /* Elliptic curve parameters */ - const mpw *b; size_t bsz; - const mpw *r; size_t rsz; /* Order of common point %$g$% */ - const mpw *h; size_t hsz; /* Cofactor %$h = \#E/r$% */ - const mpw *gx; size_t gxsz; /* Common point */ - const mpw *gy; size_t gysz; + mp p, beta; /* Modulus, and conversion magic */ + mp a, b; /* Elliptic curve parameters */ + mp r; /* Order of common point %$g$% */ + mp h; /* Cofactor %$h = \#E/r$% */ + mp gx, gy; /* Common point */ } ecdata; enum { FTAG_PRIME, /* Prime but not nice */ FTAG_NICEPRIME, /* Nice prime field */ - FTAG_BINPOLY /* Any old binary field */ + FTAG_BINPOLY, /* Binary field, poly basis */ + FTAG_BINNORM /* Binary field, normal basis */ }; typedef struct ecentry { const char *name; - const ecdata *data; + ecdata *data; } ecentry; /*----- Global variables --------------------------------------------------*/