3 * $Id: ec-keys.h,v 1.2 2004/04/01 12:50:09 mdw Exp $
5 * Elliptic curve key-fetching
7 * (c) 2004 Straylight/Edgeware
10 /*----- Licensing notice --------------------------------------------------*
12 * This file is part of Catacomb.
14 * Catacomb is free software; you can redistribute it and/or modify
15 * it under the terms of the GNU Library General Public License as
16 * published by the Free Software Foundation; either version 2 of the
17 * License, or (at your option) any later version.
19 * Catacomb is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU Library General Public License for more details.
24 * You should have received a copy of the GNU Library General Public
25 * License along with Catacomb; if not, write to the Free
26 * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
30 /*----- Revision history --------------------------------------------------*
33 * Revision 1.2 2004/04/01 12:50:09 mdw
34 * Add cyclic group abstraction, with test code. Separate off exponentation
35 * functions for better static linking. Fix a buttload of bugs on the way.
36 * Generally ensure that negative exponents do inversion correctly. Add
37 * table of standard prime-field subgroups. (Binary field subgroups are
38 * currently unimplemented but easy to add if anyone ever finds a good one.)
40 * Revision 1.1 2004/03/28 01:58:47 mdw
41 * Generate, store and retreive elliptic curve keys.
45 #ifndef CATACOMB_EC_KEYS_H
46 #define CATACOMB_EC_KEYS_H
52 /*----- Header files ------------------------------------------------------*/
58 #ifndef CATACOMB_KEY_H
62 /*----- Key structures ----------------------------------------------------*/
64 typedef struct ec_param
{
65 ec_info ei
; /* Curve information */
66 char *cstr
; /* Curve definition string */
69 typedef struct ec_pub
{
70 ec_info ei
; /* Curve information */
71 char *cstr
; /* Curve definition string */
72 ec p
; /* Public point */
75 typedef struct ec_priv
{
76 ec_info ei
; /* Curve information */
77 char *cstr
; /* Curve definition string */
78 ec p
; /* Public point */
79 mp
*x
; /* Secret exponent */
82 extern const key_fetchdef ec_paramfetch
[];
83 #define EC_PARAMFETCHSZ 3
85 extern const key_fetchdef ec_pubfetch
[];
86 #define EC_PUBFETCHSZ 4
88 extern const key_fetchdef ec_privfetch
[];
89 #define EC_PRIVFETCHSZ 7
91 /*----- Functions provided ------------------------------------------------*/
93 /* --- @ec_paramfree@, @ec_pubfree@, @ec_privfree@ --- *
95 * Arguments: @ec_param *ep@, @ec_pub *ep@, @ec_priv *ep@ = pointer to
100 * Use: Frees an elliptic curve key block
103 extern void ec_paramfree(ec_param */
*ep*/
);
104 extern void ec_pubfree(ec_pub */
*ep*/
);
105 extern void ec_privfree(ec_priv */
*ep*/
);
107 /*----- That's all, folks -------------------------------------------------*/