X-Git-Url: https://git.distorted.org.uk/u/mdw/catacomb/blobdiff_plain/8ef2f81dfbf105ae89082a340ac56f46368387f0..1ba83484ee5bb486da9aa958576de4bc29ef0c1d:/ec-keys.h diff --git a/ec-keys.h b/ec-keys.h new file mode 100644 index 0000000..847bc6a --- /dev/null +++ b/ec-keys.h @@ -0,0 +1,83 @@ +/* -*-c-*- + * + * $Id: ec-keys.h,v 1.1 2004/03/28 01:58:47 mdw Exp $ + * + * Elliptic curve key-fetching + * + * (c) 2004 Straylight/Edgeware + */ + +/*----- Licensing notice --------------------------------------------------* + * + * This file is part of Catacomb. + * + * Catacomb is free software; you can redistribute it and/or modify + * it under the terms of the GNU Library General Public License as + * published by the Free Software Foundation; either version 2 of the + * License, or (at your option) any later version. + * + * Catacomb is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with Catacomb; if not, write to the Free + * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, + * MA 02111-1307, USA. + */ + +/*----- Revision history --------------------------------------------------* + * + * $Log: ec-keys.h,v $ + * Revision 1.1 2004/03/28 01:58:47 mdw + * Generate, store and retreive elliptic curve keys. + * + */ + +#ifndef CATACOMB_EC_KEYS_H +#define CATACOMB_EC_KEYS_H + +#ifdef __cplusplus + extern "C" { +#endif + +/*----- Header files ------------------------------------------------------*/ + +#ifndef CATACOMB_EC_H +# include "ec.h" +#endif + +#ifndef CATACOMB_KEY_H +# include "key.h" +#endif + +/*----- Key structures ----------------------------------------------------*/ + +typedef struct ec_param { + ec_info ei; /* Curve information */ + char *cstr; /* Curve definition string */ +} ec_param; + +typedef struct ec_pub { + ec_info ei; /* Curve information */ + char *cstr; /* Curve definition string */ + ec p; /* Public point */ +} ec_pub; + +typedef struct ec_priv { + ec_info ei; /* Curve information */ + char *cstr; /* Curve definition string */ + ec p; /* Public point */ + mp *x; /* Secret exponent */ +} ec_priv; + +extern const key_fetchdef ec_paramfetch[], ec_pubfetch[], ec_privfetch[]; + +/*----- That's all, folks -------------------------------------------------*/ + +#ifdef __cplusplus + } +#endif + +#endif