From d1a451880ebc5f62039907365c2253e4afa9fd57 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Love=20H=C3=B6rnquist=20=C3=85strand?= Date: Sun, 22 Feb 2009 23:29:06 +0000 Subject: [PATCH] add bits needed for EC git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@24800 ec53bebd-3082-4978-b11e-865c3cabbd6b --- lib/hcrypto/ec.h | 41 +++++++++++++++++++++++++++++++++++++++++ lib/hcrypto/ecdh.h | 5 +++++ lib/hcrypto/ecdsa.h | 9 +++++++++ 3 files changed, 55 insertions(+) create mode 100644 lib/hcrypto/ec.h create mode 100644 lib/hcrypto/ecdh.h create mode 100644 lib/hcrypto/ecdsa.h diff --git a/lib/hcrypto/ec.h b/lib/hcrypto/ec.h new file mode 100644 index 000000000..e385ed30e --- /dev/null +++ b/lib/hcrypto/ec.h @@ -0,0 +1,41 @@ + +struct EC_KEY; +struct EC_GROUP; + +typedef struct EC_KEY EC_KEY; +typedef struct EC_GROUP EC_GROUP; + +unsigned long +EC_GROUP_get_degree(EC_GROUP *); + +EC_GROUP * +EC_KEY_get0_group(EC_KEY *); + +int +EC_GROUP_get_order(EC_GROUP *, BIGNUM *, BN_CTX *); + +EC_KEY * +o2i_ECPublicKey(EC_KEY **key, unsigned char **, size_t); + +void +EC_KEY_free(EC_KEY *); + +EC_KEY * +EC_KEY_free(void); + +EC_GROUP * +EC_GROUP_new_by_curve_name(int nid); + +void +EC_KEY_set_group(EC_KEY *, EC_GROUP *); + +void +EC_GROUP_free(EC_GROUP *); + +int +EC_KEY_check_key(const EC_KEY *); + +const BIGNUM *EC_KEY_get0_private_key(const EC_KEY *); + +int EC_KEY_set_private_key(EC_KEY *, const BIGNUM *); + diff --git a/lib/hcrypto/ecdh.h b/lib/hcrypto/ecdh.h new file mode 100644 index 000000000..e669ca101 --- /dev/null +++ b/lib/hcrypto/ecdh.h @@ -0,0 +1,5 @@ + +ECDH_compute_key(void *, size_t, + const EC_KEY *, const EC_KEY *, + void *(*KDF)(const void *, size_t, void *, size_t *)); + diff --git a/lib/hcrypto/ecdsa.h b/lib/hcrypto/ecdsa.h new file mode 100644 index 000000000..b4a60d5f1 --- /dev/null +++ b/lib/hcrypto/ecdsa.h @@ -0,0 +1,9 @@ + +int ECDSA_verify(int, const unsigned char *, unsigned int, + unsigned char *, unsigned int, EC_KEY *); + +int ECDSA_sign(int, const unsigned char *, unsigned int, + unsigned char *, unsigned int *, EC_KEY *); + +int ECDSA_size(EC_KEY *); +