X-Git-Url: https://git.distorted.org.uk/u/mdw/catacomb/blobdiff_plain/1ba83484ee5bb486da9aa958576de4bc29ef0c1d..34e4f738bcba58e6d8c4cabbb0b3232a65b42a9d:/ec-keys.h diff --git a/ec-keys.h b/ec-keys.h index 847bc6a..c7561e7 100644 --- 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 * @@ -30,6 +30,13 @@ /*----- 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 -------------------------------------------------*/