2 * Copyright 2020 The OpenSSL Project Authors. All Rights Reserved.
4 * Licensed under the Apache License 2.0 (the "License"). You may not use
5 * this file except in compliance with the License. You can obtain a copy
6 * in the file LICENSE in the source distribution or at
7 * https://www.openssl.org/source/license.html
11 * ECDH/ECDSA low level APIs are deprecated for public use, but still ok for
14 #include "internal/deprecated.h"
16 #include <openssl/core_numbers.h>
17 #include <openssl/core_names.h>
18 #include <openssl/bn.h>
19 #include <openssl/err.h>
20 #include <openssl/objects.h>
21 #include "crypto/bn.h"
22 #include "crypto/ec.h"
23 #include "prov/implementations.h"
24 #include "prov/providercommon.h"
25 #include "prov/providercommonerr.h"
26 #include "prov/provider_ctx.h"
27 #include "internal/param_build_set.h"
29 static OSSL_OP_keymgmt_new_fn ec_newdata;
30 static OSSL_OP_keymgmt_gen_init_fn ec_gen_init;
31 static OSSL_OP_keymgmt_gen_set_template_fn ec_gen_set_template;
32 static OSSL_OP_keymgmt_gen_set_params_fn ec_gen_set_params;
33 static OSSL_OP_keymgmt_gen_settable_params_fn ec_gen_settable_params;
34 static OSSL_OP_keymgmt_gen_get_params_fn ec_gen_get_params;
35 static OSSL_OP_keymgmt_gen_gettable_params_fn ec_gen_gettable_params;
36 static OSSL_OP_keymgmt_gen_fn ec_gen;
37 static OSSL_OP_keymgmt_gen_cleanup_fn ec_gen_cleanup;
38 static OSSL_OP_keymgmt_free_fn ec_freedata;
39 static OSSL_OP_keymgmt_get_params_fn ec_get_params;
40 static OSSL_OP_keymgmt_gettable_params_fn ec_gettable_params;
41 static OSSL_OP_keymgmt_set_params_fn ec_set_params;
42 static OSSL_OP_keymgmt_settable_params_fn ec_settable_params;
43 static OSSL_OP_keymgmt_has_fn ec_has;
44 static OSSL_OP_keymgmt_match_fn ec_match;
45 static OSSL_OP_keymgmt_validate_fn ec_validate;
46 static OSSL_OP_keymgmt_import_fn ec_import;
47 static OSSL_OP_keymgmt_import_types_fn ec_import_types;
48 static OSSL_OP_keymgmt_export_fn ec_export;
49 static OSSL_OP_keymgmt_export_types_fn ec_export_types;
50 static OSSL_OP_keymgmt_query_operation_name_fn ec_query_operation_name;
52 #define EC_DEFAULT_MD "SHA256"
53 #define EC_POSSIBLE_SELECTIONS \
54 (OSSL_KEYMGMT_SELECT_KEYPAIR | OSSL_KEYMGMT_SELECT_ALL_PARAMETERS)
57 const char *ec_query_operation_name(int operation_id)
59 switch (operation_id) {
62 case OSSL_OP_SIGNATURE:
69 int domparams_to_params(const EC_KEY *ec, OSSL_PARAM_BLD *tmpl,
78 ecg = EC_KEY_get0_group(ec);
82 curve_nid = EC_GROUP_get_curve_name(ecg);
84 if (curve_nid == NID_undef) {
85 /* TODO(3.0): should we support explicit parameters curves? */
89 const char *curve_name = NULL;
91 if ((curve_name = ec_curve_nid2name(curve_nid)) == NULL)
93 if (!ossl_param_build_set_utf8_string(tmpl, params,
94 OSSL_PKEY_PARAM_EC_NAME,
104 * Callers of key_to_params MUST make sure that domparams_to_params is also
107 * This function only exports the bare keypair, domain parameters and other
108 * parameters are exported separately.
111 int key_to_params(const EC_KEY *eckey, OSSL_PARAM_BLD *tmpl,
112 OSSL_PARAM params[], int include_private,
113 unsigned char **pub_key)
115 const BIGNUM *priv_key = NULL;
116 const EC_POINT *pub_point = NULL;
117 const EC_GROUP *ecg = NULL;
118 size_t pub_key_len = 0;
120 BN_CTX *bnctx = NULL;
123 || (ecg = EC_KEY_get0_group(eckey)) == NULL)
126 priv_key = EC_KEY_get0_private_key(eckey);
127 pub_point = EC_KEY_get0_public_key(eckey);
129 if (pub_point != NULL) {
131 * EC_POINT_point2buf() can generate random numbers in some
132 * implementations so we need to ensure we use the correct libctx.
134 bnctx = BN_CTX_new_ex(ec_key_get_libctx(eckey));
138 /* convert pub_point to a octet string according to the SECG standard */
139 if ((pub_key_len = EC_POINT_point2buf(ecg, pub_point,
140 POINT_CONVERSION_COMPRESSED,
141 pub_key, bnctx)) == 0
142 || !ossl_param_build_set_octet_string(tmpl, params,
143 OSSL_PKEY_PARAM_PUB_KEY,
144 *pub_key, pub_key_len))
148 if (priv_key != NULL && include_private) {
153 * Key import/export should never leak the bit length of the secret
156 * For this reason, on export we use padded BIGNUMs with fixed length.
158 * When importing we also should make sure that, even if short lived,
159 * the newly created BIGNUM is marked with the BN_FLG_CONSTTIME flag as
160 * soon as possible, so that any processing of this BIGNUM might opt for
161 * constant time implementations in the backend.
163 * Setting the BN_FLG_CONSTTIME flag alone is never enough, we also have
164 * to preallocate the BIGNUM internal buffer to a fixed public size big
165 * enough that operations performed during the processing never trigger
166 * a realloc which would leak the size of the scalar through memory
172 * The order of the large prime subgroup of the curve is our choice for
173 * a fixed public size, as that is generally the upper bound for
174 * generating a private key in EC cryptosystems and should fit all valid
177 * For padding on export we just use the bit length of the order
178 * converted to bytes (rounding up).
180 * For preallocating the BIGNUM storage we look at the number of "words"
181 * required for the internal representation of the order, and we
182 * preallocate 2 extra "words" in case any of the subsequent processing
183 * might temporarily overflow the order length.
185 ecbits = EC_GROUP_order_bits(ecg);
188 sz = (ecbits + 7 ) / 8;
190 if (!ossl_param_build_set_bn_pad(tmpl, params,
191 OSSL_PKEY_PARAM_PRIV_KEY,
202 int otherparams_to_params(const EC_KEY *ec, OSSL_PARAM_BLD *tmpl,
205 int ecdh_cofactor_mode = 0;
211 (EC_KEY_get_flags(ec) & EC_FLAG_COFACTOR_ECDH) ? 1 : 0;
212 return ossl_param_build_set_int(tmpl, params,
213 OSSL_PKEY_PARAM_USE_COFACTOR_ECDH,
218 void *ec_newdata(void *provctx)
220 return EC_KEY_new_ex(PROV_LIBRARY_CONTEXT_OF(provctx));
224 void ec_freedata(void *keydata)
226 EC_KEY_free(keydata);
230 int ec_has(void *keydata, int selection)
232 EC_KEY *ec = keydata;
236 if ((selection & EC_POSSIBLE_SELECTIONS) != 0)
239 if ((selection & OSSL_KEYMGMT_SELECT_PUBLIC_KEY) != 0)
240 ok = ok && (EC_KEY_get0_public_key(ec) != NULL);
241 if ((selection & OSSL_KEYMGMT_SELECT_PRIVATE_KEY) != 0)
242 ok = ok && (EC_KEY_get0_private_key(ec) != NULL);
243 if ((selection & OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS) != 0)
244 ok = ok && (EC_KEY_get0_group(ec) != NULL);
246 * We consider OSSL_KEYMGMT_SELECT_OTHER_PARAMETERS to always be
247 * available, so no extra check is needed other than the previous one
248 * against EC_POSSIBLE_SELECTIONS.
254 static int ec_match(const void *keydata1, const void *keydata2, int selection)
256 const EC_KEY *ec1 = keydata1;
257 const EC_KEY *ec2 = keydata2;
258 const EC_GROUP *group_a = EC_KEY_get0_group(ec1);
259 const EC_GROUP *group_b = EC_KEY_get0_group(ec2);
262 if ((selection & OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS) != 0)
263 ok = ok && group_a != NULL && group_b != NULL
264 && EC_GROUP_cmp(group_a, group_b, NULL) == 0;
265 if ((selection & OSSL_KEYMGMT_SELECT_PRIVATE_KEY) != 0) {
266 const BIGNUM *pa = EC_KEY_get0_private_key(ec1);
267 const BIGNUM *pb = EC_KEY_get0_private_key(ec2);
269 ok = ok && BN_cmp(pa, pb) == 0;
271 if ((selection & OSSL_KEYMGMT_SELECT_PUBLIC_KEY) != 0) {
272 const EC_POINT *pa = EC_KEY_get0_public_key(ec1);
273 const EC_POINT *pb = EC_KEY_get0_public_key(ec2);
275 ok = ok && EC_POINT_cmp(group_b, pa, pb, NULL);
281 int ec_import(void *keydata, int selection, const OSSL_PARAM params[])
283 EC_KEY *ec = keydata;
290 * In this implementation, we can export/import only keydata in the
291 * following combinations:
292 * - domain parameters only
293 * - public key with associated domain parameters (+optional other params)
294 * - private key with associated public key and domain parameters
295 * (+optional other params)
298 * - domain parameters must always be requested
299 * - private key must be requested alongside public key
300 * - other parameters must be requested only alongside a key
302 if ((selection & OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS) == 0)
304 if ((selection & OSSL_KEYMGMT_SELECT_PRIVATE_KEY) != 0
305 && (selection & OSSL_KEYMGMT_SELECT_PUBLIC_KEY) == 0)
307 if ((selection & OSSL_KEYMGMT_SELECT_OTHER_PARAMETERS) != 0
308 && (selection & OSSL_KEYMGMT_SELECT_KEYPAIR) == 0)
311 if ((selection & OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS) != 0)
312 ok = ok && ec_key_domparams_fromdata(ec, params);
313 if ((selection & OSSL_KEYMGMT_SELECT_KEYPAIR) != 0) {
314 int include_private =
315 selection & OSSL_KEYMGMT_SELECT_PRIVATE_KEY ? 1 : 0;
317 ok = ok && ec_key_fromdata(ec, params, include_private);
319 if ((selection & OSSL_KEYMGMT_SELECT_OTHER_PARAMETERS) != 0)
320 ok = ok && ec_key_otherparams_fromdata(ec, params);
326 int ec_export(void *keydata, int selection, OSSL_CALLBACK *param_cb,
329 EC_KEY *ec = keydata;
330 OSSL_PARAM_BLD *tmpl;
331 OSSL_PARAM *params = NULL;
332 unsigned char *pub_key = NULL;
339 * In this implementation, we can export/import only keydata in the
340 * following combinations:
341 * - domain parameters only
342 * - public key with associated domain parameters (+optional other params)
343 * - private key with associated public key and domain parameters
344 * (+optional other params)
347 * - domain parameters must always be requested
348 * - private key must be requested alongside public key
349 * - other parameters must be requested only alongside a key
351 if ((selection & OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS) == 0)
353 if ((selection & OSSL_KEYMGMT_SELECT_PRIVATE_KEY) != 0
354 && (selection & OSSL_KEYMGMT_SELECT_PUBLIC_KEY) == 0)
356 if ((selection & OSSL_KEYMGMT_SELECT_OTHER_PARAMETERS) != 0
357 && (selection & OSSL_KEYMGMT_SELECT_KEYPAIR) == 0)
360 tmpl = OSSL_PARAM_BLD_new();
364 if ((selection & OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS) != 0)
365 ok = ok && domparams_to_params(ec, tmpl, NULL);
367 if ((selection & OSSL_KEYMGMT_SELECT_KEYPAIR) != 0) {
368 int include_private =
369 selection & OSSL_KEYMGMT_SELECT_PRIVATE_KEY ? 1 : 0;
371 ok = ok && key_to_params(ec, tmpl, NULL, include_private, &pub_key);
373 if ((selection & OSSL_KEYMGMT_SELECT_OTHER_PARAMETERS) != 0)
374 ok = ok && otherparams_to_params(ec, tmpl, NULL);
376 if (ok && (params = OSSL_PARAM_BLD_to_param(tmpl)) != NULL)
377 ok = param_cb(params, cbarg);
379 OSSL_PARAM_BLD_free_params(params);
380 OSSL_PARAM_BLD_free(tmpl);
381 OPENSSL_free(pub_key);
385 /* IMEXPORT = IMPORT + EXPORT */
387 # define EC_IMEXPORTABLE_DOM_PARAMETERS \
388 OSSL_PARAM_utf8_string(OSSL_PKEY_PARAM_EC_NAME, NULL, 0)
389 # define EC_IMEXPORTABLE_PUBLIC_KEY \
390 OSSL_PARAM_octet_string(OSSL_PKEY_PARAM_PUB_KEY, NULL, 0)
391 # define EC_IMEXPORTABLE_PRIVATE_KEY \
392 OSSL_PARAM_BN(OSSL_PKEY_PARAM_PRIV_KEY, NULL, 0)
393 # define EC_IMEXPORTABLE_OTHER_PARAMETERS \
394 OSSL_PARAM_int(OSSL_PKEY_PARAM_USE_COFACTOR_ECDH, NULL)
397 * Include all the possible combinations of OSSL_PARAM arrays for
398 * ec_imexport_types().
400 * They are in a separate file as it is ~100 lines of unreadable and
401 * uninteresting machine generated stuff.
403 * TODO(3.0): the generated list looks quite ugly, as to cover all possible
404 * combinations of the bits in `selection`, it also includes combinations that
405 * are not really useful: we might want to consider alternatives to this
408 #include "ec_kmgmt_imexport.inc"
411 const OSSL_PARAM *ec_imexport_types(int selection)
415 if ((selection & OSSL_KEYMGMT_SELECT_PRIVATE_KEY) != 0)
417 if ((selection & OSSL_KEYMGMT_SELECT_PUBLIC_KEY) != 0)
419 if ((selection & OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS) != 0)
421 if ((selection & OSSL_KEYMGMT_SELECT_OTHER_PARAMETERS) != 0)
423 return ec_types[type_select];
427 const OSSL_PARAM *ec_import_types(int selection)
429 return ec_imexport_types(selection);
433 const OSSL_PARAM *ec_export_types(int selection)
435 return ec_imexport_types(selection);
439 int ec_get_params(void *key, OSSL_PARAM params[])
443 const EC_GROUP *ecg = NULL;
445 unsigned char *pub_key = NULL;
447 ecg = EC_KEY_get0_group(eck);
451 if ((p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_MAX_SIZE)) != NULL
452 && !OSSL_PARAM_set_int(p, ECDSA_size(eck)))
454 if ((p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_BITS)) != NULL
455 && !OSSL_PARAM_set_int(p, EC_GROUP_order_bits(ecg)))
457 if ((p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_SECURITY_BITS)) != NULL) {
458 int ecbits, sec_bits;
460 ecbits = EC_GROUP_order_bits(ecg);
463 * The following estimates are based on the values published
464 * in Table 2 of "NIST Special Publication 800-57 Part 1 Revision 4"
465 * at http://dx.doi.org/10.6028/NIST.SP.800-57pt1r4 .
467 * Note that the above reference explicitly categorizes algorithms in a
468 * discrete set of values {80, 112, 128, 192, 256}, and that it is
469 * relevant only for NIST approved Elliptic Curves, while OpenSSL
470 * applies the same logic also to other curves.
472 * Classifications produced by other standardazing bodies might differ,
473 * so the results provided for "bits of security" by this provider are
474 * to be considered merely indicative, and it is the users'
475 * responsibility to compare these values against the normative
476 * references that may be relevant for their intent and purposes.
480 else if (ecbits >= 384)
482 else if (ecbits >= 256)
484 else if (ecbits >= 224)
486 else if (ecbits >= 160)
489 sec_bits = ecbits / 2;
491 if (!OSSL_PARAM_set_int(p, sec_bits))
495 if ((p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_DEFAULT_DIGEST)) != NULL
496 && !OSSL_PARAM_set_utf8_string(p, EC_DEFAULT_MD))
499 p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_USE_COFACTOR_ECDH);
501 int ecdh_cofactor_mode = 0;
504 (EC_KEY_get_flags(eck) & EC_FLAG_COFACTOR_ECDH) ? 1 : 0;
506 if (!OSSL_PARAM_set_int(p, ecdh_cofactor_mode))
509 ret = domparams_to_params(eck, NULL, params)
510 && key_to_params(eck, NULL, params, 1, &pub_key)
511 && otherparams_to_params(eck, NULL, params);
512 OPENSSL_free(pub_key);
516 static const OSSL_PARAM ec_known_gettable_params[] = {
517 OSSL_PARAM_int(OSSL_PKEY_PARAM_BITS, NULL),
518 OSSL_PARAM_int(OSSL_PKEY_PARAM_SECURITY_BITS, NULL),
519 OSSL_PARAM_int(OSSL_PKEY_PARAM_MAX_SIZE, NULL),
520 EC_IMEXPORTABLE_DOM_PARAMETERS,
521 EC_IMEXPORTABLE_PUBLIC_KEY,
522 EC_IMEXPORTABLE_PRIVATE_KEY,
523 EC_IMEXPORTABLE_OTHER_PARAMETERS,
528 const OSSL_PARAM *ec_gettable_params(void)
530 return ec_known_gettable_params;
533 static const OSSL_PARAM ec_known_settable_params[] = {
534 OSSL_PARAM_int(OSSL_PKEY_PARAM_USE_COFACTOR_ECDH, NULL),
539 const OSSL_PARAM *ec_settable_params(void)
541 return ec_known_settable_params;
545 int ec_set_params(void *key, const OSSL_PARAM params[])
550 p = OSSL_PARAM_locate_const(params, OSSL_PKEY_PARAM_USE_COFACTOR_ECDH);
551 if (p != NULL && !ec_set_param_ecdh_cofactor_mode(eck, p))
558 int ec_validate(void *keydata, int selection)
560 EC_KEY *eck = keydata;
562 BN_CTX *ctx = BN_CTX_new_ex(ec_key_get_libctx(eck));
567 if ((selection & EC_POSSIBLE_SELECTIONS) != 0)
570 if ((selection & OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS) != 0)
571 ok = ok && EC_GROUP_check(EC_KEY_get0_group(eck), ctx);
573 if ((selection & OSSL_KEYMGMT_SELECT_PUBLIC_KEY) != 0)
574 ok = ok && ec_key_public_check(eck, ctx);
576 if ((selection & OSSL_KEYMGMT_SELECT_PRIVATE_KEY) != 0)
577 ok = ok && ec_key_private_check(eck);
579 if ((selection & OSSL_KEYMGMT_SELECT_KEYPAIR) == OSSL_KEYMGMT_SELECT_KEYPAIR)
580 ok = ok && ec_key_pairwise_check(eck, ctx);
593 static void *ec_gen_init(void *provctx, int selection)
595 OPENSSL_CTX *libctx = PROV_LIBRARY_CONTEXT_OF(provctx);
596 struct ec_gen_ctx *gctx = NULL;
598 if ((selection & (EC_POSSIBLE_SELECTIONS)) == 0)
601 if ((gctx = OPENSSL_zalloc(sizeof(*gctx))) != NULL) {
602 gctx->libctx = libctx;
603 gctx->gen_group = NULL;
604 gctx->selection = selection;
609 static int ec_gen_set_group(void *genctx, int nid)
611 struct ec_gen_ctx *gctx = genctx;
614 group = EC_GROUP_new_by_curve_name_ex(gctx->libctx, nid);
616 ERR_raise(ERR_LIB_PROV, PROV_R_INVALID_CURVE);
619 EC_GROUP_free(gctx->gen_group);
620 gctx->gen_group = group;
623 static int ec_gen_set_template(void *genctx, void *templ)
625 struct ec_gen_ctx *gctx = genctx;
627 const EC_GROUP *ec_group;
629 if (gctx == NULL || ec == NULL)
631 if ((ec_group = EC_KEY_get0_group(ec)) == NULL)
633 return ec_gen_set_group(gctx, EC_GROUP_get_curve_name(ec_group));
636 static int ec_gen_set_params(void *genctx, const OSSL_PARAM params[])
638 struct ec_gen_ctx *gctx = genctx;
641 if ((p = OSSL_PARAM_locate_const(params, OSSL_PKEY_PARAM_EC_NAME))
643 const char *curve_name = NULL;
646 switch (p->data_type) {
647 case OSSL_PARAM_UTF8_STRING:
648 /* The OSSL_PARAM functions have no support for this */
649 curve_name = p->data;
650 ret = (curve_name != NULL);
652 case OSSL_PARAM_UTF8_PTR:
653 ret = OSSL_PARAM_get_utf8_ptr(p, &curve_name);
658 int nid = ec_curve_name2nid(curve_name);
660 if (nid == NID_undef) {
661 ERR_raise(ERR_LIB_PROV, PROV_R_INVALID_CURVE);
664 ret = ec_gen_set_group(gctx, nid);
672 static const OSSL_PARAM *ec_gen_settable_params(void *provctx)
674 static OSSL_PARAM settable[] = {
675 { OSSL_PKEY_PARAM_EC_NAME, OSSL_PARAM_UTF8_STRING, NULL, 0, 0 },
682 static int ec_gen_get_params(void *genctx, OSSL_PARAM params[])
684 struct ec_gen_ctx *gctx = genctx;
687 if ((p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_EC_NAME)) != NULL) {
688 int nid = EC_GROUP_get_curve_name(gctx->gen_group);
690 const char *curve_name = ec_curve_nid2name(nid);
692 switch (p->data_type) {
693 case OSSL_PARAM_UTF8_STRING:
694 ret = OSSL_PARAM_set_utf8_string(p, curve_name);
696 case OSSL_PARAM_UTF8_PTR:
697 ret = OSSL_PARAM_set_utf8_ptr(p, curve_name);
705 static const OSSL_PARAM *ec_gen_gettable_params(void *provctx)
707 static OSSL_PARAM gettable[] = {
708 { OSSL_PKEY_PARAM_EC_NAME, OSSL_PARAM_UTF8_PTR, NULL, 0, 0 },
715 static int ec_gen_assign_group(EC_KEY *ec, EC_GROUP *group)
718 ERR_raise(ERR_LIB_PROV, PROV_R_NO_PARAMETERS_SET);
721 return EC_KEY_set_group(ec, group) > 0;
725 * The callback arguments (osslcb & cbarg) are not used by EC_KEY generation
727 static void *ec_gen(void *genctx, OSSL_CALLBACK *osslcb, void *cbarg)
729 struct ec_gen_ctx *gctx = genctx;
731 int ret = 1; /* Start optimistically */
734 || (ec = EC_KEY_new_ex(gctx->libctx)) == NULL)
737 /* We must always assign a group, no matter what */
738 ret = ec_gen_assign_group(ec, gctx->gen_group);
739 /* Whether you want it or not, you get a keypair, not just one half */
740 if ((gctx->selection & OSSL_KEYMGMT_SELECT_KEYPAIR) != 0)
741 ret = ret && EC_KEY_generate_key(ec);
746 /* Something went wrong, throw the key away */
751 static void ec_gen_cleanup(void *genctx)
753 struct ec_gen_ctx *gctx = genctx;
758 EC_GROUP_free(gctx->gen_group);
762 const OSSL_DISPATCH ec_keymgmt_functions[] = {
763 { OSSL_FUNC_KEYMGMT_NEW, (void (*)(void))ec_newdata },
764 { OSSL_FUNC_KEYMGMT_GEN_INIT, (void (*)(void))ec_gen_init },
765 { OSSL_FUNC_KEYMGMT_GEN_SET_TEMPLATE,
766 (void (*)(void))ec_gen_set_template },
767 { OSSL_FUNC_KEYMGMT_GEN_SET_PARAMS, (void (*)(void))ec_gen_set_params },
768 { OSSL_FUNC_KEYMGMT_GEN_SETTABLE_PARAMS,
769 (void (*)(void))ec_gen_settable_params },
770 { OSSL_FUNC_KEYMGMT_GEN_GET_PARAMS, (void (*)(void))ec_gen_get_params },
771 { OSSL_FUNC_KEYMGMT_GEN_GETTABLE_PARAMS,
772 (void (*)(void))ec_gen_gettable_params },
773 { OSSL_FUNC_KEYMGMT_GEN, (void (*)(void))ec_gen },
774 { OSSL_FUNC_KEYMGMT_GEN_CLEANUP, (void (*)(void))ec_gen_cleanup },
775 { OSSL_FUNC_KEYMGMT_FREE, (void (*)(void))ec_freedata },
776 { OSSL_FUNC_KEYMGMT_GET_PARAMS, (void (*) (void))ec_get_params },
777 { OSSL_FUNC_KEYMGMT_GETTABLE_PARAMS, (void (*) (void))ec_gettable_params },
778 { OSSL_FUNC_KEYMGMT_SET_PARAMS, (void (*) (void))ec_set_params },
779 { OSSL_FUNC_KEYMGMT_SETTABLE_PARAMS, (void (*) (void))ec_settable_params },
780 { OSSL_FUNC_KEYMGMT_HAS, (void (*)(void))ec_has },
781 { OSSL_FUNC_KEYMGMT_MATCH, (void (*)(void))ec_match },
782 { OSSL_FUNC_KEYMGMT_VALIDATE, (void (*)(void))ec_validate },
783 { OSSL_FUNC_KEYMGMT_IMPORT, (void (*)(void))ec_import },
784 { OSSL_FUNC_KEYMGMT_IMPORT_TYPES, (void (*)(void))ec_import_types },
785 { OSSL_FUNC_KEYMGMT_EXPORT, (void (*)(void))ec_export },
786 { OSSL_FUNC_KEYMGMT_EXPORT_TYPES, (void (*)(void))ec_export_types },
787 { OSSL_FUNC_KEYMGMT_QUERY_OPERATION_NAME,
788 (void (*)(void))ec_query_operation_name },