Add cyclic group abstraction, with test code. Separate off exponentation
[u/mdw/catacomb] / ectab.h
diff --git a/ectab.h b/ectab.h
index d8d4302..925924d 100644 (file)
--- a/ectab.h
+++ b/ectab.h
@@ -1,8 +1,8 @@
 /* -*-c-*-
  *
 /* -*-c-*-
  *
- * $Id: ectab.h,v 1.1 2004/03/27 17:54:11 mdw Exp $
+ * $Id: ectab.h,v 1.2 2004/04/01 12:50:09 mdw Exp $
  *
  *
- * Table of standard elliptic curves (internal)
+ * Table of standard elliptic curves
  *
  * (c) 2004 Straylight/Edgeware
  */
  *
  * (c) 2004 Straylight/Edgeware
  */
 /*----- Revision history --------------------------------------------------* 
  *
  * $Log: ectab.h,v $
 /*----- Revision history --------------------------------------------------* 
  *
  * $Log: ectab.h,v $
+ * 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.
  *
  * Revision 1.1  2004/03/27 17:54:11  mdw
  * Standard curves and curve checking.
  *
 
 typedef struct ecdata {
   unsigned ftag;                       /* The kind of curve this is */
 
 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;                                        /* Modulus */
+  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 {
 } ecdata;
 
 enum {
@@ -67,7 +72,7 @@ enum {
 
 typedef struct ecentry {
   const char *name;
 
 typedef struct ecentry {
   const char *name;
-  const ecdata *data;
+  ecdata *data;
 } ecentry;
 
 /*----- Global variables --------------------------------------------------*/
 } ecentry;
 
 /*----- Global variables --------------------------------------------------*/