Add cyclic group abstraction, with test code. Separate off exponentation
[u/mdw/catacomb] / ec-keys.h
index 847bc6a..c7561e7 100644 (file)
--- a/ec-keys.h
+++ b/ec-keys.h
@@ -1,6 +1,6 @@
 /* -*-c-*-
  *
- * $Id: ec-keys.h,v 1.1 2004/03/28 01:58:47 mdw Exp $
+ * $Id: ec-keys.h,v 1.2 2004/04/01 12:50:09 mdw Exp $
  *
  * Elliptic curve key-fetching
  *
 /*----- Revision history --------------------------------------------------* 
  *
  * $Log: ec-keys.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/28 01:58:47  mdw
  * Generate, store and retreive elliptic curve keys.
  *
@@ -72,7 +79,30 @@ typedef struct ec_priv {
   mp *x;                               /* Secret exponent */
 } ec_priv;
 
-extern const key_fetchdef ec_paramfetch[], ec_pubfetch[], ec_privfetch[];
+extern const key_fetchdef ec_paramfetch[];
+#define EC_PARAMFETCHSZ 3
+
+extern const key_fetchdef ec_pubfetch[];
+#define EC_PUBFETCHSZ 4
+
+extern const key_fetchdef ec_privfetch[];
+#define EC_PRIVFETCHSZ 7
+
+/*----- Functions provided ------------------------------------------------*/
+
+/* --- @ec_paramfree@, @ec_pubfree@, @ec_privfree@ --- *
+ *
+ * Arguments:  @ec_param *ep@, @ec_pub *ep@, @ec_priv *ep@ = pointer to
+ *                     key block to free
+ *
+ * Returns:    ---
+ *
+ * Use:                Frees an elliptic curve key block
+ */
+
+extern void ec_paramfree(ec_param */*ep*/);
+extern void ec_pubfree(ec_pub */*ep*/);
+extern void ec_privfree(ec_priv */*ep*/);
 
 /*----- That's all, folks -------------------------------------------------*/