summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/ec/ec.h
diff options
context:
space:
mode:
authortb <>2019-01-19 01:07:00 +0000
committertb <>2019-01-19 01:07:00 +0000
commitdc38b357c3a6e0db4a7172af29148961b86b0724 (patch)
treef28042e7a3c924e4bf846d6cded984e02699177d /src/lib/libcrypto/ec/ec.h
parentf11f1c0f8ad579cfb88a2559e3efe0e0367cec85 (diff)
downloadopenbsd-dc38b357c3a6e0db4a7172af29148961b86b0724.tar.gz
openbsd-dc38b357c3a6e0db4a7172af29148961b86b0724.tar.bz2
openbsd-dc38b357c3a6e0db4a7172af29148961b86b0724.zip
Partial port of EC_KEY_METHOD from OpenSSL 1.1.
This commit adds init/free, support for signing, setting and getting the method, engine support as well as extra data. from markus
Diffstat (limited to 'src/lib/libcrypto/ec/ec.h')
-rw-r--r--src/lib/libcrypto/ec/ec.h31
1 files changed, 30 insertions, 1 deletions
diff --git a/src/lib/libcrypto/ec/ec.h b/src/lib/libcrypto/ec/ec.h
index d9df48603a..1173459dae 100644
--- a/src/lib/libcrypto/ec/ec.h
+++ b/src/lib/libcrypto/ec/ec.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: ec.h,v 1.13 2018/05/19 10:37:02 tb Exp $ */ 1/* $OpenBSD: ec.h,v 1.14 2019/01/19 01:07:00 tb Exp $ */
2/* 2/*
3 * Originally written by Bodo Moeller for the OpenSSL project. 3 * Originally written by Bodo Moeller for the OpenSSL project.
4 */ 4 */
@@ -705,6 +705,7 @@ int ECPKParameters_print_fp(FILE *fp, const EC_GROUP *x, int off);
705/********************************************************************/ 705/********************************************************************/
706 706
707typedef struct ec_key_st EC_KEY; 707typedef struct ec_key_st EC_KEY;
708typedef struct ec_key_method_st EC_KEY_METHOD;
708 709
709/* some values for the encoding_flag */ 710/* some values for the encoding_flag */
710#define EC_PKEY_NO_PARAMETERS 0x001 711#define EC_PKEY_NO_PARAMETERS 0x001
@@ -945,6 +946,34 @@ int ECParameters_print_fp(FILE *fp, const EC_KEY *key);
945 */ 946 */
946int EC_KEY_print_fp(FILE *fp, const EC_KEY *key, int off); 947int EC_KEY_print_fp(FILE *fp, const EC_KEY *key, int off);
947 948
949#define EC_KEY_get_ex_new_index(l, p, newf, dupf, freef) \
950 CRYPTO_get_ex_new_index(CRYPTO_EX_INDEX_EC_KEY, l, p, newf, dupf, freef)
951int EC_KEY_set_ex_data(EC_KEY *key, int idx, void *arg);
952void *EC_KEY_get_ex_data(const EC_KEY *key, int idx);
953
954const EC_KEY_METHOD *EC_KEY_OpenSSL(void);
955const EC_KEY_METHOD *EC_KEY_get_default_method(void);
956void EC_KEY_set_default_method(const EC_KEY_METHOD *meth);
957const EC_KEY_METHOD *EC_KEY_get_method(const EC_KEY *key);
958int EC_KEY_set_method(EC_KEY *key, const EC_KEY_METHOD *meth);
959EC_KEY *EC_KEY_new_method(ENGINE *engine);
960EC_KEY_METHOD *EC_KEY_METHOD_new(const EC_KEY_METHOD *meth);
961void EC_KEY_METHOD_free(EC_KEY_METHOD *meth);
962void EC_KEY_METHOD_set_init(EC_KEY_METHOD *meth,
963 int (*init)(EC_KEY *key),
964 void (*finish)(EC_KEY *key),
965 int (*copy)(EC_KEY *dest, const EC_KEY *src),
966 int (*set_group)(EC_KEY *key, const EC_GROUP *grp),
967 int (*set_private)(EC_KEY *key, const BIGNUM *priv_key),
968 int (*set_public)(EC_KEY *key, const EC_POINT *pub_key));
969void EC_KEY_METHOD_get_init(EC_KEY_METHOD *meth,
970 int (**pinit)(EC_KEY *key),
971 void (**pfinish)(EC_KEY *key),
972 int (**pcopy)(EC_KEY *dest, const EC_KEY *src),
973 int (**pset_group)(EC_KEY *key, const EC_GROUP *grp),
974 int (**pset_private)(EC_KEY *key, const BIGNUM *priv_key),
975 int (**pset_public)(EC_KEY *key, const EC_POINT *pub_key));
976
948EC_KEY *ECParameters_dup(EC_KEY *key); 977EC_KEY *ECParameters_dup(EC_KEY *key);
949 978
950#ifndef __cplusplus 979#ifndef __cplusplus