3 * $Id: ec-keys.h,v 1.3 2004/04/08 01:36:15 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 #ifndef CATACOMB_EC_KEYS_H
31 #define CATACOMB_EC_KEYS_H
37 /*----- Header files ------------------------------------------------------*/
43 #ifndef CATACOMB_KEY_H
47 /*----- Key structures ----------------------------------------------------*/
49 typedef struct ec_param
{
50 ec_info ei
; /* Curve information */
51 char *cstr
; /* Curve definition string */
54 typedef struct ec_pub
{
55 ec_info ei
; /* Curve information */
56 char *cstr
; /* Curve definition string */
57 ec p
; /* Public point */
60 typedef struct ec_priv
{
61 ec_info ei
; /* Curve information */
62 char *cstr
; /* Curve definition string */
63 ec p
; /* Public point */
64 mp
*x
; /* Secret exponent */
67 extern const key_fetchdef ec_paramfetch
[];
68 #define EC_PARAMFETCHSZ 3
70 extern const key_fetchdef ec_pubfetch
[];
71 #define EC_PUBFETCHSZ 4
73 extern const key_fetchdef ec_privfetch
[];
74 #define EC_PRIVFETCHSZ 7
76 /*----- Functions provided ------------------------------------------------*/
78 /* --- @ec_paramfree@, @ec_pubfree@, @ec_privfree@ --- *
80 * Arguments: @ec_param *ep@, @ec_pub *ep@, @ec_priv *ep@ = pointer to
85 * Use: Frees an elliptic curve key block
88 extern void ec_paramfree(ec_param */
*ep*/
);
89 extern void ec_pubfree(ec_pub */
*ep*/
);
90 extern void ec_privfree(ec_priv */
*ep*/
);
92 /*----- That's all, folks -------------------------------------------------*/