From b988894a7c1cb835f7f215967e567db58539b0f5 Mon Sep 17 00:00:00 2001 From: rtjk <47841774+rtjk@users.noreply.github.com> Date: Mon, 19 Aug 2024 11:58:28 +0200 Subject: [PATCH] fromat code Signed-off-by: rtjk <47841774+rtjk@users.noreply.github.com> --- oqsprov/oqs_decode_der2key.c | 380 +++-- oqsprov/oqs_encode_key2any.c | 1201 +++++++------- oqsprov/oqs_endecoder_common.c | 26 +- oqsprov/oqs_hyb_kem.c | 12 +- oqsprov/oqs_kem.c | 70 +- oqsprov/oqs_kmgmt.c | 1184 +++++++------- oqsprov/oqs_prov.h | 2705 +++++++++++++++++++++---------- oqsprov/oqs_sig.c | 460 +++--- oqsprov/oqsprov.c | 1240 +++++++++----- oqsprov/oqsprov_bio.c | 79 +- oqsprov/oqsprov_capabilities.c | 880 ++++++---- oqsprov/oqsprov_keys.c | 802 +++++---- test/oqs_test_endecode.c | 28 +- test/oqs_test_evp_pkey_params.c | 131 +- test/oqs_test_groups.c | 19 +- test/oqs_test_kems.c | 53 +- test/oqs_test_signatures.c | 75 +- test/oqs_test_tlssig.c | 31 +- test/test_common.c | 19 +- test/test_common.h | 44 +- test/tlstest_helpers.c | 55 +- 21 files changed, 5471 insertions(+), 4023 deletions(-) diff --git a/oqsprov/oqs_decode_der2key.c b/oqsprov/oqs_decode_der2key.c index ed735902..f694ae9b 100644 --- a/oqsprov/oqs_decode_der2key.c +++ b/oqsprov/oqs_decode_der2key.c @@ -26,19 +26,19 @@ int asn1_d2i_read_bio(BIO *in, BUF_MEM **pb); // TBD: OK to use? #include "oqs_endecoder_local.h" #ifdef NDEBUG -# define OQS_DEC_PRINTF(a) -# define OQS_DEC_PRINTF2(a, b) -# define OQS_DEC_PRINTF3(a, b, c) +#define OQS_DEC_PRINTF(a) +#define OQS_DEC_PRINTF2(a, b) +#define OQS_DEC_PRINTF3(a, b, c) #else -# define OQS_DEC_PRINTF(a) \ - if (getenv("OQSDEC")) \ - printf(a) -# define OQS_DEC_PRINTF2(a, b) \ - if (getenv("OQSDEC")) \ - printf(a, b) -# define OQS_DEC_PRINTF3(a, b, c) \ - if (getenv("OQSDEC")) \ - printf(a, b, c) +#define OQS_DEC_PRINTF(a) \ + if (getenv("OQSDEC")) \ + printf(a) +#define OQS_DEC_PRINTF2(a, b) \ + if (getenv("OQSDEC")) \ + printf(a, b) +#define OQS_DEC_PRINTF3(a, b, c) \ + if (getenv("OQSDEC")) \ + printf(a, b, c) #endif // NDEBUG struct der2key_ctx_st; /* Forward declaration */ @@ -108,17 +108,16 @@ struct X509_pubkey_st { unsigned int flag_force_legacy : 1; }; -ASN1_SEQUENCE(X509_PUBKEY_INTERNAL) - = {ASN1_SIMPLE(X509_PUBKEY, algor, X509_ALGOR), - ASN1_SIMPLE( - X509_PUBKEY, public_key, - ASN1_BIT_STRING)} static_ASN1_SEQUENCE_END_name(X509_PUBKEY, - X509_PUBKEY_INTERNAL) - - X509_PUBKEY - * oqsx_d2i_X509_PUBKEY_INTERNAL(const unsigned char **pp, long len, - OSSL_LIB_CTX *libctx) -{ +ASN1_SEQUENCE(X509_PUBKEY_INTERNAL) = + {ASN1_SIMPLE(X509_PUBKEY, algor, X509_ALGOR), + ASN1_SIMPLE( + X509_PUBKEY, public_key, + ASN1_BIT_STRING)} static_ASN1_SEQUENCE_END_name(X509_PUBKEY, + X509_PUBKEY_INTERNAL) + + X509_PUBKEY + * oqsx_d2i_X509_PUBKEY_INTERNAL(const unsigned char **pp, long len, + OSSL_LIB_CTX *libctx) { X509_PUBKEY *xpub = OPENSSL_zalloc(sizeof(*xpub)); if (xpub == NULL) @@ -142,8 +141,7 @@ struct der2key_ctx_st { }; int oqs_read_der(PROV_OQS_CTX *provctx, OSSL_CORE_BIO *cin, - unsigned char **data, long *len) -{ + unsigned char **data, long *len) { OQS_DEC_PRINTF("OQS DEC provider: oqs_read_der called.\n"); BUF_MEM *mem = NULL; @@ -164,8 +162,7 @@ typedef void *key_from_pkcs8_t(const PKCS8_PRIV_KEY_INFO *p8inf, static void *oqs_der2key_decode_p8(const unsigned char **input_der, long input_der_len, struct der2key_ctx_st *ctx, - key_from_pkcs8_t *key_from_pkcs8) -{ + key_from_pkcs8_t *key_from_pkcs8) { PKCS8_PRIV_KEY_INFO *p8inf = NULL; const X509_ALGOR *alg = NULL; void *key = NULL; @@ -174,18 +171,17 @@ static void *oqs_der2key_decode_p8(const unsigned char **input_der, "OQS DEC provider: oqs_der2key_decode_p8 called. Keytype: %d.\n", ctx->desc->evp_type); - if ((p8inf = d2i_PKCS8_PRIV_KEY_INFO(NULL, input_der, input_der_len)) - != NULL - && PKCS8_pkey_get0(NULL, NULL, NULL, &alg, p8inf) - && OBJ_obj2nid(alg->algorithm) == ctx->desc->evp_type) + if ((p8inf = d2i_PKCS8_PRIV_KEY_INFO(NULL, input_der, input_der_len)) != + NULL && + PKCS8_pkey_get0(NULL, NULL, NULL, &alg, p8inf) && + OBJ_obj2nid(alg->algorithm) == ctx->desc->evp_type) key = key_from_pkcs8(p8inf, PROV_OQS_LIBCTX_OF(ctx->provctx), NULL); PKCS8_PRIV_KEY_INFO_free(p8inf); return key; } -OQSX_KEY *oqsx_d2i_PUBKEY(OQSX_KEY **a, const unsigned char **pp, long length) -{ +OQSX_KEY *oqsx_d2i_PUBKEY(OQSX_KEY **a, const unsigned char **pp, long length) { OQSX_KEY *key = NULL; // taken from internal code for d2i_PUBKEY_int: X509_PUBKEY *xpk; @@ -217,13 +213,12 @@ static OSSL_FUNC_decoder_export_object_fn der2key_export_object; static struct der2key_ctx_st *der2key_newctx(void *provctx, struct keytype_desc_st *desc, - const char *tls_name) -{ + const char *tls_name) { struct der2key_ctx_st *ctx = OPENSSL_zalloc(sizeof(*ctx)); - OQS_DEC_PRINTF3( - "OQS DEC provider: der2key_newctx called with tls_name %s. Keytype: %d\n", - tls_name, desc->evp_type); + OQS_DEC_PRINTF3("OQS DEC provider: der2key_newctx called with tls_name %s. " + "Keytype: %d\n", + tls_name, desc->evp_type); if (ctx != NULL) { ctx->provctx = provctx; @@ -238,28 +233,26 @@ static struct der2key_ctx_st *der2key_newctx(void *provctx, return ctx; } -static void der2key_freectx(void *vctx) -{ +static void der2key_freectx(void *vctx) { struct der2key_ctx_st *ctx = vctx; OPENSSL_free(ctx); } static int der2key_check_selection(int selection, - const struct keytype_desc_st *desc) -{ + const struct keytype_desc_st *desc) { /* * The selections are kinda sorta "levels", i.e. each selection given * here is assumed to include those following. */ - int checks[] - = {OSSL_KEYMGMT_SELECT_PRIVATE_KEY, OSSL_KEYMGMT_SELECT_PUBLIC_KEY, - OSSL_KEYMGMT_SELECT_ALL_PARAMETERS}; + int checks[] = {OSSL_KEYMGMT_SELECT_PRIVATE_KEY, + OSSL_KEYMGMT_SELECT_PUBLIC_KEY, + OSSL_KEYMGMT_SELECT_ALL_PARAMETERS}; size_t i; - OQS_DEC_PRINTF3( - "OQS DEC provider: der2key_check_selection called with selection %d (%d).\n", - selection, desc->selection_mask); + OQS_DEC_PRINTF3("OQS DEC provider: der2key_check_selection called with " + "selection %d (%d).\n", + selection, desc->selection_mask); /* The decoder implementations made here support guessing */ if (selection == 0) @@ -287,8 +280,7 @@ static int der2key_check_selection(int selection, static int oqs_der2key_decode(void *vctx, OSSL_CORE_BIO *cin, int selection, OSSL_CALLBACK *data_cb, void *data_cbarg, - OSSL_PASSPHRASE_CALLBACK *pw_cb, void *pw_cbarg) -{ + OSSL_PASSPHRASE_CALLBACK *pw_cb, void *pw_cbarg) { struct der2key_ctx_st *ctx = vctx; unsigned char *der = NULL; const unsigned char *derp; @@ -356,8 +348,8 @@ static int oqs_der2key_decode(void *vctx, OSSL_CORE_BIO *cin, int selection, * classes of key types that have subtle variants, like RSA-PSS keys as * opposed to plain RSA keys. */ - if (key != NULL && ctx->desc->check_key != NULL - && !ctx->desc->check_key(key, ctx)) { + if (key != NULL && ctx->desc->check_key != NULL && + !ctx->desc->check_key(key, ctx)) { ctx->desc->free_key(key); key = NULL; } @@ -384,8 +376,8 @@ static int oqs_der2key_decode(void *vctx, OSSL_CORE_BIO *cin, int selection, OSSL_PARAM params[4]; int object_type = OSSL_OBJECT_PKEY; - params[0] - = OSSL_PARAM_construct_int(OSSL_OBJECT_PARAM_TYPE, &object_type); + params[0] = + OSSL_PARAM_construct_int(OSSL_OBJECT_PARAM_TYPE, &object_type); params[1] = OSSL_PARAM_construct_utf8_string( OSSL_OBJECT_PARAM_DATA_TYPE, (char *)ctx->desc->keytype_name, 0); /* The address of the key becomes the octet string */ @@ -405,11 +397,10 @@ static int oqs_der2key_decode(void *vctx, OSSL_CORE_BIO *cin, int selection, static int der2key_export_object(void *vctx, const void *reference, size_t reference_sz, OSSL_CALLBACK *export_cb, - void *export_cbarg) -{ + void *export_cbarg) { struct der2key_ctx_st *ctx = vctx; - OSSL_FUNC_keymgmt_export_fn *export - = oqs_prov_get_keymgmt_export(ctx->desc->fns); + OSSL_FUNC_keymgmt_export_fn *export = + oqs_prov_get_keymgmt_export(ctx->desc->fns); void *keydata; OQS_DEC_PRINTF("OQS DEC provider: der2key_export_object called.\n"); @@ -426,16 +417,14 @@ static int der2key_export_object(void *vctx, const void *reference, /* ---------------------------------------------------------------------- */ static void *oqsx_d2i_PKCS8(void **key, const unsigned char **der, long der_len, - struct der2key_ctx_st *ctx) -{ + struct der2key_ctx_st *ctx) { OQS_DEC_PRINTF("OQS DEC provider: oqsx_d2i_PKCS8 called.\n"); return oqs_der2key_decode_p8(der, der_len, ctx, (key_from_pkcs8_t *)oqsx_key_from_pkcs8); } -static void oqsx_key_adjust(void *key, struct der2key_ctx_st *ctx) -{ +static void oqsx_key_adjust(void *key, struct der2key_ctx_st *ctx) { OQS_DEC_PRINTF("OQS DEC provider: oqsx_key_adjust called.\n"); oqsx_key_set0_libctx(key, PROV_OQS_LIBCTX_OF(ctx->provctx)); @@ -454,37 +443,37 @@ static void oqsx_key_adjust(void *key, struct der2key_ctx_st *ctx) "type-specific", 0, (OSSL_KEYMGMT_SELECT_KEYPAIR), NULL, NULL, NULL, NULL, \ NULL, NULL, oqsx_key_adjust, (free_key_fn *)oqsx_key_free -#define DO_type_specific_pub(keytype) \ - "type-specific", 0, (OSSL_KEYMGMT_SELECT_PUBLIC_KEY), NULL, NULL, NULL, \ +#define DO_type_specific_pub(keytype) \ + "type-specific", 0, (OSSL_KEYMGMT_SELECT_PUBLIC_KEY), NULL, NULL, NULL, \ NULL, NULL, NULL, oqsx_key_adjust, (free_key_fn *)oqsx_key_free -#define DO_type_specific_priv(keytype) \ - "type-specific", 0, (OSSL_KEYMGMT_SELECT_PRIVATE_KEY), NULL, NULL, NULL, \ +#define DO_type_specific_priv(keytype) \ + "type-specific", 0, (OSSL_KEYMGMT_SELECT_PRIVATE_KEY), NULL, NULL, NULL, \ NULL, NULL, NULL, oqsx_key_adjust, (free_key_fn *)oqsx_key_free -#define DO_type_specific_params(keytype) \ - "type-specific", 0, (OSSL_KEYMGMT_SELECT_ALL_PARAMETERS), NULL, NULL, \ +#define DO_type_specific_params(keytype) \ + "type-specific", 0, (OSSL_KEYMGMT_SELECT_ALL_PARAMETERS), NULL, NULL, \ NULL, NULL, NULL, NULL, oqsx_key_adjust, (free_key_fn *)oqsx_key_free -#define DO_type_specific(keytype) \ - "type-specific", 0, (OSSL_KEYMGMT_SELECT_ALL), NULL, NULL, NULL, NULL, \ +#define DO_type_specific(keytype) \ + "type-specific", 0, (OSSL_KEYMGMT_SELECT_ALL), NULL, NULL, NULL, NULL, \ NULL, NULL, oqsx_key_adjust, (free_key_fn *)oqsx_key_free -#define DO_type_specific_no_pub(keytype) \ - "type-specific", 0, \ - (OSSL_KEYMGMT_SELECT_PRIVATE_KEY \ - | OSSL_KEYMGMT_SELECT_ALL_PARAMETERS), \ - NULL, NULL, NULL, NULL, NULL, NULL, oqsx_key_adjust, \ +#define DO_type_specific_no_pub(keytype) \ + "type-specific", 0, \ + (OSSL_KEYMGMT_SELECT_PRIVATE_KEY | \ + OSSL_KEYMGMT_SELECT_ALL_PARAMETERS), \ + NULL, NULL, NULL, NULL, NULL, NULL, oqsx_key_adjust, \ (free_key_fn *)oqsx_key_free -#define DO_PrivateKeyInfo(keytype) \ - "PrivateKeyInfo", 0, (OSSL_KEYMGMT_SELECT_PRIVATE_KEY), NULL, NULL, NULL, \ - oqsx_d2i_PKCS8, NULL, NULL, oqsx_key_adjust, \ +#define DO_PrivateKeyInfo(keytype) \ + "PrivateKeyInfo", 0, (OSSL_KEYMGMT_SELECT_PRIVATE_KEY), NULL, NULL, NULL, \ + oqsx_d2i_PKCS8, NULL, NULL, oqsx_key_adjust, \ (free_key_fn *)oqsx_key_free -#define DO_SubjectPublicKeyInfo(keytype) \ - "SubjectPublicKeyInfo", 0, (OSSL_KEYMGMT_SELECT_PUBLIC_KEY), NULL, NULL, \ - NULL, NULL, (d2i_of_void *)oqsx_d2i_PUBKEY, NULL, oqsx_key_adjust, \ +#define DO_SubjectPublicKeyInfo(keytype) \ + "SubjectPublicKeyInfo", 0, (OSSL_KEYMGMT_SELECT_PUBLIC_KEY), NULL, NULL, \ + NULL, NULL, (d2i_of_void *)oqsx_d2i_PUBKEY, NULL, oqsx_key_adjust, \ (free_key_fn *)oqsx_key_free /* @@ -506,85 +495,100 @@ static void oqsx_key_adjust(void *key, struct der2key_ctx_st *ctx) * structure. */ // reverted const to be able to change NID/evp_type after assignment -#define MAKE_DECODER(oqskemhyb, keytype_name, keytype, type, kind) \ - static struct keytype_desc_st kind##_##keytype##_desc \ - = {keytype_name, oqs##oqskemhyb##_##keytype##_keymgmt_functions, \ - DO_##kind(keytype)}; \ - \ - static OSSL_FUNC_decoder_newctx_fn kind##_der2##keytype##_newctx; \ - \ - static void *kind##_der2##keytype##_newctx(void *provctx) \ - { \ - OQS_DEC_PRINTF("OQS DEC provider: _newctx called.\n"); \ - return der2key_newctx(provctx, &kind##_##keytype##_desc, \ - keytype_name); \ - } \ - static int kind##_der2##keytype##_does_selection(void *provctx, \ - int selection) \ - { \ - OQS_DEC_PRINTF("OQS DEC provider: _does_selection called.\n"); \ - return der2key_check_selection(selection, &kind##_##keytype##_desc); \ - } \ - const OSSL_DISPATCH oqs_##kind##_der_to_##keytype##_decoder_functions[] \ - = {{OSSL_FUNC_DECODER_NEWCTX, \ - (void (*)(void))kind##_der2##keytype##_newctx}, \ - {OSSL_FUNC_DECODER_FREECTX, (void (*)(void))der2key_freectx}, \ - {OSSL_FUNC_DECODER_DOES_SELECTION, \ - (void (*)(void))kind##_der2##keytype##_does_selection}, \ - {OSSL_FUNC_DECODER_DECODE, (void (*)(void))oqs_der2key_decode}, \ - {OSSL_FUNC_DECODER_EXPORT_OBJECT, \ - (void (*)(void))der2key_export_object}, \ - {0, NULL}} +#define MAKE_DECODER(oqskemhyb, keytype_name, keytype, type, kind) \ + static struct keytype_desc_st kind##_##keytype##_desc = { \ + keytype_name, oqs##oqskemhyb##_##keytype##_keymgmt_functions, \ + DO_##kind(keytype)}; \ + \ + static OSSL_FUNC_decoder_newctx_fn kind##_der2##keytype##_newctx; \ + \ + static void *kind##_der2##keytype##_newctx(void *provctx) { \ + OQS_DEC_PRINTF("OQS DEC provider: _newctx called.\n"); \ + return der2key_newctx(provctx, &kind##_##keytype##_desc, \ + keytype_name); \ + } \ + static int kind##_der2##keytype##_does_selection(void *provctx, \ + int selection) { \ + OQS_DEC_PRINTF("OQS DEC provider: _does_selection called.\n"); \ + return der2key_check_selection(selection, &kind##_##keytype##_desc); \ + } \ + const OSSL_DISPATCH oqs_##kind##_der_to_##keytype##_decoder_functions[] = \ + {{OSSL_FUNC_DECODER_NEWCTX, \ + (void (*)(void))kind##_der2##keytype##_newctx}, \ + {OSSL_FUNC_DECODER_FREECTX, (void (*)(void))der2key_freectx}, \ + {OSSL_FUNC_DECODER_DOES_SELECTION, \ + (void (*)(void))kind##_der2##keytype##_does_selection}, \ + {OSSL_FUNC_DECODER_DECODE, (void (*)(void))oqs_der2key_decode}, \ + {OSSL_FUNC_DECODER_EXPORT_OBJECT, \ + (void (*)(void))der2key_export_object}, \ + {0, NULL}} ///// OQS_TEMPLATE_FRAGMENT_DECODER_MAKE_START #ifdef OQS_KEM_ENCODERS - MAKE_DECODER(, "frodo640aes", frodo640aes, oqsx, PrivateKeyInfo); MAKE_DECODER(, "frodo640aes", frodo640aes, oqsx, SubjectPublicKeyInfo); MAKE_DECODER(_ecp, "p256_frodo640aes", p256_frodo640aes, oqsx, PrivateKeyInfo); -MAKE_DECODER(_ecp, "p256_frodo640aes", p256_frodo640aes, oqsx, SubjectPublicKeyInfo); -MAKE_DECODER(_ecx, "x25519_frodo640aes", x25519_frodo640aes, oqsx, PrivateKeyInfo); -MAKE_DECODER(_ecx, "x25519_frodo640aes", x25519_frodo640aes, oqsx, SubjectPublicKeyInfo); +MAKE_DECODER(_ecp, "p256_frodo640aes", p256_frodo640aes, oqsx, + SubjectPublicKeyInfo); +MAKE_DECODER(_ecx, "x25519_frodo640aes", x25519_frodo640aes, oqsx, + PrivateKeyInfo); +MAKE_DECODER(_ecx, "x25519_frodo640aes", x25519_frodo640aes, oqsx, + SubjectPublicKeyInfo); MAKE_DECODER(, "frodo640shake", frodo640shake, oqsx, PrivateKeyInfo); MAKE_DECODER(, "frodo640shake", frodo640shake, oqsx, SubjectPublicKeyInfo); -MAKE_DECODER(_ecp, "p256_frodo640shake", p256_frodo640shake, oqsx, PrivateKeyInfo); -MAKE_DECODER(_ecp, "p256_frodo640shake", p256_frodo640shake, oqsx, SubjectPublicKeyInfo); -MAKE_DECODER(_ecx, "x25519_frodo640shake", x25519_frodo640shake, oqsx, PrivateKeyInfo); -MAKE_DECODER(_ecx, "x25519_frodo640shake", x25519_frodo640shake, oqsx, SubjectPublicKeyInfo); +MAKE_DECODER(_ecp, "p256_frodo640shake", p256_frodo640shake, oqsx, + PrivateKeyInfo); +MAKE_DECODER(_ecp, "p256_frodo640shake", p256_frodo640shake, oqsx, + SubjectPublicKeyInfo); +MAKE_DECODER(_ecx, "x25519_frodo640shake", x25519_frodo640shake, oqsx, + PrivateKeyInfo); +MAKE_DECODER(_ecx, "x25519_frodo640shake", x25519_frodo640shake, oqsx, + SubjectPublicKeyInfo); MAKE_DECODER(, "frodo976aes", frodo976aes, oqsx, PrivateKeyInfo); MAKE_DECODER(, "frodo976aes", frodo976aes, oqsx, SubjectPublicKeyInfo); MAKE_DECODER(_ecp, "p384_frodo976aes", p384_frodo976aes, oqsx, PrivateKeyInfo); -MAKE_DECODER(_ecp, "p384_frodo976aes", p384_frodo976aes, oqsx, SubjectPublicKeyInfo); +MAKE_DECODER(_ecp, "p384_frodo976aes", p384_frodo976aes, oqsx, + SubjectPublicKeyInfo); MAKE_DECODER(_ecx, "x448_frodo976aes", x448_frodo976aes, oqsx, PrivateKeyInfo); -MAKE_DECODER(_ecx, "x448_frodo976aes", x448_frodo976aes, oqsx, SubjectPublicKeyInfo); +MAKE_DECODER(_ecx, "x448_frodo976aes", x448_frodo976aes, oqsx, + SubjectPublicKeyInfo); MAKE_DECODER(, "frodo976shake", frodo976shake, oqsx, PrivateKeyInfo); MAKE_DECODER(, "frodo976shake", frodo976shake, oqsx, SubjectPublicKeyInfo); -MAKE_DECODER(_ecp, "p384_frodo976shake", p384_frodo976shake, oqsx, PrivateKeyInfo); -MAKE_DECODER(_ecp, "p384_frodo976shake", p384_frodo976shake, oqsx, SubjectPublicKeyInfo); -MAKE_DECODER(_ecx, "x448_frodo976shake", x448_frodo976shake, oqsx, PrivateKeyInfo); -MAKE_DECODER(_ecx, "x448_frodo976shake", x448_frodo976shake, oqsx, SubjectPublicKeyInfo); +MAKE_DECODER(_ecp, "p384_frodo976shake", p384_frodo976shake, oqsx, + PrivateKeyInfo); +MAKE_DECODER(_ecp, "p384_frodo976shake", p384_frodo976shake, oqsx, + SubjectPublicKeyInfo); +MAKE_DECODER(_ecx, "x448_frodo976shake", x448_frodo976shake, oqsx, + PrivateKeyInfo); +MAKE_DECODER(_ecx, "x448_frodo976shake", x448_frodo976shake, oqsx, + SubjectPublicKeyInfo); MAKE_DECODER(, "frodo1344aes", frodo1344aes, oqsx, PrivateKeyInfo); MAKE_DECODER(, "frodo1344aes", frodo1344aes, oqsx, SubjectPublicKeyInfo); -MAKE_DECODER(_ecp, "p521_frodo1344aes", p521_frodo1344aes, oqsx, PrivateKeyInfo); -MAKE_DECODER(_ecp, "p521_frodo1344aes", p521_frodo1344aes, oqsx, SubjectPublicKeyInfo); +MAKE_DECODER(_ecp, "p521_frodo1344aes", p521_frodo1344aes, oqsx, + PrivateKeyInfo); +MAKE_DECODER(_ecp, "p521_frodo1344aes", p521_frodo1344aes, oqsx, + SubjectPublicKeyInfo); MAKE_DECODER(, "frodo1344shake", frodo1344shake, oqsx, PrivateKeyInfo); MAKE_DECODER(, "frodo1344shake", frodo1344shake, oqsx, SubjectPublicKeyInfo); -MAKE_DECODER(_ecp, "p521_frodo1344shake", p521_frodo1344shake, oqsx, PrivateKeyInfo); -MAKE_DECODER(_ecp, "p521_frodo1344shake", p521_frodo1344shake, oqsx, SubjectPublicKeyInfo); +MAKE_DECODER(_ecp, "p521_frodo1344shake", p521_frodo1344shake, oqsx, + PrivateKeyInfo); +MAKE_DECODER(_ecp, "p521_frodo1344shake", p521_frodo1344shake, oqsx, + SubjectPublicKeyInfo); MAKE_DECODER(, "kyber512", kyber512, oqsx, PrivateKeyInfo); MAKE_DECODER(, "kyber512", kyber512, oqsx, SubjectPublicKeyInfo); MAKE_DECODER(_ecp, "p256_kyber512", p256_kyber512, oqsx, PrivateKeyInfo); MAKE_DECODER(_ecp, "p256_kyber512", p256_kyber512, oqsx, SubjectPublicKeyInfo); MAKE_DECODER(_ecx, "x25519_kyber512", x25519_kyber512, oqsx, PrivateKeyInfo); -MAKE_DECODER(_ecx, "x25519_kyber512", x25519_kyber512, oqsx, SubjectPublicKeyInfo); +MAKE_DECODER(_ecx, "x25519_kyber512", x25519_kyber512, oqsx, + SubjectPublicKeyInfo); MAKE_DECODER(, "kyber768", kyber768, oqsx, PrivateKeyInfo); MAKE_DECODER(, "kyber768", kyber768, oqsx, SubjectPublicKeyInfo); @@ -593,21 +597,24 @@ MAKE_DECODER(_ecp, "p384_kyber768", p384_kyber768, oqsx, SubjectPublicKeyInfo); MAKE_DECODER(_ecx, "x448_kyber768", x448_kyber768, oqsx, PrivateKeyInfo); MAKE_DECODER(_ecx, "x448_kyber768", x448_kyber768, oqsx, SubjectPublicKeyInfo); MAKE_DECODER(_ecx, "x25519_kyber768", x25519_kyber768, oqsx, PrivateKeyInfo); -MAKE_DECODER(_ecx, "x25519_kyber768", x25519_kyber768, oqsx, SubjectPublicKeyInfo); +MAKE_DECODER(_ecx, "x25519_kyber768", x25519_kyber768, oqsx, + SubjectPublicKeyInfo); MAKE_DECODER(_ecp, "p256_kyber768", p256_kyber768, oqsx, PrivateKeyInfo); MAKE_DECODER(_ecp, "p256_kyber768", p256_kyber768, oqsx, SubjectPublicKeyInfo); MAKE_DECODER(, "kyber1024", kyber1024, oqsx, PrivateKeyInfo); MAKE_DECODER(, "kyber1024", kyber1024, oqsx, SubjectPublicKeyInfo); MAKE_DECODER(_ecp, "p521_kyber1024", p521_kyber1024, oqsx, PrivateKeyInfo); -MAKE_DECODER(_ecp, "p521_kyber1024", p521_kyber1024, oqsx, SubjectPublicKeyInfo); +MAKE_DECODER(_ecp, "p521_kyber1024", p521_kyber1024, oqsx, + SubjectPublicKeyInfo); MAKE_DECODER(, "mlkem512", mlkem512, oqsx, PrivateKeyInfo); MAKE_DECODER(, "mlkem512", mlkem512, oqsx, SubjectPublicKeyInfo); MAKE_DECODER(_ecp, "p256_mlkem512", p256_mlkem512, oqsx, PrivateKeyInfo); MAKE_DECODER(_ecp, "p256_mlkem512", p256_mlkem512, oqsx, SubjectPublicKeyInfo); MAKE_DECODER(_ecx, "x25519_mlkem512", x25519_mlkem512, oqsx, PrivateKeyInfo); -MAKE_DECODER(_ecx, "x25519_mlkem512", x25519_mlkem512, oqsx, SubjectPublicKeyInfo); +MAKE_DECODER(_ecx, "x25519_mlkem512", x25519_mlkem512, oqsx, + SubjectPublicKeyInfo); MAKE_DECODER(, "mlkem768", mlkem768, oqsx, PrivateKeyInfo); MAKE_DECODER(, "mlkem768", mlkem768, oqsx, SubjectPublicKeyInfo); @@ -616,16 +623,19 @@ MAKE_DECODER(_ecp, "p384_mlkem768", p384_mlkem768, oqsx, SubjectPublicKeyInfo); MAKE_DECODER(_ecx, "x448_mlkem768", x448_mlkem768, oqsx, PrivateKeyInfo); MAKE_DECODER(_ecx, "x448_mlkem768", x448_mlkem768, oqsx, SubjectPublicKeyInfo); MAKE_DECODER(_ecx, "x25519_mlkem768", x25519_mlkem768, oqsx, PrivateKeyInfo); -MAKE_DECODER(_ecx, "x25519_mlkem768", x25519_mlkem768, oqsx, SubjectPublicKeyInfo); +MAKE_DECODER(_ecx, "x25519_mlkem768", x25519_mlkem768, oqsx, + SubjectPublicKeyInfo); MAKE_DECODER(_ecp, "p256_mlkem768", p256_mlkem768, oqsx, PrivateKeyInfo); MAKE_DECODER(_ecp, "p256_mlkem768", p256_mlkem768, oqsx, SubjectPublicKeyInfo); MAKE_DECODER(, "mlkem1024", mlkem1024, oqsx, PrivateKeyInfo); MAKE_DECODER(, "mlkem1024", mlkem1024, oqsx, SubjectPublicKeyInfo); MAKE_DECODER(_ecp, "p521_mlkem1024", p521_mlkem1024, oqsx, PrivateKeyInfo); -MAKE_DECODER(_ecp, "p521_mlkem1024", p521_mlkem1024, oqsx, SubjectPublicKeyInfo); +MAKE_DECODER(_ecp, "p521_mlkem1024", p521_mlkem1024, oqsx, + SubjectPublicKeyInfo); MAKE_DECODER(_ecp, "p384_mlkem1024", p384_mlkem1024, oqsx, PrivateKeyInfo); -MAKE_DECODER(_ecp, "p384_mlkem1024", p384_mlkem1024, oqsx, SubjectPublicKeyInfo); +MAKE_DECODER(_ecp, "p384_mlkem1024", p384_mlkem1024, oqsx, + SubjectPublicKeyInfo); MAKE_DECODER(, "bikel1", bikel1, oqsx, PrivateKeyInfo); MAKE_DECODER(, "bikel1", bikel1, oqsx, SubjectPublicKeyInfo); @@ -666,13 +676,13 @@ MAKE_DECODER(_ecp, "p521_hqc256", p521_hqc256, oqsx, PrivateKeyInfo); MAKE_DECODER(_ecp, "p521_hqc256", p521_hqc256, oqsx, SubjectPublicKeyInfo); #endif /* OQS_KEM_ENCODERS */ - MAKE_DECODER(, "dilithium2", dilithium2, oqsx, PrivateKeyInfo); MAKE_DECODER(, "dilithium2", dilithium2, oqsx, SubjectPublicKeyInfo); MAKE_DECODER(, "p256_dilithium2", p256_dilithium2, oqsx, PrivateKeyInfo); MAKE_DECODER(, "p256_dilithium2", p256_dilithium2, oqsx, SubjectPublicKeyInfo); MAKE_DECODER(, "rsa3072_dilithium2", rsa3072_dilithium2, oqsx, PrivateKeyInfo); -MAKE_DECODER(, "rsa3072_dilithium2", rsa3072_dilithium2, oqsx, SubjectPublicKeyInfo); +MAKE_DECODER(, "rsa3072_dilithium2", rsa3072_dilithium2, oqsx, + SubjectPublicKeyInfo); MAKE_DECODER(, "dilithium3", dilithium3, oqsx, PrivateKeyInfo); MAKE_DECODER(, "dilithium3", dilithium3, oqsx, SubjectPublicKeyInfo); MAKE_DECODER(, "p384_dilithium3", p384_dilithium3, oqsx, PrivateKeyInfo); @@ -726,43 +736,73 @@ MAKE_DECODER(, "falcon512", falcon512, oqsx, SubjectPublicKeyInfo); MAKE_DECODER(, "p256_falcon512", p256_falcon512, oqsx, PrivateKeyInfo); MAKE_DECODER(, "p256_falcon512", p256_falcon512, oqsx, SubjectPublicKeyInfo); MAKE_DECODER(, "rsa3072_falcon512", rsa3072_falcon512, oqsx, PrivateKeyInfo); -MAKE_DECODER(, "rsa3072_falcon512", rsa3072_falcon512, oqsx, SubjectPublicKeyInfo); +MAKE_DECODER(, "rsa3072_falcon512", rsa3072_falcon512, oqsx, + SubjectPublicKeyInfo); MAKE_DECODER(, "falconpadded512", falconpadded512, oqsx, PrivateKeyInfo); MAKE_DECODER(, "falconpadded512", falconpadded512, oqsx, SubjectPublicKeyInfo); -MAKE_DECODER(, "p256_falconpadded512", p256_falconpadded512, oqsx, PrivateKeyInfo); -MAKE_DECODER(, "p256_falconpadded512", p256_falconpadded512, oqsx, SubjectPublicKeyInfo); -MAKE_DECODER(, "rsa3072_falconpadded512", rsa3072_falconpadded512, oqsx, PrivateKeyInfo); -MAKE_DECODER(, "rsa3072_falconpadded512", rsa3072_falconpadded512, oqsx, SubjectPublicKeyInfo); +MAKE_DECODER(, "p256_falconpadded512", p256_falconpadded512, oqsx, + PrivateKeyInfo); +MAKE_DECODER(, "p256_falconpadded512", p256_falconpadded512, oqsx, + SubjectPublicKeyInfo); +MAKE_DECODER(, "rsa3072_falconpadded512", rsa3072_falconpadded512, oqsx, + PrivateKeyInfo); +MAKE_DECODER(, "rsa3072_falconpadded512", rsa3072_falconpadded512, oqsx, + SubjectPublicKeyInfo); MAKE_DECODER(, "falcon1024", falcon1024, oqsx, PrivateKeyInfo); MAKE_DECODER(, "falcon1024", falcon1024, oqsx, SubjectPublicKeyInfo); MAKE_DECODER(, "p521_falcon1024", p521_falcon1024, oqsx, PrivateKeyInfo); MAKE_DECODER(, "p521_falcon1024", p521_falcon1024, oqsx, SubjectPublicKeyInfo); MAKE_DECODER(, "falconpadded1024", falconpadded1024, oqsx, PrivateKeyInfo); -MAKE_DECODER(, "falconpadded1024", falconpadded1024, oqsx, SubjectPublicKeyInfo); -MAKE_DECODER(, "p521_falconpadded1024", p521_falconpadded1024, oqsx, PrivateKeyInfo); -MAKE_DECODER(, "p521_falconpadded1024", p521_falconpadded1024, oqsx, SubjectPublicKeyInfo); -MAKE_DECODER(, "sphincssha2128fsimple", sphincssha2128fsimple, oqsx, PrivateKeyInfo); -MAKE_DECODER(, "sphincssha2128fsimple", sphincssha2128fsimple, oqsx, SubjectPublicKeyInfo); -MAKE_DECODER(, "p256_sphincssha2128fsimple", p256_sphincssha2128fsimple, oqsx, PrivateKeyInfo); -MAKE_DECODER(, "p256_sphincssha2128fsimple", p256_sphincssha2128fsimple, oqsx, SubjectPublicKeyInfo); -MAKE_DECODER(, "rsa3072_sphincssha2128fsimple", rsa3072_sphincssha2128fsimple, oqsx, PrivateKeyInfo); -MAKE_DECODER(, "rsa3072_sphincssha2128fsimple", rsa3072_sphincssha2128fsimple, oqsx, SubjectPublicKeyInfo); -MAKE_DECODER(, "sphincssha2128ssimple", sphincssha2128ssimple, oqsx, PrivateKeyInfo); -MAKE_DECODER(, "sphincssha2128ssimple", sphincssha2128ssimple, oqsx, SubjectPublicKeyInfo); -MAKE_DECODER(, "p256_sphincssha2128ssimple", p256_sphincssha2128ssimple, oqsx, PrivateKeyInfo); -MAKE_DECODER(, "p256_sphincssha2128ssimple", p256_sphincssha2128ssimple, oqsx, SubjectPublicKeyInfo); -MAKE_DECODER(, "rsa3072_sphincssha2128ssimple", rsa3072_sphincssha2128ssimple, oqsx, PrivateKeyInfo); -MAKE_DECODER(, "rsa3072_sphincssha2128ssimple", rsa3072_sphincssha2128ssimple, oqsx, SubjectPublicKeyInfo); -MAKE_DECODER(, "sphincssha2192fsimple", sphincssha2192fsimple, oqsx, PrivateKeyInfo); -MAKE_DECODER(, "sphincssha2192fsimple", sphincssha2192fsimple, oqsx, SubjectPublicKeyInfo); -MAKE_DECODER(, "p384_sphincssha2192fsimple", p384_sphincssha2192fsimple, oqsx, PrivateKeyInfo); -MAKE_DECODER(, "p384_sphincssha2192fsimple", p384_sphincssha2192fsimple, oqsx, SubjectPublicKeyInfo); -MAKE_DECODER(, "sphincsshake128fsimple", sphincsshake128fsimple, oqsx, PrivateKeyInfo); -MAKE_DECODER(, "sphincsshake128fsimple", sphincsshake128fsimple, oqsx, SubjectPublicKeyInfo); -MAKE_DECODER(, "p256_sphincsshake128fsimple", p256_sphincsshake128fsimple, oqsx, PrivateKeyInfo); -MAKE_DECODER(, "p256_sphincsshake128fsimple", p256_sphincsshake128fsimple, oqsx, SubjectPublicKeyInfo); -MAKE_DECODER(, "rsa3072_sphincsshake128fsimple", rsa3072_sphincsshake128fsimple, oqsx, PrivateKeyInfo); -MAKE_DECODER(, "rsa3072_sphincsshake128fsimple", rsa3072_sphincsshake128fsimple, oqsx, SubjectPublicKeyInfo); +MAKE_DECODER(, "falconpadded1024", falconpadded1024, oqsx, + SubjectPublicKeyInfo); +MAKE_DECODER(, "p521_falconpadded1024", p521_falconpadded1024, oqsx, + PrivateKeyInfo); +MAKE_DECODER(, "p521_falconpadded1024", p521_falconpadded1024, oqsx, + SubjectPublicKeyInfo); +MAKE_DECODER(, "sphincssha2128fsimple", sphincssha2128fsimple, oqsx, + PrivateKeyInfo); +MAKE_DECODER(, "sphincssha2128fsimple", sphincssha2128fsimple, oqsx, + SubjectPublicKeyInfo); +MAKE_DECODER(, "p256_sphincssha2128fsimple", p256_sphincssha2128fsimple, oqsx, + PrivateKeyInfo); +MAKE_DECODER(, "p256_sphincssha2128fsimple", p256_sphincssha2128fsimple, oqsx, + SubjectPublicKeyInfo); +MAKE_DECODER(, "rsa3072_sphincssha2128fsimple", rsa3072_sphincssha2128fsimple, + oqsx, PrivateKeyInfo); +MAKE_DECODER(, "rsa3072_sphincssha2128fsimple", rsa3072_sphincssha2128fsimple, + oqsx, SubjectPublicKeyInfo); +MAKE_DECODER(, "sphincssha2128ssimple", sphincssha2128ssimple, oqsx, + PrivateKeyInfo); +MAKE_DECODER(, "sphincssha2128ssimple", sphincssha2128ssimple, oqsx, + SubjectPublicKeyInfo); +MAKE_DECODER(, "p256_sphincssha2128ssimple", p256_sphincssha2128ssimple, oqsx, + PrivateKeyInfo); +MAKE_DECODER(, "p256_sphincssha2128ssimple", p256_sphincssha2128ssimple, oqsx, + SubjectPublicKeyInfo); +MAKE_DECODER(, "rsa3072_sphincssha2128ssimple", rsa3072_sphincssha2128ssimple, + oqsx, PrivateKeyInfo); +MAKE_DECODER(, "rsa3072_sphincssha2128ssimple", rsa3072_sphincssha2128ssimple, + oqsx, SubjectPublicKeyInfo); +MAKE_DECODER(, "sphincssha2192fsimple", sphincssha2192fsimple, oqsx, + PrivateKeyInfo); +MAKE_DECODER(, "sphincssha2192fsimple", sphincssha2192fsimple, oqsx, + SubjectPublicKeyInfo); +MAKE_DECODER(, "p384_sphincssha2192fsimple", p384_sphincssha2192fsimple, oqsx, + PrivateKeyInfo); +MAKE_DECODER(, "p384_sphincssha2192fsimple", p384_sphincssha2192fsimple, oqsx, + SubjectPublicKeyInfo); +MAKE_DECODER(, "sphincsshake128fsimple", sphincsshake128fsimple, oqsx, + PrivateKeyInfo); +MAKE_DECODER(, "sphincsshake128fsimple", sphincsshake128fsimple, oqsx, + SubjectPublicKeyInfo); +MAKE_DECODER(, "p256_sphincsshake128fsimple", p256_sphincsshake128fsimple, oqsx, + PrivateKeyInfo); +MAKE_DECODER(, "p256_sphincsshake128fsimple", p256_sphincsshake128fsimple, oqsx, + SubjectPublicKeyInfo); +MAKE_DECODER(, "rsa3072_sphincsshake128fsimple", rsa3072_sphincsshake128fsimple, + oqsx, PrivateKeyInfo); +MAKE_DECODER(, "rsa3072_sphincsshake128fsimple", rsa3072_sphincsshake128fsimple, + oqsx, SubjectPublicKeyInfo); MAKE_DECODER(, "mayo1", mayo1, oqsx, PrivateKeyInfo); MAKE_DECODER(, "mayo1", mayo1, oqsx, SubjectPublicKeyInfo); MAKE_DECODER(, "p256_mayo1", p256_mayo1, oqsx, PrivateKeyInfo); @@ -779,6 +819,8 @@ MAKE_DECODER(, "mayo5", mayo5, oqsx, PrivateKeyInfo); MAKE_DECODER(, "mayo5", mayo5, oqsx, SubjectPublicKeyInfo); MAKE_DECODER(, "p521_mayo5", p521_mayo5, oqsx, PrivateKeyInfo); MAKE_DECODER(, "p521_mayo5", p521_mayo5, oqsx, SubjectPublicKeyInfo); -MAKE_DECODER(, "CROSSrsdp128balanced", CROSSrsdp128balanced, oqsx, PrivateKeyInfo); -MAKE_DECODER(, "CROSSrsdp128balanced", CROSSrsdp128balanced, oqsx, SubjectPublicKeyInfo); +MAKE_DECODER(, "CROSSrsdp128balanced", CROSSrsdp128balanced, oqsx, + PrivateKeyInfo); +MAKE_DECODER(, "CROSSrsdp128balanced", CROSSrsdp128balanced, oqsx, + SubjectPublicKeyInfo); ///// OQS_TEMPLATE_FRAGMENT_DECODER_MAKE_END diff --git a/oqsprov/oqs_encode_key2any.c b/oqsprov/oqs_encode_key2any.c index 5499be6e..9c69a4b9 100644 --- a/oqsprov/oqs_encode_key2any.c +++ b/oqsprov/oqs_encode_key2any.c @@ -27,19 +27,19 @@ #include #ifdef NDEBUG -# define OQS_ENC_PRINTF(a) -# define OQS_ENC_PRINTF2(a, b) -# define OQS_ENC_PRINTF3(a, b, c) +#define OQS_ENC_PRINTF(a) +#define OQS_ENC_PRINTF2(a, b) +#define OQS_ENC_PRINTF3(a, b, c) #else -# define OQS_ENC_PRINTF(a) \ - if (getenv("OQSENC")) \ - printf(a) -# define OQS_ENC_PRINTF2(a, b) \ - if (getenv("OQSENC")) \ - printf(a, b) -# define OQS_ENC_PRINTF3(a, b, c) \ - if (getenv("OQSENC")) \ - printf(a, b, c) +#define OQS_ENC_PRINTF(a) \ + if (getenv("OQSENC")) \ + printf(a) +#define OQS_ENC_PRINTF2(a, b) \ + if (getenv("OQSENC")) \ + printf(a, b) +#define OQS_ENC_PRINTF3(a, b, c) \ + if (getenv("OQSENC")) \ + printf(a, b, c) #endif // NDEBUG struct key2any_ctx_st { @@ -66,8 +66,7 @@ typedef int key_to_der_fn(BIO *out, const void *key, int key_nid, typedef int write_bio_of_void_fn(BIO *bp, const void *x); /* Free the blob allocated during key_to_paramstring_fn */ -static void free_asn1_data(int type, void *data) -{ +static void free_asn1_data(int type, void *data) { switch (type) { case V_ASN1_OBJECT: ASN1_OBJECT_free(data); @@ -80,8 +79,7 @@ static void free_asn1_data(int type, void *data) static PKCS8_PRIV_KEY_INFO *key_to_p8info(const void *key, int key_nid, void *params, int params_type, - i2d_of_void *k2d) -{ + i2d_of_void *k2d) { /* der, derlen store the key DER output and its length */ unsigned char *der = NULL; int derlen; @@ -90,13 +88,13 @@ static PKCS8_PRIV_KEY_INFO *key_to_p8info(const void *key, int key_nid, OQS_ENC_PRINTF("OQS ENC provider: key_to_p8info called\n"); - if ((p8info = PKCS8_PRIV_KEY_INFO_new()) == NULL - || (derlen = k2d(key, &der)) <= 0 - || !PKCS8_pkey_set0(p8info, OBJ_nid2obj(key_nid), 0, - // doesn't work with oqs-openssl: - // params_type, params, - // does work/interop: - V_ASN1_UNDEF, NULL, der, derlen)) { + if ((p8info = PKCS8_PRIV_KEY_INFO_new()) == NULL || + (derlen = k2d(key, &der)) <= 0 || + !PKCS8_pkey_set0(p8info, OBJ_nid2obj(key_nid), 0, + // doesn't work with oqs-openssl: + // params_type, params, + // does work/interop: + V_ASN1_UNDEF, NULL, der, derlen)) { ERR_raise(ERR_LIB_USER, ERR_R_MALLOC_FAILURE); PKCS8_PRIV_KEY_INFO_free(p8info); OPENSSL_free(der); @@ -107,8 +105,7 @@ static PKCS8_PRIV_KEY_INFO *key_to_p8info(const void *key, int key_nid, } static X509_SIG *p8info_to_encp8(PKCS8_PRIV_KEY_INFO *p8info, - struct key2any_ctx_st *ctx) -{ + struct key2any_ctx_st *ctx) { X509_SIG *p8 = NULL; char kstr[PEM_BUFSIZE]; size_t klen = 0; @@ -132,10 +129,9 @@ static X509_SIG *p8info_to_encp8(PKCS8_PRIV_KEY_INFO *p8info, static X509_SIG *key_to_encp8(const void *key, int key_nid, void *params, int params_type, i2d_of_void *k2d, - struct key2any_ctx_st *ctx) -{ - PKCS8_PRIV_KEY_INFO *p8info - = key_to_p8info(key, key_nid, params, params_type, k2d); + struct key2any_ctx_st *ctx) { + PKCS8_PRIV_KEY_INFO *p8info = + key_to_p8info(key, key_nid, params, params_type, k2d); X509_SIG *p8 = NULL; OQS_ENC_PRINTF("OQS ENC provider: key_to_encp8 called\n"); @@ -151,8 +147,7 @@ static X509_SIG *key_to_encp8(const void *key, int key_nid, void *params, static X509_PUBKEY *oqsx_key_to_pubkey(const void *key, int key_nid, void *params, int params_type, - i2d_of_void k2d) -{ + i2d_of_void k2d) { /* der, derlen store the key DER output and its length */ unsigned char *der = NULL; int derlen; @@ -162,8 +157,8 @@ static X509_PUBKEY *oqsx_key_to_pubkey(const void *key, int key_nid, OQS_ENC_PRINTF2("OQS ENC provider: oqsx_key_to_pubkey called for NID %d\n", key_nid); - if ((xpk = X509_PUBKEY_new()) == NULL || (derlen = k2d(key, &der)) <= 0 - || !X509_PUBKEY_set0_param( + if ((xpk = X509_PUBKEY_new()) == NULL || (derlen = k2d(key, &der)) <= 0 || + !X509_PUBKEY_set0_param( xpk, OBJ_nid2obj(key_nid), V_ASN1_UNDEF, NULL, // as per logic in oqs_meth.c in oqs-openssl der, derlen)) { @@ -199,8 +194,7 @@ static int key_to_epki_der_priv_bio(BIO *out, const void *key, int key_nid, ossl_unused const char *pemname, key_to_paramstring_fn *p2s, i2d_of_void *k2d, - struct key2any_ctx_st *ctx) -{ + struct key2any_ctx_st *ctx) { int ret = 0; void *str = NULL; int strtype = V_ASN1_UNDEF; @@ -227,8 +221,7 @@ static int key_to_epki_pem_priv_bio(BIO *out, const void *key, int key_nid, ossl_unused const char *pemname, key_to_paramstring_fn *p2s, i2d_of_void *k2d, - struct key2any_ctx_st *ctx) -{ + struct key2any_ctx_st *ctx) { int ret = 0; void *str = NULL; int strtype = V_ASN1_UNDEF; @@ -254,8 +247,7 @@ static int key_to_epki_pem_priv_bio(BIO *out, const void *key, int key_nid, static int key_to_pki_der_priv_bio(BIO *out, const void *key, int key_nid, ossl_unused const char *pemname, key_to_paramstring_fn *p2s, i2d_of_void *k2d, - struct key2any_ctx_st *ctx) -{ + struct key2any_ctx_st *ctx) { int ret = 0; void *str = NULL; int strtype = V_ASN1_UNDEF; @@ -285,8 +277,7 @@ static int key_to_pki_der_priv_bio(BIO *out, const void *key, int key_nid, static int key_to_pki_pem_priv_bio(BIO *out, const void *key, int key_nid, ossl_unused const char *pemname, key_to_paramstring_fn *p2s, i2d_of_void *k2d, - struct key2any_ctx_st *ctx) -{ + struct key2any_ctx_st *ctx) { int ret = 0, cmp_len = 0; void *str = NULL; int strtype = V_ASN1_UNDEF; @@ -315,8 +306,7 @@ static int key_to_pki_pem_priv_bio(BIO *out, const void *key, int key_nid, static int key_to_spki_der_pub_bio(BIO *out, const void *key, int key_nid, ossl_unused const char *pemname, key_to_paramstring_fn *p2s, i2d_of_void *k2d, - struct key2any_ctx_st *ctx) -{ + struct key2any_ctx_st *ctx) { int ret = 0; OQSX_KEY *okey = (OQSX_KEY *)key; X509_PUBKEY *xpk = NULL; @@ -340,8 +330,7 @@ static int key_to_spki_der_pub_bio(BIO *out, const void *key, int key_nid, static int key_to_spki_pem_pub_bio(BIO *out, const void *key, int key_nid, ossl_unused const char *pemname, key_to_paramstring_fn *p2s, i2d_of_void *k2d, - struct key2any_ctx_st *ctx) -{ + struct key2any_ctx_st *ctx) { int ret = 0; X509_PUBKEY *xpk = NULL; void *str = NULL; @@ -462,14 +451,13 @@ called\n"); /* ---------------------------------------------------------------------- */ static int prepare_oqsx_params(const void *oqsxkey, int nid, int save, - void **pstr, int *pstrtype) -{ + void **pstr, int *pstrtype) { ASN1_OBJECT *params = NULL; OQSX_KEY *k = (OQSX_KEY *)oqsxkey; - OQS_ENC_PRINTF3( - "OQS ENC provider: prepare_oqsx_params called with nid %d (tlsname: %s)\n", - nid, k->tls_name); + OQS_ENC_PRINTF3("OQS ENC provider: prepare_oqsx_params called with nid %d " + "(tlsname: %s)\n", + nid, k->tls_name); if (k->tls_name && OBJ_sn2nid(k->tls_name) != nid) { ERR_raise(ERR_LIB_USER, OQSPROV_R_INVALID_KEY); @@ -496,8 +484,7 @@ static int prepare_oqsx_params(const void *oqsxkey, int nid, int save, return 1; } -static int oqsx_spki_pub_to_der(const void *vxkey, unsigned char **pder) -{ +static int oqsx_spki_pub_to_der(const void *vxkey, unsigned char **pder) { const OQSX_KEY *oqsxkey = vxkey; unsigned char *keyblob, *buf; int keybloblen, nid, buflen = 0; @@ -513,8 +500,8 @@ static int oqsx_spki_pub_to_der(const void *vxkey, unsigned char **pder) } if (oqsxkey->keytype != KEY_TYPE_CMP_SIG) { #ifdef USE_ENCODING_LIB - if (oqsxkey->oqsx_encoding_ctx.encoding_ctx != NULL - && oqsxkey->oqsx_encoding_ctx.encoding_impl != NULL) { + if (oqsxkey->oqsx_encoding_ctx.encoding_ctx != NULL && + oqsxkey->oqsx_encoding_ctx.encoding_impl != NULL) { unsigned char *buf; int buflen; int ret = 0; @@ -549,12 +536,12 @@ static int oqsx_spki_pub_to_der(const void *vxkey, unsigned char **pder) } else { if ((sk = sk_ASN1_TYPE_new_null()) == NULL) return -1; - ASN1_TYPE **aType - = OPENSSL_malloc(oqsxkey->numkeys * sizeof(ASN1_TYPE *)); - ASN1_BIT_STRING **aString - = OPENSSL_malloc(oqsxkey->numkeys * sizeof(ASN1_BIT_STRING *)); - unsigned char **temp - = OPENSSL_malloc(oqsxkey->numkeys * sizeof(unsigned char *)); + ASN1_TYPE **aType = + OPENSSL_malloc(oqsxkey->numkeys * sizeof(ASN1_TYPE *)); + ASN1_BIT_STRING **aString = + OPENSSL_malloc(oqsxkey->numkeys * sizeof(ASN1_BIT_STRING *)); + unsigned char **temp = + OPENSSL_malloc(oqsxkey->numkeys * sizeof(unsigned char *)); size_t *templen = OPENSSL_malloc(oqsxkey->numkeys * sizeof(size_t)); int i; @@ -613,8 +600,7 @@ static int oqsx_spki_pub_to_der(const void *vxkey, unsigned char **pder) } } -static int oqsx_pki_priv_to_der(const void *vxkey, unsigned char **pder) -{ +static int oqsx_pki_priv_to_der(const void *vxkey, unsigned char **pder) { OQSX_KEY *oqsxkey = (OQSX_KEY *)vxkey; unsigned char *buf = NULL; uint32_t buflen = 0, privkeylen = 0; @@ -644,32 +630,32 @@ static int oqsx_pki_priv_to_der(const void *vxkey, unsigned char **pder) privkeylen = oqsxkey->privkeylen; if (oqsxkey->numkeys > 1) { // hybrid uint32_t actualprivkeylen = 0; - size_t fixed_pq_privkeylen - = oqsxkey->oqsx_provider_ctx.oqsx_qs_ctx.kem->length_secret_key; - size_t space_for_classical_privkey - = privkeylen - SIZE_OF_UINT32 - fixed_pq_privkeylen; + size_t fixed_pq_privkeylen = + oqsxkey->oqsx_provider_ctx.oqsx_qs_ctx.kem->length_secret_key; + size_t space_for_classical_privkey = + privkeylen - SIZE_OF_UINT32 - fixed_pq_privkeylen; DECODE_UINT32(actualprivkeylen, oqsxkey->privkey); - if ((actualprivkeylen > oqsxkey->evp_info->length_private_key) - || (actualprivkeylen > space_for_classical_privkey)) { + if ((actualprivkeylen > oqsxkey->evp_info->length_private_key) || + (actualprivkeylen > space_for_classical_privkey)) { ERR_raise(ERR_LIB_USER, OQSPROV_R_INVALID_ENCODING); return 0; } - privkeylen - -= (oqsxkey->evp_info->length_private_key - actualprivkeylen); + privkeylen -= + (oqsxkey->evp_info->length_private_key - actualprivkeylen); } #ifdef USE_ENCODING_LIB - if (oqsxkey->oqsx_encoding_ctx.encoding_ctx != NULL - && oqsxkey->oqsx_encoding_ctx.encoding_impl != NULL) { + if (oqsxkey->oqsx_encoding_ctx.encoding_ctx != NULL && + oqsxkey->oqsx_encoding_ctx.encoding_impl != NULL) { const OQSX_ENCODING_CTX *encoding_ctx = &oqsxkey->oqsx_encoding_ctx; int ret = 0; -# ifdef NOPUBKEY_IN_PRIVKEY - int withoptional = (encoding_ctx->encoding_ctx - ->raw_private_key_encodes_public_key - ? 1 - : 0); -# else +#ifdef NOPUBKEY_IN_PRIVKEY + int withoptional = + (encoding_ctx->encoding_ctx->raw_private_key_encodes_public_key + ? 1 + : 0); +#else int withoptional = 1; -# endif +#endif buflen = (withoptional ? encoding_ctx->encoding_impl->crypto_secretkeybytes : encoding_ctx->encoding_impl @@ -729,12 +715,12 @@ static int oqsx_pki_priv_to_der(const void *vxkey, unsigned char **pder) } OPENSSL_secure_clear_free(buf, buflen); } else { - ASN1_TYPE **aType - = OPENSSL_malloc(oqsxkey->numkeys * sizeof(ASN1_TYPE *)); - ASN1_OCTET_STRING **aString - = OPENSSL_malloc(oqsxkey->numkeys * sizeof(ASN1_OCTET_STRING *)); - unsigned char **temp - = OPENSSL_malloc(oqsxkey->numkeys * sizeof(unsigned char *)); + ASN1_TYPE **aType = + OPENSSL_malloc(oqsxkey->numkeys * sizeof(ASN1_TYPE *)); + ASN1_OCTET_STRING **aString = + OPENSSL_malloc(oqsxkey->numkeys * sizeof(ASN1_OCTET_STRING *)); + unsigned char **temp = + OPENSSL_malloc(oqsxkey->numkeys * sizeof(unsigned char *)); size_t *templen = OPENSSL_malloc(oqsxkey->numkeys * sizeof(size_t)); PKCS8_PRIV_KEY_INFO *p8inf_internal = NULL; int i; @@ -750,8 +736,8 @@ static int oqsx_pki_priv_to_der(const void *vxkey, unsigned char **pder) int nid, version; void *pval; - if ((name = get_cmpname(OBJ_sn2nid(oqsxkey->tls_name), i)) - == NULL) { + if ((name = get_cmpname(OBJ_sn2nid(oqsxkey->tls_name), i)) == + NULL) { for (int j = 0; j <= i; j++) { OPENSSL_cleanse(aString[j]->data, aString[j]->length); ASN1_OCTET_STRING_free(aString[j]); @@ -776,11 +762,11 @@ static int oqsx_pki_priv_to_der(const void *vxkey, unsigned char **pder) if (get_oqsname_fromtls(name) == 0) { - nid = oqsxkey->oqsx_provider_ctx.oqsx_evp_ctx->evp_info - ->keytype; + nid = + oqsxkey->oqsx_provider_ctx.oqsx_evp_ctx->evp_info->keytype; if (nid == EVP_PKEY_RSA) { // get the RSA real key size - unsigned char *enc_len - = OPENSSL_strndup(oqsxkey->comp_privkey[i], 4); + unsigned char *enc_len = + OPENSSL_strndup(oqsxkey->comp_privkey[i], 4); OPENSSL_cleanse(enc_len, 2); DECODE_UINT32(buflen, enc_len); buflen += 4; @@ -841,8 +827,8 @@ static int oqsx_pki_priv_to_der(const void *vxkey, unsigned char **pder) ERR_raise(ERR_LIB_USER, ERR_R_MALLOC_FAILURE); return -1; } - if (get_oqsname_fromtls(name) - != 0) { // include pubkey in privkey for PQC + if (get_oqsname_fromtls(name) != + 0) { // include pubkey in privkey for PQC memcpy(buf, oqsxkey->comp_privkey[i], oqsxkey->privkeylen_cmp[i]); memcpy(buf + oqsxkey->privkeylen_cmp[i], @@ -953,356 +939,356 @@ static int oqsx_pki_priv_to_der(const void *vxkey, unsigned char **pder) // OQS provider uses NIDs generated at load time as EVP_type identifiers // so initially this must be 0 and set to a real value by OBJ_sn2nid later ///// OQS_TEMPLATE_FRAGMENT_ENCODER_DEFINES_START -# define frodo640aes_evp_type 0 -# define frodo640aes_input_type "frodo640aes" -# define frodo640aes_pem_type "frodo640aes" - -# define p256_frodo640aes_evp_type 0 -# define p256_frodo640aes_input_type "p256_frodo640aes" -# define p256_frodo640aes_pem_type "p256_frodo640aes" -# define x25519_frodo640aes_evp_type 0 -# define x25519_frodo640aes_input_type "x25519_frodo640aes" -# define x25519_frodo640aes_pem_type "x25519_frodo640aes" -# define frodo640shake_evp_type 0 -# define frodo640shake_input_type "frodo640shake" -# define frodo640shake_pem_type "frodo640shake" - -# define p256_frodo640shake_evp_type 0 -# define p256_frodo640shake_input_type "p256_frodo640shake" -# define p256_frodo640shake_pem_type "p256_frodo640shake" -# define x25519_frodo640shake_evp_type 0 -# define x25519_frodo640shake_input_type "x25519_frodo640shake" -# define x25519_frodo640shake_pem_type "x25519_frodo640shake" -# define frodo976aes_evp_type 0 -# define frodo976aes_input_type "frodo976aes" -# define frodo976aes_pem_type "frodo976aes" - -# define p384_frodo976aes_evp_type 0 -# define p384_frodo976aes_input_type "p384_frodo976aes" -# define p384_frodo976aes_pem_type "p384_frodo976aes" -# define x448_frodo976aes_evp_type 0 -# define x448_frodo976aes_input_type "x448_frodo976aes" -# define x448_frodo976aes_pem_type "x448_frodo976aes" -# define frodo976shake_evp_type 0 -# define frodo976shake_input_type "frodo976shake" -# define frodo976shake_pem_type "frodo976shake" - -# define p384_frodo976shake_evp_type 0 -# define p384_frodo976shake_input_type "p384_frodo976shake" -# define p384_frodo976shake_pem_type "p384_frodo976shake" -# define x448_frodo976shake_evp_type 0 -# define x448_frodo976shake_input_type "x448_frodo976shake" -# define x448_frodo976shake_pem_type "x448_frodo976shake" -# define frodo1344aes_evp_type 0 -# define frodo1344aes_input_type "frodo1344aes" -# define frodo1344aes_pem_type "frodo1344aes" - -# define p521_frodo1344aes_evp_type 0 -# define p521_frodo1344aes_input_type "p521_frodo1344aes" -# define p521_frodo1344aes_pem_type "p521_frodo1344aes" -# define frodo1344shake_evp_type 0 -# define frodo1344shake_input_type "frodo1344shake" -# define frodo1344shake_pem_type "frodo1344shake" - -# define p521_frodo1344shake_evp_type 0 -# define p521_frodo1344shake_input_type "p521_frodo1344shake" -# define p521_frodo1344shake_pem_type "p521_frodo1344shake" -# define kyber512_evp_type 0 -# define kyber512_input_type "kyber512" -# define kyber512_pem_type "kyber512" - -# define p256_kyber512_evp_type 0 -# define p256_kyber512_input_type "p256_kyber512" -# define p256_kyber512_pem_type "p256_kyber512" -# define x25519_kyber512_evp_type 0 -# define x25519_kyber512_input_type "x25519_kyber512" -# define x25519_kyber512_pem_type "x25519_kyber512" -# define kyber768_evp_type 0 -# define kyber768_input_type "kyber768" -# define kyber768_pem_type "kyber768" - -# define p384_kyber768_evp_type 0 -# define p384_kyber768_input_type "p384_kyber768" -# define p384_kyber768_pem_type "p384_kyber768" -# define x448_kyber768_evp_type 0 -# define x448_kyber768_input_type "x448_kyber768" -# define x448_kyber768_pem_type "x448_kyber768" -# define x25519_kyber768_evp_type 0 -# define x25519_kyber768_input_type "x25519_kyber768" -# define x25519_kyber768_pem_type "x25519_kyber768" -# define p256_kyber768_evp_type 0 -# define p256_kyber768_input_type "p256_kyber768" -# define p256_kyber768_pem_type "p256_kyber768" -# define kyber1024_evp_type 0 -# define kyber1024_input_type "kyber1024" -# define kyber1024_pem_type "kyber1024" - -# define p521_kyber1024_evp_type 0 -# define p521_kyber1024_input_type "p521_kyber1024" -# define p521_kyber1024_pem_type "p521_kyber1024" -# define mlkem512_evp_type 0 -# define mlkem512_input_type "mlkem512" -# define mlkem512_pem_type "mlkem512" - -# define p256_mlkem512_evp_type 0 -# define p256_mlkem512_input_type "p256_mlkem512" -# define p256_mlkem512_pem_type "p256_mlkem512" -# define x25519_mlkem512_evp_type 0 -# define x25519_mlkem512_input_type "x25519_mlkem512" -# define x25519_mlkem512_pem_type "x25519_mlkem512" -# define mlkem768_evp_type 0 -# define mlkem768_input_type "mlkem768" -# define mlkem768_pem_type "mlkem768" - -# define p384_mlkem768_evp_type 0 -# define p384_mlkem768_input_type "p384_mlkem768" -# define p384_mlkem768_pem_type "p384_mlkem768" -# define x448_mlkem768_evp_type 0 -# define x448_mlkem768_input_type "x448_mlkem768" -# define x448_mlkem768_pem_type "x448_mlkem768" -# define x25519_mlkem768_evp_type 0 -# define x25519_mlkem768_input_type "x25519_mlkem768" -# define x25519_mlkem768_pem_type "x25519_mlkem768" -# define p256_mlkem768_evp_type 0 -# define p256_mlkem768_input_type "p256_mlkem768" -# define p256_mlkem768_pem_type "p256_mlkem768" -# define mlkem1024_evp_type 0 -# define mlkem1024_input_type "mlkem1024" -# define mlkem1024_pem_type "mlkem1024" - -# define p521_mlkem1024_evp_type 0 -# define p521_mlkem1024_input_type "p521_mlkem1024" -# define p521_mlkem1024_pem_type "p521_mlkem1024" -# define p384_mlkem1024_evp_type 0 -# define p384_mlkem1024_input_type "p384_mlkem1024" -# define p384_mlkem1024_pem_type "p384_mlkem1024" -# define bikel1_evp_type 0 -# define bikel1_input_type "bikel1" -# define bikel1_pem_type "bikel1" - -# define p256_bikel1_evp_type 0 -# define p256_bikel1_input_type "p256_bikel1" -# define p256_bikel1_pem_type "p256_bikel1" -# define x25519_bikel1_evp_type 0 -# define x25519_bikel1_input_type "x25519_bikel1" -# define x25519_bikel1_pem_type "x25519_bikel1" -# define bikel3_evp_type 0 -# define bikel3_input_type "bikel3" -# define bikel3_pem_type "bikel3" - -# define p384_bikel3_evp_type 0 -# define p384_bikel3_input_type "p384_bikel3" -# define p384_bikel3_pem_type "p384_bikel3" -# define x448_bikel3_evp_type 0 -# define x448_bikel3_input_type "x448_bikel3" -# define x448_bikel3_pem_type "x448_bikel3" -# define bikel5_evp_type 0 -# define bikel5_input_type "bikel5" -# define bikel5_pem_type "bikel5" - -# define p521_bikel5_evp_type 0 -# define p521_bikel5_input_type "p521_bikel5" -# define p521_bikel5_pem_type "p521_bikel5" -# define hqc128_evp_type 0 -# define hqc128_input_type "hqc128" -# define hqc128_pem_type "hqc128" - -# define p256_hqc128_evp_type 0 -# define p256_hqc128_input_type "p256_hqc128" -# define p256_hqc128_pem_type "p256_hqc128" -# define x25519_hqc128_evp_type 0 -# define x25519_hqc128_input_type "x25519_hqc128" -# define x25519_hqc128_pem_type "x25519_hqc128" -# define hqc192_evp_type 0 -# define hqc192_input_type "hqc192" -# define hqc192_pem_type "hqc192" - -# define p384_hqc192_evp_type 0 -# define p384_hqc192_input_type "p384_hqc192" -# define p384_hqc192_pem_type "p384_hqc192" -# define x448_hqc192_evp_type 0 -# define x448_hqc192_input_type "x448_hqc192" -# define x448_hqc192_pem_type "x448_hqc192" -# define hqc256_evp_type 0 -# define hqc256_input_type "hqc256" -# define hqc256_pem_type "hqc256" - -# define p521_hqc256_evp_type 0 -# define p521_hqc256_input_type "p521_hqc256" -# define p521_hqc256_pem_type "p521_hqc256" - - -# define dilithium2_evp_type 0 -# define dilithium2_input_type "dilithium2" -# define dilithium2_pem_type "dilithium2" -# define p256_dilithium2_evp_type 0 -# define p256_dilithium2_input_type "p256_dilithium2" -# define p256_dilithium2_pem_type "p256_dilithium2" -# define rsa3072_dilithium2_evp_type 0 -# define rsa3072_dilithium2_input_type "rsa3072_dilithium2" -# define rsa3072_dilithium2_pem_type "rsa3072_dilithium2" -# define dilithium3_evp_type 0 -# define dilithium3_input_type "dilithium3" -# define dilithium3_pem_type "dilithium3" -# define p384_dilithium3_evp_type 0 -# define p384_dilithium3_input_type "p384_dilithium3" -# define p384_dilithium3_pem_type "p384_dilithium3" -# define dilithium5_evp_type 0 -# define dilithium5_input_type "dilithium5" -# define dilithium5_pem_type "dilithium5" -# define p521_dilithium5_evp_type 0 -# define p521_dilithium5_input_type "p521_dilithium5" -# define p521_dilithium5_pem_type "p521_dilithium5" -# define mldsa44_evp_type 0 -# define mldsa44_input_type "mldsa44" -# define mldsa44_pem_type "mldsa44" -# define p256_mldsa44_evp_type 0 -# define p256_mldsa44_input_type "p256_mldsa44" -# define p256_mldsa44_pem_type "p256_mldsa44" -# define rsa3072_mldsa44_evp_type 0 -# define rsa3072_mldsa44_input_type "rsa3072_mldsa44" -# define rsa3072_mldsa44_pem_type "rsa3072_mldsa44" -# define mldsa44_pss2048_evp_type 0 -# define mldsa44_pss2048_input_type "mldsa44_pss2048" -# define mldsa44_pss2048_pem_type "mldsa44_pss2048" -# define mldsa44_rsa2048_evp_type 0 -# define mldsa44_rsa2048_input_type "mldsa44_rsa2048" -# define mldsa44_rsa2048_pem_type "mldsa44_rsa2048" -# define mldsa44_ed25519_evp_type 0 -# define mldsa44_ed25519_input_type "mldsa44_ed25519" -# define mldsa44_ed25519_pem_type "mldsa44_ed25519" -# define mldsa44_p256_evp_type 0 -# define mldsa44_p256_input_type "mldsa44_p256" -# define mldsa44_p256_pem_type "mldsa44_p256" -# define mldsa44_bp256_evp_type 0 -# define mldsa44_bp256_input_type "mldsa44_bp256" -# define mldsa44_bp256_pem_type "mldsa44_bp256" -# define mldsa65_evp_type 0 -# define mldsa65_input_type "mldsa65" -# define mldsa65_pem_type "mldsa65" -# define p384_mldsa65_evp_type 0 -# define p384_mldsa65_input_type "p384_mldsa65" -# define p384_mldsa65_pem_type "p384_mldsa65" -# define mldsa65_pss3072_evp_type 0 -# define mldsa65_pss3072_input_type "mldsa65_pss3072" -# define mldsa65_pss3072_pem_type "mldsa65_pss3072" -# define mldsa65_rsa3072_evp_type 0 -# define mldsa65_rsa3072_input_type "mldsa65_rsa3072" -# define mldsa65_rsa3072_pem_type "mldsa65_rsa3072" -# define mldsa65_p256_evp_type 0 -# define mldsa65_p256_input_type "mldsa65_p256" -# define mldsa65_p256_pem_type "mldsa65_p256" -# define mldsa65_bp256_evp_type 0 -# define mldsa65_bp256_input_type "mldsa65_bp256" -# define mldsa65_bp256_pem_type "mldsa65_bp256" -# define mldsa65_ed25519_evp_type 0 -# define mldsa65_ed25519_input_type "mldsa65_ed25519" -# define mldsa65_ed25519_pem_type "mldsa65_ed25519" -# define mldsa87_evp_type 0 -# define mldsa87_input_type "mldsa87" -# define mldsa87_pem_type "mldsa87" -# define p521_mldsa87_evp_type 0 -# define p521_mldsa87_input_type "p521_mldsa87" -# define p521_mldsa87_pem_type "p521_mldsa87" -# define mldsa87_p384_evp_type 0 -# define mldsa87_p384_input_type "mldsa87_p384" -# define mldsa87_p384_pem_type "mldsa87_p384" -# define mldsa87_bp384_evp_type 0 -# define mldsa87_bp384_input_type "mldsa87_bp384" -# define mldsa87_bp384_pem_type "mldsa87_bp384" -# define mldsa87_ed448_evp_type 0 -# define mldsa87_ed448_input_type "mldsa87_ed448" -# define mldsa87_ed448_pem_type "mldsa87_ed448" -# define falcon512_evp_type 0 -# define falcon512_input_type "falcon512" -# define falcon512_pem_type "falcon512" -# define p256_falcon512_evp_type 0 -# define p256_falcon512_input_type "p256_falcon512" -# define p256_falcon512_pem_type "p256_falcon512" -# define rsa3072_falcon512_evp_type 0 -# define rsa3072_falcon512_input_type "rsa3072_falcon512" -# define rsa3072_falcon512_pem_type "rsa3072_falcon512" -# define falconpadded512_evp_type 0 -# define falconpadded512_input_type "falconpadded512" -# define falconpadded512_pem_type "falconpadded512" -# define p256_falconpadded512_evp_type 0 -# define p256_falconpadded512_input_type "p256_falconpadded512" -# define p256_falconpadded512_pem_type "p256_falconpadded512" -# define rsa3072_falconpadded512_evp_type 0 -# define rsa3072_falconpadded512_input_type "rsa3072_falconpadded512" -# define rsa3072_falconpadded512_pem_type "rsa3072_falconpadded512" -# define falcon1024_evp_type 0 -# define falcon1024_input_type "falcon1024" -# define falcon1024_pem_type "falcon1024" -# define p521_falcon1024_evp_type 0 -# define p521_falcon1024_input_type "p521_falcon1024" -# define p521_falcon1024_pem_type "p521_falcon1024" -# define falconpadded1024_evp_type 0 -# define falconpadded1024_input_type "falconpadded1024" -# define falconpadded1024_pem_type "falconpadded1024" -# define p521_falconpadded1024_evp_type 0 -# define p521_falconpadded1024_input_type "p521_falconpadded1024" -# define p521_falconpadded1024_pem_type "p521_falconpadded1024" -# define sphincssha2128fsimple_evp_type 0 -# define sphincssha2128fsimple_input_type "sphincssha2128fsimple" -# define sphincssha2128fsimple_pem_type "sphincssha2128fsimple" -# define p256_sphincssha2128fsimple_evp_type 0 -# define p256_sphincssha2128fsimple_input_type "p256_sphincssha2128fsimple" -# define p256_sphincssha2128fsimple_pem_type "p256_sphincssha2128fsimple" -# define rsa3072_sphincssha2128fsimple_evp_type 0 -# define rsa3072_sphincssha2128fsimple_input_type "rsa3072_sphincssha2128fsimple" -# define rsa3072_sphincssha2128fsimple_pem_type "rsa3072_sphincssha2128fsimple" -# define sphincssha2128ssimple_evp_type 0 -# define sphincssha2128ssimple_input_type "sphincssha2128ssimple" -# define sphincssha2128ssimple_pem_type "sphincssha2128ssimple" -# define p256_sphincssha2128ssimple_evp_type 0 -# define p256_sphincssha2128ssimple_input_type "p256_sphincssha2128ssimple" -# define p256_sphincssha2128ssimple_pem_type "p256_sphincssha2128ssimple" -# define rsa3072_sphincssha2128ssimple_evp_type 0 -# define rsa3072_sphincssha2128ssimple_input_type "rsa3072_sphincssha2128ssimple" -# define rsa3072_sphincssha2128ssimple_pem_type "rsa3072_sphincssha2128ssimple" -# define sphincssha2192fsimple_evp_type 0 -# define sphincssha2192fsimple_input_type "sphincssha2192fsimple" -# define sphincssha2192fsimple_pem_type "sphincssha2192fsimple" -# define p384_sphincssha2192fsimple_evp_type 0 -# define p384_sphincssha2192fsimple_input_type "p384_sphincssha2192fsimple" -# define p384_sphincssha2192fsimple_pem_type "p384_sphincssha2192fsimple" -# define sphincsshake128fsimple_evp_type 0 -# define sphincsshake128fsimple_input_type "sphincsshake128fsimple" -# define sphincsshake128fsimple_pem_type "sphincsshake128fsimple" -# define p256_sphincsshake128fsimple_evp_type 0 -# define p256_sphincsshake128fsimple_input_type "p256_sphincsshake128fsimple" -# define p256_sphincsshake128fsimple_pem_type "p256_sphincsshake128fsimple" -# define rsa3072_sphincsshake128fsimple_evp_type 0 -# define rsa3072_sphincsshake128fsimple_input_type "rsa3072_sphincsshake128fsimple" -# define rsa3072_sphincsshake128fsimple_pem_type "rsa3072_sphincsshake128fsimple" -# define mayo1_evp_type 0 -# define mayo1_input_type "mayo1" -# define mayo1_pem_type "mayo1" -# define p256_mayo1_evp_type 0 -# define p256_mayo1_input_type "p256_mayo1" -# define p256_mayo1_pem_type "p256_mayo1" -# define mayo2_evp_type 0 -# define mayo2_input_type "mayo2" -# define mayo2_pem_type "mayo2" -# define p256_mayo2_evp_type 0 -# define p256_mayo2_input_type "p256_mayo2" -# define p256_mayo2_pem_type "p256_mayo2" -# define mayo3_evp_type 0 -# define mayo3_input_type "mayo3" -# define mayo3_pem_type "mayo3" -# define p384_mayo3_evp_type 0 -# define p384_mayo3_input_type "p384_mayo3" -# define p384_mayo3_pem_type "p384_mayo3" -# define mayo5_evp_type 0 -# define mayo5_input_type "mayo5" -# define mayo5_pem_type "mayo5" -# define p521_mayo5_evp_type 0 -# define p521_mayo5_input_type "p521_mayo5" -# define p521_mayo5_pem_type "p521_mayo5" -# define CROSSrsdp128balanced_evp_type 0 -# define CROSSrsdp128balanced_input_type "CROSSrsdp128balanced" -# define CROSSrsdp128balanced_pem_type "CROSSrsdp128balanced" +#define frodo640aes_evp_type 0 +#define frodo640aes_input_type "frodo640aes" +#define frodo640aes_pem_type "frodo640aes" + +#define p256_frodo640aes_evp_type 0 +#define p256_frodo640aes_input_type "p256_frodo640aes" +#define p256_frodo640aes_pem_type "p256_frodo640aes" +#define x25519_frodo640aes_evp_type 0 +#define x25519_frodo640aes_input_type "x25519_frodo640aes" +#define x25519_frodo640aes_pem_type "x25519_frodo640aes" +#define frodo640shake_evp_type 0 +#define frodo640shake_input_type "frodo640shake" +#define frodo640shake_pem_type "frodo640shake" + +#define p256_frodo640shake_evp_type 0 +#define p256_frodo640shake_input_type "p256_frodo640shake" +#define p256_frodo640shake_pem_type "p256_frodo640shake" +#define x25519_frodo640shake_evp_type 0 +#define x25519_frodo640shake_input_type "x25519_frodo640shake" +#define x25519_frodo640shake_pem_type "x25519_frodo640shake" +#define frodo976aes_evp_type 0 +#define frodo976aes_input_type "frodo976aes" +#define frodo976aes_pem_type "frodo976aes" + +#define p384_frodo976aes_evp_type 0 +#define p384_frodo976aes_input_type "p384_frodo976aes" +#define p384_frodo976aes_pem_type "p384_frodo976aes" +#define x448_frodo976aes_evp_type 0 +#define x448_frodo976aes_input_type "x448_frodo976aes" +#define x448_frodo976aes_pem_type "x448_frodo976aes" +#define frodo976shake_evp_type 0 +#define frodo976shake_input_type "frodo976shake" +#define frodo976shake_pem_type "frodo976shake" + +#define p384_frodo976shake_evp_type 0 +#define p384_frodo976shake_input_type "p384_frodo976shake" +#define p384_frodo976shake_pem_type "p384_frodo976shake" +#define x448_frodo976shake_evp_type 0 +#define x448_frodo976shake_input_type "x448_frodo976shake" +#define x448_frodo976shake_pem_type "x448_frodo976shake" +#define frodo1344aes_evp_type 0 +#define frodo1344aes_input_type "frodo1344aes" +#define frodo1344aes_pem_type "frodo1344aes" + +#define p521_frodo1344aes_evp_type 0 +#define p521_frodo1344aes_input_type "p521_frodo1344aes" +#define p521_frodo1344aes_pem_type "p521_frodo1344aes" +#define frodo1344shake_evp_type 0 +#define frodo1344shake_input_type "frodo1344shake" +#define frodo1344shake_pem_type "frodo1344shake" + +#define p521_frodo1344shake_evp_type 0 +#define p521_frodo1344shake_input_type "p521_frodo1344shake" +#define p521_frodo1344shake_pem_type "p521_frodo1344shake" +#define kyber512_evp_type 0 +#define kyber512_input_type "kyber512" +#define kyber512_pem_type "kyber512" + +#define p256_kyber512_evp_type 0 +#define p256_kyber512_input_type "p256_kyber512" +#define p256_kyber512_pem_type "p256_kyber512" +#define x25519_kyber512_evp_type 0 +#define x25519_kyber512_input_type "x25519_kyber512" +#define x25519_kyber512_pem_type "x25519_kyber512" +#define kyber768_evp_type 0 +#define kyber768_input_type "kyber768" +#define kyber768_pem_type "kyber768" + +#define p384_kyber768_evp_type 0 +#define p384_kyber768_input_type "p384_kyber768" +#define p384_kyber768_pem_type "p384_kyber768" +#define x448_kyber768_evp_type 0 +#define x448_kyber768_input_type "x448_kyber768" +#define x448_kyber768_pem_type "x448_kyber768" +#define x25519_kyber768_evp_type 0 +#define x25519_kyber768_input_type "x25519_kyber768" +#define x25519_kyber768_pem_type "x25519_kyber768" +#define p256_kyber768_evp_type 0 +#define p256_kyber768_input_type "p256_kyber768" +#define p256_kyber768_pem_type "p256_kyber768" +#define kyber1024_evp_type 0 +#define kyber1024_input_type "kyber1024" +#define kyber1024_pem_type "kyber1024" + +#define p521_kyber1024_evp_type 0 +#define p521_kyber1024_input_type "p521_kyber1024" +#define p521_kyber1024_pem_type "p521_kyber1024" +#define mlkem512_evp_type 0 +#define mlkem512_input_type "mlkem512" +#define mlkem512_pem_type "mlkem512" + +#define p256_mlkem512_evp_type 0 +#define p256_mlkem512_input_type "p256_mlkem512" +#define p256_mlkem512_pem_type "p256_mlkem512" +#define x25519_mlkem512_evp_type 0 +#define x25519_mlkem512_input_type "x25519_mlkem512" +#define x25519_mlkem512_pem_type "x25519_mlkem512" +#define mlkem768_evp_type 0 +#define mlkem768_input_type "mlkem768" +#define mlkem768_pem_type "mlkem768" + +#define p384_mlkem768_evp_type 0 +#define p384_mlkem768_input_type "p384_mlkem768" +#define p384_mlkem768_pem_type "p384_mlkem768" +#define x448_mlkem768_evp_type 0 +#define x448_mlkem768_input_type "x448_mlkem768" +#define x448_mlkem768_pem_type "x448_mlkem768" +#define x25519_mlkem768_evp_type 0 +#define x25519_mlkem768_input_type "x25519_mlkem768" +#define x25519_mlkem768_pem_type "x25519_mlkem768" +#define p256_mlkem768_evp_type 0 +#define p256_mlkem768_input_type "p256_mlkem768" +#define p256_mlkem768_pem_type "p256_mlkem768" +#define mlkem1024_evp_type 0 +#define mlkem1024_input_type "mlkem1024" +#define mlkem1024_pem_type "mlkem1024" + +#define p521_mlkem1024_evp_type 0 +#define p521_mlkem1024_input_type "p521_mlkem1024" +#define p521_mlkem1024_pem_type "p521_mlkem1024" +#define p384_mlkem1024_evp_type 0 +#define p384_mlkem1024_input_type "p384_mlkem1024" +#define p384_mlkem1024_pem_type "p384_mlkem1024" +#define bikel1_evp_type 0 +#define bikel1_input_type "bikel1" +#define bikel1_pem_type "bikel1" + +#define p256_bikel1_evp_type 0 +#define p256_bikel1_input_type "p256_bikel1" +#define p256_bikel1_pem_type "p256_bikel1" +#define x25519_bikel1_evp_type 0 +#define x25519_bikel1_input_type "x25519_bikel1" +#define x25519_bikel1_pem_type "x25519_bikel1" +#define bikel3_evp_type 0 +#define bikel3_input_type "bikel3" +#define bikel3_pem_type "bikel3" + +#define p384_bikel3_evp_type 0 +#define p384_bikel3_input_type "p384_bikel3" +#define p384_bikel3_pem_type "p384_bikel3" +#define x448_bikel3_evp_type 0 +#define x448_bikel3_input_type "x448_bikel3" +#define x448_bikel3_pem_type "x448_bikel3" +#define bikel5_evp_type 0 +#define bikel5_input_type "bikel5" +#define bikel5_pem_type "bikel5" + +#define p521_bikel5_evp_type 0 +#define p521_bikel5_input_type "p521_bikel5" +#define p521_bikel5_pem_type "p521_bikel5" +#define hqc128_evp_type 0 +#define hqc128_input_type "hqc128" +#define hqc128_pem_type "hqc128" + +#define p256_hqc128_evp_type 0 +#define p256_hqc128_input_type "p256_hqc128" +#define p256_hqc128_pem_type "p256_hqc128" +#define x25519_hqc128_evp_type 0 +#define x25519_hqc128_input_type "x25519_hqc128" +#define x25519_hqc128_pem_type "x25519_hqc128" +#define hqc192_evp_type 0 +#define hqc192_input_type "hqc192" +#define hqc192_pem_type "hqc192" + +#define p384_hqc192_evp_type 0 +#define p384_hqc192_input_type "p384_hqc192" +#define p384_hqc192_pem_type "p384_hqc192" +#define x448_hqc192_evp_type 0 +#define x448_hqc192_input_type "x448_hqc192" +#define x448_hqc192_pem_type "x448_hqc192" +#define hqc256_evp_type 0 +#define hqc256_input_type "hqc256" +#define hqc256_pem_type "hqc256" + +#define p521_hqc256_evp_type 0 +#define p521_hqc256_input_type "p521_hqc256" +#define p521_hqc256_pem_type "p521_hqc256" + +#define dilithium2_evp_type 0 +#define dilithium2_input_type "dilithium2" +#define dilithium2_pem_type "dilithium2" +#define p256_dilithium2_evp_type 0 +#define p256_dilithium2_input_type "p256_dilithium2" +#define p256_dilithium2_pem_type "p256_dilithium2" +#define rsa3072_dilithium2_evp_type 0 +#define rsa3072_dilithium2_input_type "rsa3072_dilithium2" +#define rsa3072_dilithium2_pem_type "rsa3072_dilithium2" +#define dilithium3_evp_type 0 +#define dilithium3_input_type "dilithium3" +#define dilithium3_pem_type "dilithium3" +#define p384_dilithium3_evp_type 0 +#define p384_dilithium3_input_type "p384_dilithium3" +#define p384_dilithium3_pem_type "p384_dilithium3" +#define dilithium5_evp_type 0 +#define dilithium5_input_type "dilithium5" +#define dilithium5_pem_type "dilithium5" +#define p521_dilithium5_evp_type 0 +#define p521_dilithium5_input_type "p521_dilithium5" +#define p521_dilithium5_pem_type "p521_dilithium5" +#define mldsa44_evp_type 0 +#define mldsa44_input_type "mldsa44" +#define mldsa44_pem_type "mldsa44" +#define p256_mldsa44_evp_type 0 +#define p256_mldsa44_input_type "p256_mldsa44" +#define p256_mldsa44_pem_type "p256_mldsa44" +#define rsa3072_mldsa44_evp_type 0 +#define rsa3072_mldsa44_input_type "rsa3072_mldsa44" +#define rsa3072_mldsa44_pem_type "rsa3072_mldsa44" +#define mldsa44_pss2048_evp_type 0 +#define mldsa44_pss2048_input_type "mldsa44_pss2048" +#define mldsa44_pss2048_pem_type "mldsa44_pss2048" +#define mldsa44_rsa2048_evp_type 0 +#define mldsa44_rsa2048_input_type "mldsa44_rsa2048" +#define mldsa44_rsa2048_pem_type "mldsa44_rsa2048" +#define mldsa44_ed25519_evp_type 0 +#define mldsa44_ed25519_input_type "mldsa44_ed25519" +#define mldsa44_ed25519_pem_type "mldsa44_ed25519" +#define mldsa44_p256_evp_type 0 +#define mldsa44_p256_input_type "mldsa44_p256" +#define mldsa44_p256_pem_type "mldsa44_p256" +#define mldsa44_bp256_evp_type 0 +#define mldsa44_bp256_input_type "mldsa44_bp256" +#define mldsa44_bp256_pem_type "mldsa44_bp256" +#define mldsa65_evp_type 0 +#define mldsa65_input_type "mldsa65" +#define mldsa65_pem_type "mldsa65" +#define p384_mldsa65_evp_type 0 +#define p384_mldsa65_input_type "p384_mldsa65" +#define p384_mldsa65_pem_type "p384_mldsa65" +#define mldsa65_pss3072_evp_type 0 +#define mldsa65_pss3072_input_type "mldsa65_pss3072" +#define mldsa65_pss3072_pem_type "mldsa65_pss3072" +#define mldsa65_rsa3072_evp_type 0 +#define mldsa65_rsa3072_input_type "mldsa65_rsa3072" +#define mldsa65_rsa3072_pem_type "mldsa65_rsa3072" +#define mldsa65_p256_evp_type 0 +#define mldsa65_p256_input_type "mldsa65_p256" +#define mldsa65_p256_pem_type "mldsa65_p256" +#define mldsa65_bp256_evp_type 0 +#define mldsa65_bp256_input_type "mldsa65_bp256" +#define mldsa65_bp256_pem_type "mldsa65_bp256" +#define mldsa65_ed25519_evp_type 0 +#define mldsa65_ed25519_input_type "mldsa65_ed25519" +#define mldsa65_ed25519_pem_type "mldsa65_ed25519" +#define mldsa87_evp_type 0 +#define mldsa87_input_type "mldsa87" +#define mldsa87_pem_type "mldsa87" +#define p521_mldsa87_evp_type 0 +#define p521_mldsa87_input_type "p521_mldsa87" +#define p521_mldsa87_pem_type "p521_mldsa87" +#define mldsa87_p384_evp_type 0 +#define mldsa87_p384_input_type "mldsa87_p384" +#define mldsa87_p384_pem_type "mldsa87_p384" +#define mldsa87_bp384_evp_type 0 +#define mldsa87_bp384_input_type "mldsa87_bp384" +#define mldsa87_bp384_pem_type "mldsa87_bp384" +#define mldsa87_ed448_evp_type 0 +#define mldsa87_ed448_input_type "mldsa87_ed448" +#define mldsa87_ed448_pem_type "mldsa87_ed448" +#define falcon512_evp_type 0 +#define falcon512_input_type "falcon512" +#define falcon512_pem_type "falcon512" +#define p256_falcon512_evp_type 0 +#define p256_falcon512_input_type "p256_falcon512" +#define p256_falcon512_pem_type "p256_falcon512" +#define rsa3072_falcon512_evp_type 0 +#define rsa3072_falcon512_input_type "rsa3072_falcon512" +#define rsa3072_falcon512_pem_type "rsa3072_falcon512" +#define falconpadded512_evp_type 0 +#define falconpadded512_input_type "falconpadded512" +#define falconpadded512_pem_type "falconpadded512" +#define p256_falconpadded512_evp_type 0 +#define p256_falconpadded512_input_type "p256_falconpadded512" +#define p256_falconpadded512_pem_type "p256_falconpadded512" +#define rsa3072_falconpadded512_evp_type 0 +#define rsa3072_falconpadded512_input_type "rsa3072_falconpadded512" +#define rsa3072_falconpadded512_pem_type "rsa3072_falconpadded512" +#define falcon1024_evp_type 0 +#define falcon1024_input_type "falcon1024" +#define falcon1024_pem_type "falcon1024" +#define p521_falcon1024_evp_type 0 +#define p521_falcon1024_input_type "p521_falcon1024" +#define p521_falcon1024_pem_type "p521_falcon1024" +#define falconpadded1024_evp_type 0 +#define falconpadded1024_input_type "falconpadded1024" +#define falconpadded1024_pem_type "falconpadded1024" +#define p521_falconpadded1024_evp_type 0 +#define p521_falconpadded1024_input_type "p521_falconpadded1024" +#define p521_falconpadded1024_pem_type "p521_falconpadded1024" +#define sphincssha2128fsimple_evp_type 0 +#define sphincssha2128fsimple_input_type "sphincssha2128fsimple" +#define sphincssha2128fsimple_pem_type "sphincssha2128fsimple" +#define p256_sphincssha2128fsimple_evp_type 0 +#define p256_sphincssha2128fsimple_input_type "p256_sphincssha2128fsimple" +#define p256_sphincssha2128fsimple_pem_type "p256_sphincssha2128fsimple" +#define rsa3072_sphincssha2128fsimple_evp_type 0 +#define rsa3072_sphincssha2128fsimple_input_type "rsa3072_sphincssha2128fsimple" +#define rsa3072_sphincssha2128fsimple_pem_type "rsa3072_sphincssha2128fsimple" +#define sphincssha2128ssimple_evp_type 0 +#define sphincssha2128ssimple_input_type "sphincssha2128ssimple" +#define sphincssha2128ssimple_pem_type "sphincssha2128ssimple" +#define p256_sphincssha2128ssimple_evp_type 0 +#define p256_sphincssha2128ssimple_input_type "p256_sphincssha2128ssimple" +#define p256_sphincssha2128ssimple_pem_type "p256_sphincssha2128ssimple" +#define rsa3072_sphincssha2128ssimple_evp_type 0 +#define rsa3072_sphincssha2128ssimple_input_type "rsa3072_sphincssha2128ssimple" +#define rsa3072_sphincssha2128ssimple_pem_type "rsa3072_sphincssha2128ssimple" +#define sphincssha2192fsimple_evp_type 0 +#define sphincssha2192fsimple_input_type "sphincssha2192fsimple" +#define sphincssha2192fsimple_pem_type "sphincssha2192fsimple" +#define p384_sphincssha2192fsimple_evp_type 0 +#define p384_sphincssha2192fsimple_input_type "p384_sphincssha2192fsimple" +#define p384_sphincssha2192fsimple_pem_type "p384_sphincssha2192fsimple" +#define sphincsshake128fsimple_evp_type 0 +#define sphincsshake128fsimple_input_type "sphincsshake128fsimple" +#define sphincsshake128fsimple_pem_type "sphincsshake128fsimple" +#define p256_sphincsshake128fsimple_evp_type 0 +#define p256_sphincsshake128fsimple_input_type "p256_sphincsshake128fsimple" +#define p256_sphincsshake128fsimple_pem_type "p256_sphincsshake128fsimple" +#define rsa3072_sphincsshake128fsimple_evp_type 0 +#define rsa3072_sphincsshake128fsimple_input_type \ + "rsa3072_sphincsshake128fsimple" +#define rsa3072_sphincsshake128fsimple_pem_type "rsa3072_sphincsshake128fsimple" +#define mayo1_evp_type 0 +#define mayo1_input_type "mayo1" +#define mayo1_pem_type "mayo1" +#define p256_mayo1_evp_type 0 +#define p256_mayo1_input_type "p256_mayo1" +#define p256_mayo1_pem_type "p256_mayo1" +#define mayo2_evp_type 0 +#define mayo2_input_type "mayo2" +#define mayo2_pem_type "mayo2" +#define p256_mayo2_evp_type 0 +#define p256_mayo2_input_type "p256_mayo2" +#define p256_mayo2_pem_type "p256_mayo2" +#define mayo3_evp_type 0 +#define mayo3_input_type "mayo3" +#define mayo3_pem_type "mayo3" +#define p384_mayo3_evp_type 0 +#define p384_mayo3_input_type "p384_mayo3" +#define p384_mayo3_pem_type "p384_mayo3" +#define mayo5_evp_type 0 +#define mayo5_input_type "mayo5" +#define mayo5_pem_type "mayo5" +#define p521_mayo5_evp_type 0 +#define p521_mayo5_input_type "p521_mayo5" +#define p521_mayo5_pem_type "p521_mayo5" +#define CROSSrsdp128balanced_evp_type 0 +#define CROSSrsdp128balanced_input_type "CROSSrsdp128balanced" +#define CROSSrsdp128balanced_pem_type "CROSSrsdp128balanced" ///// OQS_TEMPLATE_FRAGMENT_ENCODER_DEFINES_END /* ---------------------------------------------------------------------- */ @@ -1310,8 +1296,7 @@ static int oqsx_pki_priv_to_der(const void *vxkey, unsigned char **pder) static OSSL_FUNC_decoder_newctx_fn key2any_newctx; static OSSL_FUNC_decoder_freectx_fn key2any_freectx; -static void *key2any_newctx(void *provctx) -{ +static void *key2any_newctx(void *provctx) { struct key2any_ctx_st *ctx = OPENSSL_zalloc(sizeof(*ctx)); OQS_ENC_PRINTF("OQS ENC provider: key2any_newctx called\n"); @@ -1324,8 +1309,7 @@ static void *key2any_newctx(void *provctx) return ctx; } -static void key2any_freectx(void *vctx) -{ +static void key2any_freectx(void *vctx) { struct key2any_ctx_st *ctx = vctx; OQS_ENC_PRINTF("OQS ENC provider: key2any_freectx called\n"); @@ -1334,8 +1318,8 @@ static void key2any_freectx(void *vctx) OPENSSL_free(ctx); } -static const OSSL_PARAM *key2any_settable_ctx_params(ossl_unused void *provctx) -{ +static const OSSL_PARAM * +key2any_settable_ctx_params(ossl_unused void *provctx) { static const OSSL_PARAM settables[] = { OSSL_PARAM_utf8_string(OSSL_ENCODER_PARAM_CIPHER, NULL, 0), OSSL_PARAM_utf8_string(OSSL_ENCODER_PARAM_PROPERTIES, NULL, 0), @@ -1347,16 +1331,15 @@ static const OSSL_PARAM *key2any_settable_ctx_params(ossl_unused void *provctx) return settables; } -static int key2any_set_ctx_params(void *vctx, const OSSL_PARAM params[]) -{ +static int key2any_set_ctx_params(void *vctx, const OSSL_PARAM params[]) { struct key2any_ctx_st *ctx = vctx; OSSL_LIB_CTX *libctx = ctx->provctx->libctx; - const OSSL_PARAM *cipherp - = OSSL_PARAM_locate_const(params, OSSL_ENCODER_PARAM_CIPHER); - const OSSL_PARAM *propsp - = OSSL_PARAM_locate_const(params, OSSL_ENCODER_PARAM_PROPERTIES); - const OSSL_PARAM *save_paramsp - = OSSL_PARAM_locate_const(params, OSSL_ENCODER_PARAM_SAVE_PARAMETERS); + const OSSL_PARAM *cipherp = + OSSL_PARAM_locate_const(params, OSSL_ENCODER_PARAM_CIPHER); + const OSSL_PARAM *propsp = + OSSL_PARAM_locate_const(params, OSSL_ENCODER_PARAM_PROPERTIES); + const OSSL_PARAM *save_paramsp = + OSSL_PARAM_locate_const(params, OSSL_ENCODER_PARAM_SAVE_PARAMETERS); OQS_ENC_PRINTF("OQS ENC provider: key2any_set_ctx_params called\n"); @@ -1373,9 +1356,8 @@ static int key2any_set_ctx_params(void *vctx, const OSSL_PARAM params[]) EVP_CIPHER_free(ctx->cipher); ctx->cipher = NULL; ctx->cipher_intent = ciphername != NULL; - if (ciphername != NULL - && ((ctx->cipher = EVP_CIPHER_fetch(libctx, ciphername, props)) - == NULL)) { + if (ciphername != NULL && ((ctx->cipher = EVP_CIPHER_fetch( + libctx, ciphername, props)) == NULL)) { return 0; } } @@ -1390,20 +1372,19 @@ static int key2any_set_ctx_params(void *vctx, const OSSL_PARAM params[]) return 1; } -static int key2any_check_selection(int selection, int selection_mask) -{ +static int key2any_check_selection(int selection, int selection_mask) { /* * The selections are kinda sorta "levels", i.e. each selection given * here is assumed to include those following. */ - int checks[] - = {OSSL_KEYMGMT_SELECT_PRIVATE_KEY, OSSL_KEYMGMT_SELECT_PUBLIC_KEY, - OSSL_KEYMGMT_SELECT_ALL_PARAMETERS}; + int checks[] = {OSSL_KEYMGMT_SELECT_PRIVATE_KEY, + OSSL_KEYMGMT_SELECT_PUBLIC_KEY, + OSSL_KEYMGMT_SELECT_ALL_PARAMETERS}; size_t i; - OQS_ENC_PRINTF3( - "OQS ENC provider: key2any_check_selection called with selection %d (%d)\n", - selection, selection_mask); + OQS_ENC_PRINTF3("OQS ENC provider: key2any_check_selection called with " + "selection %d (%d)\n", + selection, selection_mask); /* The decoder implementations made here support guessing */ if (selection == 0) @@ -1434,8 +1415,7 @@ static int key2any_encode(struct key2any_ctx_st *ctx, OSSL_CORE_BIO *cout, const char *pemname, key_to_der_fn *writer, OSSL_PASSPHRASE_CALLBACK *pwcb, void *pwcbarg, key_to_paramstring_fn *key2paramstring, - i2d_of_void *key2der) -{ + i2d_of_void *key2der) { int ret = 0; int type = OBJ_sn2nid(typestr); OQSX_KEY *oqsk = (OQSX_KEY *)key; @@ -1457,8 +1437,8 @@ static int key2any_encode(struct key2any_ctx_st *ctx, OSSL_CORE_BIO *cout, ctx->pwcb = pwcb; ctx->pwcbarg = pwcbarg; - ret = writer(out, key, type, pemname, key2paramstring, key2der, - ctx); + ret = + writer(out, key, type, pemname, key2paramstring, key2der, ctx); } BIO_free(out); @@ -1470,27 +1450,27 @@ static int key2any_encode(struct key2any_ctx_st *ctx, OSSL_CORE_BIO *cout, } #define DO_PRIVATE_KEY_selection_mask OSSL_KEYMGMT_SELECT_PRIVATE_KEY -#define DO_PRIVATE_KEY(impl, type, kind, output) \ - if ((selection & DO_PRIVATE_KEY_selection_mask) != 0) \ - return key2any_encode( \ - ctx, cout, key, impl##_pem_type, impl##_pem_type " PRIVATE KEY", \ - key_to_##kind##_##output##_priv_bio, cb, cbarg, \ +#define DO_PRIVATE_KEY(impl, type, kind, output) \ + if ((selection & DO_PRIVATE_KEY_selection_mask) != 0) \ + return key2any_encode( \ + ctx, cout, key, impl##_pem_type, impl##_pem_type " PRIVATE KEY", \ + key_to_##kind##_##output##_priv_bio, cb, cbarg, \ prepare_##type##_params, type##_##kind##_priv_to_der); #define DO_PUBLIC_KEY_selection_mask OSSL_KEYMGMT_SELECT_PUBLIC_KEY -#define DO_PUBLIC_KEY(impl, type, kind, output) \ - if ((selection & DO_PUBLIC_KEY_selection_mask) != 0) \ - return key2any_encode( \ - ctx, cout, key, impl##_pem_type, impl##_pem_type " PUBLIC KEY", \ - key_to_##kind##_##output##_pub_bio, cb, cbarg, \ +#define DO_PUBLIC_KEY(impl, type, kind, output) \ + if ((selection & DO_PUBLIC_KEY_selection_mask) != 0) \ + return key2any_encode( \ + ctx, cout, key, impl##_pem_type, impl##_pem_type " PUBLIC KEY", \ + key_to_##kind##_##output##_pub_bio, cb, cbarg, \ prepare_##type##_params, type##_##kind##_pub_to_der); #define DO_PARAMETERS_selection_mask OSSL_KEYMGMT_SELECT_ALL_PARAMETERS -#define DO_PARAMETERS(impl, type, kind, output) \ - if ((selection & DO_PARAMETERS_selection_mask) != 0) \ - return key2any_encode(ctx, cout, key, impl##_pem_type, \ - impl##_pem_type " PARAMETERS", \ - key_to_##kind##_##output##_param_bio, NULL, \ +#define DO_PARAMETERS(impl, type, kind, output) \ + if ((selection & DO_PARAMETERS_selection_mask) != 0) \ + return key2any_encode(ctx, cout, key, impl##_pem_type, \ + impl##_pem_type " PARAMETERS", \ + key_to_##kind##_##output##_param_bio, NULL, \ NULL, NULL, type##_##kind##_params_to_der); /*- @@ -1527,16 +1507,16 @@ static int key2any_encode(struct key2any_ctx_st *ctx, OSSL_CORE_BIO *cout, * passphrase callback has been passed to them. */ #define DO_PrivateKeyInfo_selection_mask DO_PRIVATE_KEY_selection_mask -#define DO_PrivateKeyInfo(impl, type, output) \ +#define DO_PrivateKeyInfo(impl, type, output) \ DO_PRIVATE_KEY(impl, type, pki, output) #define DO_EncryptedPrivateKeyInfo_selection_mask DO_PRIVATE_KEY_selection_mask -#define DO_EncryptedPrivateKeyInfo(impl, type, output) \ +#define DO_EncryptedPrivateKeyInfo(impl, type, output) \ DO_PRIVATE_KEY(impl, type, epki, output) /* SubjectPublicKeyInfo is a structure for public keys only */ #define DO_SubjectPublicKeyInfo_selection_mask DO_PUBLIC_KEY_selection_mask -#define DO_SubjectPublicKeyInfo(impl, type, output) \ +#define DO_SubjectPublicKeyInfo(impl, type, output) \ DO_PUBLIC_KEY(impl, type, spki, output) /* @@ -1555,23 +1535,23 @@ static int key2any_encode(struct key2any_ctx_st *ctx, OSSL_CORE_BIO *cout, * except public key */ #define DO_type_specific_params_selection_mask DO_PARAMETERS_selection_mask -#define DO_type_specific_params(impl, type, output) \ +#define DO_type_specific_params(impl, type, output) \ DO_PARAMETERS(impl, type, type_specific, output) -#define DO_type_specific_keypair_selection_mask \ +#define DO_type_specific_keypair_selection_mask \ (DO_PRIVATE_KEY_selection_mask | DO_PUBLIC_KEY_selection_mask) -#define DO_type_specific_keypair(impl, type, output) \ - DO_PRIVATE_KEY(impl, type, type_specific, output) \ +#define DO_type_specific_keypair(impl, type, output) \ + DO_PRIVATE_KEY(impl, type, type_specific, output) \ DO_PUBLIC_KEY(impl, type, type_specific, output) -#define DO_type_specific_selection_mask \ - (DO_type_specific_keypair_selection_mask \ - | DO_type_specific_params_selection_mask) -#define DO_type_specific(impl, type, output) \ - DO_type_specific_keypair(impl, type, output) \ +#define DO_type_specific_selection_mask \ + (DO_type_specific_keypair_selection_mask | \ + DO_type_specific_params_selection_mask) +#define DO_type_specific(impl, type, output) \ + DO_type_specific_keypair(impl, type, output) \ DO_type_specific_params(impl, type, output) -#define DO_type_specific_no_pub_selection_mask \ +#define DO_type_specific_no_pub_selection_mask \ (DO_PRIVATE_KEY_selection_mask | DO_PARAMETERS_selection_mask) -#define DO_type_specific_no_pub(impl, type, output) \ - DO_PRIVATE_KEY(impl, type, type_specific, output) \ +#define DO_type_specific_no_pub(impl, type, output) \ + DO_PRIVATE_KEY(impl, type, type_specific, output) \ DO_type_specific_params(impl, type, output) /* @@ -1600,8 +1580,7 @@ static int key2any_encode(struct key2any_ctx_st *ctx, OSSL_CORE_BIO *cout, static OSSL_FUNC_encoder_encode_fn impl##_to_##kind##_##output##_encode; \ \ static void *impl##_to_##kind##_##output##_import_object( \ - void *vctx, int selection, const OSSL_PARAM params[]) \ - { \ + void *vctx, int selection, const OSSL_PARAM params[]) { \ struct key2any_ctx_st *ctx = vctx; \ \ OQS_ENC_PRINTF("OQS ENC provider: _import_object called\n"); \ @@ -1609,22 +1588,19 @@ static int key2any_encode(struct key2any_ctx_st *ctx, OSSL_CORE_BIO *cout, oqs##oqskemhyb##_##impl##_keymgmt_functions, ctx->provctx, \ selection, params); \ } \ - static void impl##_to_##kind##_##output##_free_object(void *key) \ - { \ + static void impl##_to_##kind##_##output##_free_object(void *key) { \ OQS_ENC_PRINTF("OQS ENC provider: _free_object called\n"); \ oqs_prov_free_key(oqs##oqskemhyb##_##impl##_keymgmt_functions, key); \ } \ static int impl##_to_##kind##_##output##_does_selection(void *ctx, \ - int selection) \ - { \ + int selection) { \ OQS_ENC_PRINTF("OQS ENC provider: _does_selection called\n"); \ return key2any_check_selection(selection, DO_##kind##_selection_mask); \ } \ static int impl##_to_##kind##_##output##_encode( \ void *ctx, OSSL_CORE_BIO *cout, const void *key, \ const OSSL_PARAM key_abstract[], int selection, \ - OSSL_PASSPHRASE_CALLBACK *cb, void *cbarg) \ - { \ + OSSL_PASSPHRASE_CALLBACK *cb, void *cbarg) { \ /* We don't deal with abstract objects */ \ OQS_ENC_PRINTF("OQS ENC provider: _encode called\n"); \ if (key_abstract != NULL) { \ @@ -1637,22 +1613,22 @@ static int key2any_encode(struct key2any_ctx_st *ctx, OSSL_CORE_BIO *cout, return 0; \ } \ const OSSL_DISPATCH \ - oqs_##impl##_to_##kind##_##output##_encoder_functions[] \ - = {{OSSL_FUNC_ENCODER_NEWCTX, (void (*)(void))key2any_newctx}, \ - {OSSL_FUNC_ENCODER_FREECTX, (void (*)(void))key2any_freectx}, \ - {OSSL_FUNC_ENCODER_SETTABLE_CTX_PARAMS, \ - (void (*)(void))key2any_settable_ctx_params}, \ - {OSSL_FUNC_ENCODER_SET_CTX_PARAMS, \ - (void (*)(void))key2any_set_ctx_params}, \ - {OSSL_FUNC_ENCODER_DOES_SELECTION, \ - (void (*)(void))impl##_to_##kind##_##output##_does_selection}, \ - {OSSL_FUNC_ENCODER_IMPORT_OBJECT, \ - (void (*)(void))impl##_to_##kind##_##output##_import_object}, \ - {OSSL_FUNC_ENCODER_FREE_OBJECT, \ - (void (*)(void))impl##_to_##kind##_##output##_free_object}, \ - {OSSL_FUNC_ENCODER_ENCODE, \ - (void (*)(void))impl##_to_##kind##_##output##_encode}, \ - {0, NULL}} + oqs_##impl##_to_##kind##_##output##_encoder_functions[] = { \ + {OSSL_FUNC_ENCODER_NEWCTX, (void (*)(void))key2any_newctx}, \ + {OSSL_FUNC_ENCODER_FREECTX, (void (*)(void))key2any_freectx}, \ + {OSSL_FUNC_ENCODER_SETTABLE_CTX_PARAMS, \ + (void (*)(void))key2any_settable_ctx_params}, \ + {OSSL_FUNC_ENCODER_SET_CTX_PARAMS, \ + (void (*)(void))key2any_set_ctx_params}, \ + {OSSL_FUNC_ENCODER_DOES_SELECTION, \ + (void (*)(void))impl##_to_##kind##_##output##_does_selection}, \ + {OSSL_FUNC_ENCODER_IMPORT_OBJECT, \ + (void (*)(void))impl##_to_##kind##_##output##_import_object}, \ + {OSSL_FUNC_ENCODER_FREE_OBJECT, \ + (void (*)(void))impl##_to_##kind##_##output##_free_object}, \ + {OSSL_FUNC_ENCODER_ENCODE, \ + (void (*)(void))impl##_to_##kind##_##output##_encode}, \ + {0, NULL}} /* ---------------------------------------------------------------------- */ @@ -1662,8 +1638,7 @@ static int key2any_encode(struct key2any_ctx_st *ctx, OSSL_CORE_BIO *cout, #define LABELED_BUF_PRINT_WIDTH 15 static int print_labeled_buf(BIO *out, const char *label, - const unsigned char *buf, size_t buflen) -{ + const unsigned char *buf, size_t buflen) { size_t i; if (BIO_printf(out, "%s\n", label) <= 0) @@ -1677,8 +1652,8 @@ static int print_labeled_buf(BIO *out, const char *label, return 0; } - if (BIO_printf(out, "%02x%s", buf[i], (i == buflen - 1) ? "" : ":") - <= 0) + if (BIO_printf(out, "%02x%s", buf[i], (i == buflen - 1) ? "" : ":") <= + 0) return 0; } if (BIO_printf(out, "\n") <= 0) @@ -1687,8 +1662,7 @@ static int print_labeled_buf(BIO *out, const char *label, return 1; } -static int oqsx_to_text(BIO *out, const void *key, int selection) -{ +static int oqsx_to_text(BIO *out, const void *key, int selection) { OQSX_KEY *okey = (OQSX_KEY *)key; if (out == NULL || okey == NULL) { @@ -1711,13 +1685,13 @@ static int oqsx_to_text(BIO *out, const void *key, int selection) case KEY_TYPE_ECP_HYB_KEM: case KEY_TYPE_ECX_HYB_KEM: case KEY_TYPE_HYB_SIG: - if (BIO_printf(out, "%s hybrid private key:\n", okey->tls_name) - <= 0) + if (BIO_printf(out, "%s hybrid private key:\n", okey->tls_name) <= + 0) return 0; break; case KEY_TYPE_CMP_SIG: - if (BIO_printf(out, "%s composite private key:\n", okey->tls_name) - <= 0) + if (BIO_printf(out, "%s composite private key:\n", + okey->tls_name) <= 0) return 0; break; default: @@ -1743,8 +1717,8 @@ static int oqsx_to_text(BIO *out, const void *key, int selection) return 0; break; case KEY_TYPE_CMP_SIG: - if (BIO_printf(out, "%s composite public key:\n", okey->tls_name) - <= 0) + if (BIO_printf(out, "%s composite public key:\n", okey->tls_name) <= + 0) return 0; break; default: @@ -1761,8 +1735,8 @@ static int oqsx_to_text(BIO *out, const void *key, int selection) int i; uint32_t privlen = 0; for (i = 0; i < okey->numkeys; i++) { - if ((name = get_cmpname(OBJ_sn2nid(okey->tls_name), i)) - == NULL) { + if ((name = get_cmpname(OBJ_sn2nid(okey->tls_name), i)) == + NULL) { ERR_raise(ERR_LIB_USER, OQSPROV_R_INVALID_KEY); return 0; } @@ -1770,10 +1744,10 @@ static int oqsx_to_text(BIO *out, const void *key, int selection) if (get_oqsname_fromtls(name) == 0 // classical key && okey->oqsx_provider_ctx.oqsx_evp_ctx->evp_info - ->keytype - == EVP_PKEY_RSA) { // get the RSA real key size - unsigned char *enc_len - = OPENSSL_strndup(okey->comp_privkey[i], 4); + ->keytype == + EVP_PKEY_RSA) { // get the RSA real key size + unsigned char *enc_len = + OPENSSL_strndup(okey->comp_privkey[i], 4); OPENSSL_cleanse(enc_len, 2); DECODE_UINT32(privlen, enc_len); privlen += 4; @@ -1795,12 +1769,12 @@ static int oqsx_to_text(BIO *out, const void *key, int selection) if (okey->numkeys > 1) { // hybrid key char classic_label[200]; uint32_t classic_key_len = 0; - size_t fixed_pq_privkey_len - = okey->oqsx_provider_ctx.oqsx_qs_ctx.kem - ->length_secret_key; - size_t space_for_classical_privkey = okey->privkeylen - - SIZE_OF_UINT32 - - fixed_pq_privkey_len; + size_t fixed_pq_privkey_len = + okey->oqsx_provider_ctx.oqsx_qs_ctx.kem + ->length_secret_key; + size_t space_for_classical_privkey = okey->privkeylen - + SIZE_OF_UINT32 - + fixed_pq_privkey_len; sprintf(classic_label, "%s key material:", OBJ_nid2sn(okey->evp_info->nid)); DECODE_UINT32(classic_key_len, okey->privkey); @@ -1816,8 +1790,8 @@ static int oqsx_to_text(BIO *out, const void *key, int selection) if (!print_labeled_buf( out, "PQ key material:", okey->comp_privkey[okey->numkeys - 1], - okey->privkeylen - classic_key_len - - SIZE_OF_UINT32)) + okey->privkeylen - classic_key_len - + SIZE_OF_UINT32)) return 0; } else { // plain PQ key if (!print_labeled_buf( @@ -1836,8 +1810,8 @@ static int oqsx_to_text(BIO *out, const void *key, int selection) char label[200]; int i; for (i = 0; i < okey->numkeys; i++) { - if ((name = get_cmpname(OBJ_sn2nid(okey->tls_name), i)) - == NULL) { + if ((name = get_cmpname(OBJ_sn2nid(okey->tls_name), i)) == + NULL) { ERR_raise(ERR_LIB_USER, OQSPROV_R_INVALID_KEY); return 0; } @@ -1853,12 +1827,11 @@ static int oqsx_to_text(BIO *out, const void *key, int selection) if (okey->numkeys > 1) { // hybrid key char classic_label[200]; uint32_t classic_key_len = 0; - size_t fixed_pq_pubkey_len - = okey->oqsx_provider_ctx.oqsx_qs_ctx.kem - ->length_public_key; - size_t space_for_classical_pubkey = okey->pubkeylen - - SIZE_OF_UINT32 - - fixed_pq_pubkey_len; + size_t fixed_pq_pubkey_len = + okey->oqsx_provider_ctx.oqsx_qs_ctx.kem + ->length_public_key; + size_t space_for_classical_pubkey = + okey->pubkeylen - SIZE_OF_UINT32 - fixed_pq_pubkey_len; DECODE_UINT32(classic_key_len, okey->pubkey); if (classic_key_len > space_for_classical_pubkey) { ERR_raise(ERR_LIB_USER, OQSPROV_R_INVALID_ENCODING); @@ -1873,8 +1846,8 @@ static int oqsx_to_text(BIO *out, const void *key, int selection) /* finally print pure PQ key */ if (!print_labeled_buf(out, "PQ key material:", okey->comp_pubkey[okey->numkeys - 1], - okey->pubkeylen - classic_key_len - - SIZE_OF_UINT32)) + okey->pubkeylen - classic_key_len - + SIZE_OF_UINT32)) return 0; } else { // PQ key only if (!print_labeled_buf(out, "PQ key material:", @@ -1889,20 +1862,14 @@ static int oqsx_to_text(BIO *out, const void *key, int selection) return 1; } -static void *key2text_newctx(void *provctx) -{ - return provctx; -} +static void *key2text_newctx(void *provctx) { return provctx; } -static void key2text_freectx(ossl_unused void *vctx) -{ -} +static void key2text_freectx(ossl_unused void *vctx) {} static int key2text_encode(void *vctx, const void *key, int selection, OSSL_CORE_BIO *cout, int (*key2text)(BIO *out, const void *key, int selection), - OSSL_PASSPHRASE_CALLBACK *cb, void *cbarg) -{ + OSSL_PASSPHRASE_CALLBACK *cb, void *cbarg) { BIO *out = oqs_bio_new_from_core_bio(vctx, cout); int ret; @@ -1915,44 +1882,41 @@ key2text_encode(void *vctx, const void *key, int selection, OSSL_CORE_BIO *cout, return ret; } -#define MAKE_TEXT_ENCODER(oqskemhyb, impl) \ - static OSSL_FUNC_encoder_import_object_fn impl##2text_import_object; \ - static OSSL_FUNC_encoder_free_object_fn impl##2text_free_object; \ - static OSSL_FUNC_encoder_encode_fn impl##2text_encode; \ - \ - static void *impl##2text_import_object(void *ctx, int selection, \ - const OSSL_PARAM params[]) \ - { \ - return oqs_prov_import_key( \ - oqs##oqskemhyb##_##impl##_keymgmt_functions, ctx, selection, \ - params); \ - } \ - static void impl##2text_free_object(void *key) \ - { \ - oqs_prov_free_key(oqs##oqskemhyb##_##impl##_keymgmt_functions, key); \ - } \ - static int impl##2text_encode( \ - void *vctx, OSSL_CORE_BIO *cout, const void *key, \ - const OSSL_PARAM key_abstract[], int selection, \ - OSSL_PASSPHRASE_CALLBACK *cb, void *cbarg) \ - { \ - /* We don't deal with abstract objects */ \ - if (key_abstract != NULL) { \ - ERR_raise(ERR_LIB_USER, ERR_R_PASSED_INVALID_ARGUMENT); \ - return 0; \ - } \ - return key2text_encode(vctx, key, selection, cout, oqsx_to_text, cb, \ - cbarg); \ - } \ - const OSSL_DISPATCH oqs_##impl##_to_text_encoder_functions[] \ - = {{OSSL_FUNC_ENCODER_NEWCTX, (void (*)(void))key2text_newctx}, \ - {OSSL_FUNC_ENCODER_FREECTX, (void (*)(void))key2text_freectx}, \ - {OSSL_FUNC_ENCODER_IMPORT_OBJECT, \ - (void (*)(void))impl##2text_import_object}, \ - {OSSL_FUNC_ENCODER_FREE_OBJECT, \ - (void (*)(void))impl##2text_free_object}, \ - {OSSL_FUNC_ENCODER_ENCODE, (void (*)(void))impl##2text_encode}, \ - {0, NULL}} +#define MAKE_TEXT_ENCODER(oqskemhyb, impl) \ + static OSSL_FUNC_encoder_import_object_fn impl##2text_import_object; \ + static OSSL_FUNC_encoder_free_object_fn impl##2text_free_object; \ + static OSSL_FUNC_encoder_encode_fn impl##2text_encode; \ + \ + static void *impl##2text_import_object(void *ctx, int selection, \ + const OSSL_PARAM params[]) { \ + return oqs_prov_import_key( \ + oqs##oqskemhyb##_##impl##_keymgmt_functions, ctx, selection, \ + params); \ + } \ + static void impl##2text_free_object(void *key) { \ + oqs_prov_free_key(oqs##oqskemhyb##_##impl##_keymgmt_functions, key); \ + } \ + static int impl##2text_encode( \ + void *vctx, OSSL_CORE_BIO *cout, const void *key, \ + const OSSL_PARAM key_abstract[], int selection, \ + OSSL_PASSPHRASE_CALLBACK *cb, void *cbarg) { \ + /* We don't deal with abstract objects */ \ + if (key_abstract != NULL) { \ + ERR_raise(ERR_LIB_USER, ERR_R_PASSED_INVALID_ARGUMENT); \ + return 0; \ + } \ + return key2text_encode(vctx, key, selection, cout, oqsx_to_text, cb, \ + cbarg); \ + } \ + const OSSL_DISPATCH oqs_##impl##_to_text_encoder_functions[] = { \ + {OSSL_FUNC_ENCODER_NEWCTX, (void (*)(void))key2text_newctx}, \ + {OSSL_FUNC_ENCODER_FREECTX, (void (*)(void))key2text_freectx}, \ + {OSSL_FUNC_ENCODER_IMPORT_OBJECT, \ + (void (*)(void))impl##2text_import_object}, \ + {OSSL_FUNC_ENCODER_FREE_OBJECT, \ + (void (*)(void))impl##2text_free_object}, \ + {OSSL_FUNC_ENCODER_ENCODE, (void (*)(void))impl##2text_encode}, \ + {0, NULL}} /* * Replacements for i2d_{TYPE}PrivateKey, i2d_{TYPE}PublicKey, @@ -1970,7 +1934,6 @@ key2text_encode(void *vctx, const void *key, int selection, OSSL_CORE_BIO *cout, ///// OQS_TEMPLATE_FRAGMENT_ENCODER_MAKE_START #ifdef OQS_KEM_ENCODERS - MAKE_ENCODER(, frodo640aes, oqsx, EncryptedPrivateKeyInfo, der); MAKE_ENCODER(, frodo640aes, oqsx, EncryptedPrivateKeyInfo, pem); MAKE_ENCODER(, frodo640aes, oqsx, PrivateKeyInfo, der); @@ -2635,8 +2598,10 @@ MAKE_ENCODER(, p256_sphincssha2128fsimple, oqsx, PrivateKeyInfo, pem); MAKE_ENCODER(, p256_sphincssha2128fsimple, oqsx, SubjectPublicKeyInfo, der); MAKE_ENCODER(, p256_sphincssha2128fsimple, oqsx, SubjectPublicKeyInfo, pem); MAKE_TEXT_ENCODER(, p256_sphincssha2128fsimple); -MAKE_ENCODER(, rsa3072_sphincssha2128fsimple, oqsx, EncryptedPrivateKeyInfo, der); -MAKE_ENCODER(, rsa3072_sphincssha2128fsimple, oqsx, EncryptedPrivateKeyInfo, pem); +MAKE_ENCODER(, rsa3072_sphincssha2128fsimple, oqsx, EncryptedPrivateKeyInfo, + der); +MAKE_ENCODER(, rsa3072_sphincssha2128fsimple, oqsx, EncryptedPrivateKeyInfo, + pem); MAKE_ENCODER(, rsa3072_sphincssha2128fsimple, oqsx, PrivateKeyInfo, der); MAKE_ENCODER(, rsa3072_sphincssha2128fsimple, oqsx, PrivateKeyInfo, pem); MAKE_ENCODER(, rsa3072_sphincssha2128fsimple, oqsx, SubjectPublicKeyInfo, der); @@ -2656,8 +2621,10 @@ MAKE_ENCODER(, p256_sphincssha2128ssimple, oqsx, PrivateKeyInfo, pem); MAKE_ENCODER(, p256_sphincssha2128ssimple, oqsx, SubjectPublicKeyInfo, der); MAKE_ENCODER(, p256_sphincssha2128ssimple, oqsx, SubjectPublicKeyInfo, pem); MAKE_TEXT_ENCODER(, p256_sphincssha2128ssimple); -MAKE_ENCODER(, rsa3072_sphincssha2128ssimple, oqsx, EncryptedPrivateKeyInfo, der); -MAKE_ENCODER(, rsa3072_sphincssha2128ssimple, oqsx, EncryptedPrivateKeyInfo, pem); +MAKE_ENCODER(, rsa3072_sphincssha2128ssimple, oqsx, EncryptedPrivateKeyInfo, + der); +MAKE_ENCODER(, rsa3072_sphincssha2128ssimple, oqsx, EncryptedPrivateKeyInfo, + pem); MAKE_ENCODER(, rsa3072_sphincssha2128ssimple, oqsx, PrivateKeyInfo, der); MAKE_ENCODER(, rsa3072_sphincssha2128ssimple, oqsx, PrivateKeyInfo, pem); MAKE_ENCODER(, rsa3072_sphincssha2128ssimple, oqsx, SubjectPublicKeyInfo, der); @@ -2691,8 +2658,10 @@ MAKE_ENCODER(, p256_sphincsshake128fsimple, oqsx, PrivateKeyInfo, pem); MAKE_ENCODER(, p256_sphincsshake128fsimple, oqsx, SubjectPublicKeyInfo, der); MAKE_ENCODER(, p256_sphincsshake128fsimple, oqsx, SubjectPublicKeyInfo, pem); MAKE_TEXT_ENCODER(, p256_sphincsshake128fsimple); -MAKE_ENCODER(, rsa3072_sphincsshake128fsimple, oqsx, EncryptedPrivateKeyInfo, der); -MAKE_ENCODER(, rsa3072_sphincsshake128fsimple, oqsx, EncryptedPrivateKeyInfo, pem); +MAKE_ENCODER(, rsa3072_sphincsshake128fsimple, oqsx, EncryptedPrivateKeyInfo, + der); +MAKE_ENCODER(, rsa3072_sphincsshake128fsimple, oqsx, EncryptedPrivateKeyInfo, + pem); MAKE_ENCODER(, rsa3072_sphincsshake128fsimple, oqsx, PrivateKeyInfo, der); MAKE_ENCODER(, rsa3072_sphincsshake128fsimple, oqsx, PrivateKeyInfo, pem); MAKE_ENCODER(, rsa3072_sphincsshake128fsimple, oqsx, SubjectPublicKeyInfo, der); diff --git a/oqsprov/oqs_endecoder_common.c b/oqsprov/oqs_endecoder_common.c index c0fa423c..2fb6e878 100644 --- a/oqsprov/oqs_endecoder_common.c +++ b/oqsprov/oqs_endecoder_common.c @@ -13,8 +13,7 @@ #include #include -OSSL_FUNC_keymgmt_new_fn *oqs_prov_get_keymgmt_new(const OSSL_DISPATCH *fns) -{ +OSSL_FUNC_keymgmt_new_fn *oqs_prov_get_keymgmt_new(const OSSL_DISPATCH *fns) { /* Pilfer the keymgmt dispatch table */ for (; fns->function_id != 0; fns++) if (fns->function_id == OSSL_FUNC_KEYMGMT_NEW) @@ -23,8 +22,7 @@ OSSL_FUNC_keymgmt_new_fn *oqs_prov_get_keymgmt_new(const OSSL_DISPATCH *fns) return NULL; } -OSSL_FUNC_keymgmt_free_fn *oqs_prov_get_keymgmt_free(const OSSL_DISPATCH *fns) -{ +OSSL_FUNC_keymgmt_free_fn *oqs_prov_get_keymgmt_free(const OSSL_DISPATCH *fns) { /* Pilfer the keymgmt dispatch table */ for (; fns->function_id != 0; fns++) if (fns->function_id == OSSL_FUNC_KEYMGMT_FREE) @@ -34,8 +32,7 @@ OSSL_FUNC_keymgmt_free_fn *oqs_prov_get_keymgmt_free(const OSSL_DISPATCH *fns) } OSSL_FUNC_keymgmt_import_fn * -oqs_prov_get_keymgmt_import(const OSSL_DISPATCH *fns) -{ +oqs_prov_get_keymgmt_import(const OSSL_DISPATCH *fns) { /* Pilfer the keymgmt dispatch table */ for (; fns->function_id != 0; fns++) if (fns->function_id == OSSL_FUNC_KEYMGMT_IMPORT) @@ -45,8 +42,7 @@ oqs_prov_get_keymgmt_import(const OSSL_DISPATCH *fns) } OSSL_FUNC_keymgmt_export_fn * -oqs_prov_get_keymgmt_export(const OSSL_DISPATCH *fns) -{ +oqs_prov_get_keymgmt_export(const OSSL_DISPATCH *fns) { /* Pilfer the keymgmt dispatch table */ for (; fns->function_id != 0; fns++) if (fns->function_id == OSSL_FUNC_KEYMGMT_EXPORT) @@ -56,17 +52,16 @@ oqs_prov_get_keymgmt_export(const OSSL_DISPATCH *fns) } void *oqs_prov_import_key(const OSSL_DISPATCH *fns, void *provctx, - int selection, const OSSL_PARAM params[]) -{ + int selection, const OSSL_PARAM params[]) { OSSL_FUNC_keymgmt_new_fn *kmgmt_new = oqs_prov_get_keymgmt_new(fns); OSSL_FUNC_keymgmt_free_fn *kmgmt_free = oqs_prov_get_keymgmt_free(fns); - OSSL_FUNC_keymgmt_import_fn *kmgmt_import - = oqs_prov_get_keymgmt_import(fns); + OSSL_FUNC_keymgmt_import_fn *kmgmt_import = + oqs_prov_get_keymgmt_import(fns); void *key = NULL; if (kmgmt_new != NULL && kmgmt_import != NULL && kmgmt_free != NULL) { - if ((key = kmgmt_new(provctx)) == NULL - || !kmgmt_import(key, selection, params)) { + if ((key = kmgmt_new(provctx)) == NULL || + !kmgmt_import(key, selection, params)) { kmgmt_free(key); key = NULL; } @@ -74,8 +69,7 @@ void *oqs_prov_import_key(const OSSL_DISPATCH *fns, void *provctx, return key; } -void oqs_prov_free_key(const OSSL_DISPATCH *fns, void *key) -{ +void oqs_prov_free_key(const OSSL_DISPATCH *fns, void *key) { OSSL_FUNC_keymgmt_free_fn *kmgmt_free = oqs_prov_get_keymgmt_free(fns); if (kmgmt_free != NULL) diff --git a/oqsprov/oqs_hyb_kem.c b/oqsprov/oqs_hyb_kem.c index 98c87d1d..16be6a6f 100644 --- a/oqsprov/oqs_hyb_kem.c +++ b/oqsprov/oqs_hyb_kem.c @@ -14,8 +14,7 @@ static OSSL_FUNC_kem_decapsulate_fn oqs_hyb_kem_decaps; static int oqs_evp_kem_encaps_keyslot(void *vpkemctx, unsigned char *ct, size_t *ctlen, unsigned char *secret, - size_t *secretlen, int keyslot) -{ + size_t *secretlen, int keyslot) { int ret = OQS_SUCCESS, ret2 = 0; const PROV_OQSKEM_CTX *pkemctx = (PROV_OQSKEM_CTX *)vpkemctx; @@ -91,8 +90,7 @@ static int oqs_evp_kem_encaps_keyslot(void *vpkemctx, unsigned char *ct, static int oqs_evp_kem_decaps_keyslot(void *vpkemctx, unsigned char *secret, size_t *secretlen, const unsigned char *ct, size_t ctlen, - int keyslot) -{ + int keyslot) { OQS_KEM_PRINTF("OQS KEM provider called: oqs_hyb_kem_decaps\n"); int ret = OQS_SUCCESS, ret2 = 0; @@ -152,8 +150,7 @@ static int oqs_evp_kem_decaps_keyslot(void *vpkemctx, unsigned char *secret, /// Hybrid KEM functions static int oqs_hyb_kem_encaps(void *vpkemctx, unsigned char *ct, size_t *ctlen, - unsigned char *secret, size_t *secretlen) -{ + unsigned char *secret, size_t *secretlen) { int ret = OQS_SUCCESS; const PROV_OQSKEM_CTX *pkemctx = (PROV_OQSKEM_CTX *)vpkemctx; size_t secretLen0 = 0, secretLen1 = 0; @@ -195,8 +192,7 @@ static int oqs_hyb_kem_encaps(void *vpkemctx, unsigned char *ct, size_t *ctlen, static int oqs_hyb_kem_decaps(void *vpkemctx, unsigned char *secret, size_t *secretlen, const unsigned char *ct, - size_t ctlen) -{ + size_t ctlen) { int ret = OQS_SUCCESS; const PROV_OQSKEM_CTX *pkemctx = (PROV_OQSKEM_CTX *)vpkemctx; const OQSX_EVP_CTX *evp_ctx = pkemctx->kem->oqsx_provider_ctx.oqsx_evp_ctx; diff --git a/oqsprov/oqs_kem.c b/oqsprov/oqs_kem.c index a1e27b4d..c7f4689e 100644 --- a/oqsprov/oqs_kem.c +++ b/oqsprov/oqs_kem.c @@ -19,19 +19,19 @@ #include #ifdef NDEBUG -# define OQS_KEM_PRINTF(a) -# define OQS_KEM_PRINTF2(a, b) -# define OQS_KEM_PRINTF3(a, b, c) +#define OQS_KEM_PRINTF(a) +#define OQS_KEM_PRINTF2(a, b) +#define OQS_KEM_PRINTF3(a, b, c) #else -# define OQS_KEM_PRINTF(a) \ - if (getenv("OQSKEM")) \ - printf(a) -# define OQS_KEM_PRINTF2(a, b) \ - if (getenv("OQSKEM")) \ - printf(a, b) -# define OQS_KEM_PRINTF3(a, b, c) \ - if (getenv("OQSKEM")) \ - printf(a, b, c) +#define OQS_KEM_PRINTF(a) \ + if (getenv("OQSKEM")) \ + printf(a) +#define OQS_KEM_PRINTF2(a, b) \ + if (getenv("OQSKEM")) \ + printf(a, b) +#define OQS_KEM_PRINTF3(a, b, c) \ + if (getenv("OQSKEM")) \ + printf(a, b, c) #endif // NDEBUG static OSSL_FUNC_kem_newctx_fn oqs_kem_newctx; @@ -50,8 +50,7 @@ typedef struct { /// Common KEM functions -static void *oqs_kem_newctx(void *provctx) -{ +static void *oqs_kem_newctx(void *provctx) { PROV_OQSKEM_CTX *pkemctx = OPENSSL_zalloc(sizeof(PROV_OQSKEM_CTX)); OQS_KEM_PRINTF("OQS KEM provider called: newctx\n"); @@ -63,8 +62,7 @@ static void *oqs_kem_newctx(void *provctx) return pkemctx; } -static void oqs_kem_freectx(void *vpkemctx) -{ +static void oqs_kem_freectx(void *vpkemctx) { PROV_OQSKEM_CTX *pkemctx = (PROV_OQSKEM_CTX *)vpkemctx; OQS_KEM_PRINTF("OQS KEM provider called: freectx\n"); @@ -72,8 +70,8 @@ static void oqs_kem_freectx(void *vpkemctx) OPENSSL_free(pkemctx); } -static int oqs_kem_decapsencaps_init(void *vpkemctx, void *vkem, int operation) -{ +static int oqs_kem_decapsencaps_init(void *vpkemctx, void *vkem, + int operation) { PROV_OQSKEM_CTX *pkemctx = (PROV_OQSKEM_CTX *)vpkemctx; OQS_KEM_PRINTF3("OQS KEM provider called: _init : New: %p; old: %p \n", @@ -87,15 +85,13 @@ static int oqs_kem_decapsencaps_init(void *vpkemctx, void *vkem, int operation) } static int oqs_kem_encaps_init(void *vpkemctx, void *vkem, - const OSSL_PARAM params[]) -{ + const OSSL_PARAM params[]) { OQS_KEM_PRINTF("OQS KEM provider called: encaps_init\n"); return oqs_kem_decapsencaps_init(vpkemctx, vkem, EVP_PKEY_OP_ENCAPSULATE); } static int oqs_kem_decaps_init(void *vpkemctx, void *vkem, - const OSSL_PARAM params[]) -{ + const OSSL_PARAM params[]) { OQS_KEM_PRINTF("OQS KEM provider called: decaps_init\n"); return oqs_kem_decapsencaps_init(vpkemctx, vkem, EVP_PKEY_OP_DECAPSULATE); } @@ -104,8 +100,7 @@ static int oqs_kem_decaps_init(void *vpkemctx, void *vkem, static int oqs_qs_kem_encaps_keyslot(void *vpkemctx, unsigned char *out, size_t *outlen, unsigned char *secret, - size_t *secretlen, int keyslot) -{ + size_t *secretlen, int keyslot) { const PROV_OQSKEM_CTX *pkemctx = (PROV_OQSKEM_CTX *)vpkemctx; const OQS_KEM *kem_ctx = pkemctx->kem->oqsx_provider_ctx.oqsx_qs_ctx.kem; @@ -114,8 +109,8 @@ static int oqs_qs_kem_encaps_keyslot(void *vpkemctx, unsigned char *out, OQS_KEM_PRINTF("OQS Warning: OQS_KEM not initialized\n"); return -1; } - if (pkemctx->kem->comp_pubkey == NULL - || pkemctx->kem->comp_pubkey[keyslot] == NULL) { + if (pkemctx->kem->comp_pubkey == NULL || + pkemctx->kem->comp_pubkey[keyslot] == NULL) { OQS_KEM_PRINTF("OQS Warning: public key is NULL\n"); return -1; } @@ -150,15 +145,13 @@ static int oqs_qs_kem_encaps_keyslot(void *vpkemctx, unsigned char *out, *outlen = kem_ctx->length_ciphertext; *secretlen = kem_ctx->length_shared_secret; - return OQS_SUCCESS - == OQS_KEM_encaps(kem_ctx, out, secret, - pkemctx->kem->comp_pubkey[keyslot]); + return OQS_SUCCESS == OQS_KEM_encaps(kem_ctx, out, secret, + pkemctx->kem->comp_pubkey[keyslot]); } static int oqs_qs_kem_decaps_keyslot(void *vpkemctx, unsigned char *out, size_t *outlen, const unsigned char *in, - size_t inlen, int keyslot) -{ + size_t inlen, int keyslot) { const PROV_OQSKEM_CTX *pkemctx = (PROV_OQSKEM_CTX *)vpkemctx; const OQS_KEM *kem_ctx = pkemctx->kem->oqsx_provider_ctx.oqsx_qs_ctx.kem; @@ -167,8 +160,8 @@ static int oqs_qs_kem_decaps_keyslot(void *vpkemctx, unsigned char *out, OQS_KEM_PRINTF("OQS Warning: OQS_KEM not initialized\n"); return -1; } - if (pkemctx->kem->comp_privkey == NULL - || pkemctx->kem->comp_privkey[keyslot] == NULL) { + if (pkemctx->kem->comp_privkey == NULL || + pkemctx->kem->comp_privkey[keyslot] == NULL) { OQS_KEM_PRINTF("OQS Warning: private key is NULL\n"); return -1; } @@ -198,21 +191,18 @@ static int oqs_qs_kem_decaps_keyslot(void *vpkemctx, unsigned char *out, } *outlen = kem_ctx->length_shared_secret; - return OQS_SUCCESS - == OQS_KEM_decaps(kem_ctx, out, in, - pkemctx->kem->comp_privkey[keyslot]); + return OQS_SUCCESS == OQS_KEM_decaps(kem_ctx, out, in, + pkemctx->kem->comp_privkey[keyslot]); } static int oqs_qs_kem_encaps(void *vpkemctx, unsigned char *out, size_t *outlen, - unsigned char *secret, size_t *secretlen) -{ + unsigned char *secret, size_t *secretlen) { return oqs_qs_kem_encaps_keyslot(vpkemctx, out, outlen, secret, secretlen, 0); } static int oqs_qs_kem_decaps(void *vpkemctx, unsigned char *out, size_t *outlen, - const unsigned char *in, size_t inlen) -{ + const unsigned char *in, size_t inlen) { return oqs_qs_kem_decaps_keyslot(vpkemctx, out, outlen, in, inlen, 0); } diff --git a/oqsprov/oqs_kmgmt.c b/oqsprov/oqs_kmgmt.c index 42c3967d..7f08f63b 100644 --- a/oqsprov/oqs_kmgmt.c +++ b/oqsprov/oqs_kmgmt.c @@ -26,8 +26,7 @@ int oqsx_param_build_set_octet_string(OSSL_PARAM_BLD *bld, OSSL_PARAM *p, const char *key, const unsigned char *data, - size_t data_len) -{ + size_t data_len) { if (bld != NULL) return OSSL_PARAM_BLD_push_octet_string(bld, key, data, data_len); @@ -38,19 +37,19 @@ int oqsx_param_build_set_octet_string(OSSL_PARAM_BLD *bld, OSSL_PARAM *p, } #ifdef NDEBUG -# define OQS_KM_PRINTF(a) -# define OQS_KM_PRINTF2(a, b) -# define OQS_KM_PRINTF3(a, b, c) +#define OQS_KM_PRINTF(a) +#define OQS_KM_PRINTF2(a, b) +#define OQS_KM_PRINTF3(a, b, c) #else -# define OQS_KM_PRINTF(a) \ - if (getenv("OQSKM")) \ - printf(a) -# define OQS_KM_PRINTF2(a, b) \ - if (getenv("OQSKM")) \ - printf(a, b) -# define OQS_KM_PRINTF3(a, b, c) \ - if (getenv("OQSKM")) \ - printf(a, b, c) +#define OQS_KM_PRINTF(a) \ + if (getenv("OQSKM")) \ + printf(a) +#define OQS_KM_PRINTF2(a, b) \ + if (getenv("OQSKM")) \ + printf(a, b) +#define OQS_KM_PRINTF3(a, b, c) \ + if (getenv("OQSKM")) \ + printf(a, b, c) #endif // NDEBUG // our own error codes: @@ -81,8 +80,7 @@ struct oqsx_gen_ctx { int alg_idx; }; -static int oqsx_has(const void *keydata, int selection) -{ +static int oqsx_has(const void *keydata, int selection) { const OQSX_KEY *key = keydata; int ok = 0; @@ -124,8 +122,8 @@ static int oqsx_has(const void *keydata, int selection) * a role in OQS, so we consider them as a proxy for private key matching. */ -static int oqsx_match(const void *keydata1, const void *keydata2, int selection) -{ +static int oqsx_match(const void *keydata1, const void *keydata2, + int selection) { const OQSX_KEY *key1 = keydata1; const OQSX_KEY *key2 = keydata2; int ok = 1; @@ -147,53 +145,49 @@ static int oqsx_match(const void *keydata1, const void *keydata2, int selection) * at least the key type name matches. Potential actual key mismatches will * only be discovered later. */ - if (((selection & OSSL_KEYMGMT_SELECT_PRIVATE_KEY) != 0) - && ((selection & OSSL_KEYMGMT_SELECT_PUBLIC_KEY) != 0)) { - if ((key1->privkey == NULL && key2->pubkey == NULL) - || (key1->pubkey == NULL && key2->privkey == NULL) - || ((key1->tls_name != NULL && key2->tls_name != NULL) - && !strcmp(key1->tls_name, key2->tls_name))) { + if (((selection & OSSL_KEYMGMT_SELECT_PRIVATE_KEY) != 0) && + ((selection & OSSL_KEYMGMT_SELECT_PUBLIC_KEY) != 0)) { + if ((key1->privkey == NULL && key2->pubkey == NULL) || + (key1->pubkey == NULL && key2->privkey == NULL) || + ((key1->tls_name != NULL && key2->tls_name != NULL) && + !strcmp(key1->tls_name, key2->tls_name))) { OQS_KM_PRINTF("OQSKEYMGMT: leap-of-faith match\n"); return 1; } } #endif - if (((selection & OSSL_KEYMGMT_SELECT_PRIVATE_KEY) != 0) - && ((selection & OSSL_KEYMGMT_SELECT_PUBLIC_KEY) == 0)) { - if ((key1->privkey == NULL && key2->privkey != NULL) - || (key1->privkey != NULL && key2->privkey == NULL) - || ((key1->tls_name != NULL && key2->tls_name != NULL) - && strcmp(key1->tls_name, key2->tls_name))) { + if (((selection & OSSL_KEYMGMT_SELECT_PRIVATE_KEY) != 0) && + ((selection & OSSL_KEYMGMT_SELECT_PUBLIC_KEY) == 0)) { + if ((key1->privkey == NULL && key2->privkey != NULL) || + (key1->privkey != NULL && key2->privkey == NULL) || + ((key1->tls_name != NULL && key2->tls_name != NULL) && + strcmp(key1->tls_name, key2->tls_name))) { ok = 0; } else { - ok = ((key1->privkey == NULL && key2->privkey == NULL) - || ((key1->privkey != NULL) - && CRYPTO_memcmp(key1->privkey, key2->privkey, - key1->privkeylen) - == 0)); + ok = ((key1->privkey == NULL && key2->privkey == NULL) || + ((key1->privkey != NULL) && + CRYPTO_memcmp(key1->privkey, key2->privkey, + key1->privkeylen) == 0)); } } if ((selection & OSSL_KEYMGMT_SELECT_PUBLIC_KEY) != 0) { - if ((key1->pubkey == NULL && key2->pubkey != NULL) - || (key1->pubkey != NULL && key2->pubkey == NULL) - || ((key1->tls_name != NULL && key2->tls_name != NULL) - && strcmp(key1->tls_name, key2->tls_name))) { + if ((key1->pubkey == NULL && key2->pubkey != NULL) || + (key1->pubkey != NULL && key2->pubkey == NULL) || + ((key1->tls_name != NULL && key2->tls_name != NULL) && + strcmp(key1->tls_name, key2->tls_name))) { // special case now: If domain parameter matching requested, // consider private key match sufficient: - ok = ((selection & OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS) != 0) - && (key1->privkey != NULL && key2->privkey != NULL) - && (CRYPTO_memcmp(key1->privkey, key2->privkey, - key1->privkeylen) - == 0); + ok = ((selection & OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS) != 0) && + (key1->privkey != NULL && key2->privkey != NULL) && + (CRYPTO_memcmp(key1->privkey, key2->privkey, + key1->privkeylen) == 0); } else { - ok = ok - && ((key1->pubkey == NULL && key2->pubkey == NULL) - || ((key1->pubkey != NULL) - && CRYPTO_memcmp(key1->pubkey, key2->pubkey, - key1->pubkeylen) - == 0)); + ok = ok && ((key1->pubkey == NULL && key2->pubkey == NULL) || + ((key1->pubkey != NULL) && + CRYPTO_memcmp(key1->pubkey, key2->pubkey, + key1->pubkeylen) == 0)); } } if (!ok) @@ -201,8 +195,8 @@ static int oqsx_match(const void *keydata1, const void *keydata2, int selection) return ok; } -static int oqsx_import(void *keydata, int selection, const OSSL_PARAM params[]) -{ +static int oqsx_import(void *keydata, int selection, + const OSSL_PARAM params[]) { OQSX_KEY *key = keydata; int ok = 0; @@ -212,15 +206,14 @@ static int oqsx_import(void *keydata, int selection, const OSSL_PARAM params[]) return ok; } - if (((selection & OSSL_KEYMGMT_SELECT_ALL_PARAMETERS) != 0) - && (oqsx_key_fromdata(key, params, 1))) + if (((selection & OSSL_KEYMGMT_SELECT_ALL_PARAMETERS) != 0) && + (oqsx_key_fromdata(key, params, 1))) ok = 1; return ok; } int oqsx_key_to_params(const OQSX_KEY *key, OSSL_PARAM_BLD *tmpl, - OSSL_PARAM params[], int include_private) -{ + OSSL_PARAM params[], int include_private) { int ret = 0; if (key == NULL) @@ -234,10 +227,9 @@ int oqsx_key_to_params(const OQSX_KEY *key, OSSL_PARAM_BLD *tmpl, } if (p != NULL || tmpl != NULL) { - if (key->pubkeylen == 0 - || !oqsx_param_build_set_octet_string( - tmpl, p, OSSL_PKEY_PARAM_PUB_KEY, key->pubkey, - key->pubkeylen)) + if (key->pubkeylen == 0 || !oqsx_param_build_set_octet_string( + tmpl, p, OSSL_PKEY_PARAM_PUB_KEY, + key->pubkey, key->pubkeylen)) goto err; } } @@ -256,10 +248,9 @@ int oqsx_key_to_params(const OQSX_KEY *key, OSSL_PARAM_BLD *tmpl, } if (p != NULL || tmpl != NULL) { - if (key->privkeylen == 0 - || !oqsx_param_build_set_octet_string( - tmpl, p, OSSL_PKEY_PARAM_PRIV_KEY, key->privkey, - key->privkeylen)) + if (key->privkeylen == 0 || !oqsx_param_build_set_octet_string( + tmpl, p, OSSL_PKEY_PARAM_PRIV_KEY, + key->privkey, key->privkeylen)) goto err; } } @@ -270,8 +261,7 @@ int oqsx_key_to_params(const OQSX_KEY *key, OSSL_PARAM_BLD *tmpl, } static int oqsx_export(void *keydata, int selection, OSSL_CALLBACK *param_cb, - void *cbarg) -{ + void *cbarg) { OQSX_KEY *key = keydata; OSSL_PARAM_BLD *tmpl; OSSL_PARAM *params = NULL; @@ -296,8 +286,8 @@ static int oqsx_export(void *keydata, int selection, OSSL_CALLBACK *param_cb, } if ((selection & OSSL_KEYMGMT_SELECT_KEYPAIR) != 0) { - int include_private - = selection & OSSL_KEYMGMT_SELECT_PRIVATE_KEY ? 1 : 0; + int include_private = + selection & OSSL_KEYMGMT_SELECT_PRIVATE_KEY ? 1 : 0; ok = ok && oqsx_key_to_params(key, tmpl, NULL, include_private); } @@ -322,14 +312,13 @@ static int oqsx_export(void *keydata, int selection, OSSL_CALLBACK *param_cb, OSSL_PARAM_octet_string(OQS_HYBRID_PKEY_PARAM_PQ_PUB_KEY, NULL, 0), \ OSSL_PARAM_octet_string(OQS_HYBRID_PKEY_PARAM_PQ_PRIV_KEY, NULL, 0) -#define OQS_KEY_TYPES() \ - OSSL_PARAM_octet_string(OSSL_PKEY_PARAM_PUB_KEY, NULL, 0), \ - OSSL_PARAM_octet_string(OSSL_PKEY_PARAM_PRIV_KEY, NULL, 0), \ +#define OQS_KEY_TYPES() \ + OSSL_PARAM_octet_string(OSSL_PKEY_PARAM_PUB_KEY, NULL, 0), \ + OSSL_PARAM_octet_string(OSSL_PKEY_PARAM_PRIV_KEY, NULL, 0), \ OQS_HYBRID_KEY_TYPES() static const OSSL_PARAM oqsx_key_types[] = {OQS_KEY_TYPES(), OSSL_PARAM_END}; -static const OSSL_PARAM *oqs_imexport_types(int selection) -{ +static const OSSL_PARAM *oqs_imexport_types(int selection) { OQS_KM_PRINTF("OQSKEYMGMT: imexport called\n"); if ((selection & OSSL_KEYMGMT_SELECT_KEYPAIR) != 0) return oqsx_key_types; @@ -340,12 +329,11 @@ static const OSSL_PARAM *oqs_imexport_types(int selection) // hybrid algorithm. // // Returns 1 if hybrid, else 0. -static int oqsx_key_is_hybrid(const OQSX_KEY *oqsxk) -{ - if ((oqsxk->keytype == KEY_TYPE_ECP_HYB_KEM - || oqsxk->keytype == KEY_TYPE_ECX_HYB_KEM - || oqsxk->keytype == KEY_TYPE_HYB_SIG) - && oqsxk->numkeys == 2 && oqsxk->classical_pkey != NULL) { +static int oqsx_key_is_hybrid(const OQSX_KEY *oqsxk) { + if ((oqsxk->keytype == KEY_TYPE_ECP_HYB_KEM || + oqsxk->keytype == KEY_TYPE_ECX_HYB_KEM || + oqsxk->keytype == KEY_TYPE_HYB_SIG) && + oqsxk->numkeys == 2 && oqsxk->classical_pkey != NULL) { OQS_KM_PRINTF("OQSKEYMGMT: key is hybrid\n"); return 1; } @@ -357,8 +345,7 @@ static int oqsx_key_is_hybrid(const OQSX_KEY *oqsxk) // Gets hybrid params. // // Returns 0 on success. -static int oqsx_get_hybrid_params(OQSX_KEY *key, OSSL_PARAM params[]) -{ +static int oqsx_get_hybrid_params(OQSX_KEY *key, OSSL_PARAM params[]) { OSSL_PARAM *p; const void *classical_pubkey = NULL; const void *classical_privkey = NULL; @@ -394,36 +381,33 @@ static int oqsx_get_hybrid_params(OQSX_KEY *key, OSSL_PARAM params[]) } if (key->comp_privkey != NULL) { pq_privkey = key->comp_privkey[1]; - pq_privkey_len - = key->privkeylen - classical_privkey_len - SIZE_OF_UINT32; + pq_privkey_len = + key->privkeylen - classical_privkey_len - SIZE_OF_UINT32; } - if ((p = OSSL_PARAM_locate(params, OQS_HYBRID_PKEY_PARAM_CLASSICAL_PUB_KEY)) - != NULL - && !OSSL_PARAM_set_octet_string(p, classical_pubkey, - classical_pubkey_len)) + if ((p = OSSL_PARAM_locate( + params, OQS_HYBRID_PKEY_PARAM_CLASSICAL_PUB_KEY)) != NULL && + !OSSL_PARAM_set_octet_string(p, classical_pubkey, classical_pubkey_len)) return -1; - if ((p - = OSSL_PARAM_locate(params, OQS_HYBRID_PKEY_PARAM_CLASSICAL_PRIV_KEY)) - != NULL - && !OSSL_PARAM_set_octet_string(p, classical_privkey, - classical_privkey_len)) + if ((p = OSSL_PARAM_locate( + params, OQS_HYBRID_PKEY_PARAM_CLASSICAL_PRIV_KEY)) != NULL && + !OSSL_PARAM_set_octet_string(p, classical_privkey, + classical_privkey_len)) return -1; - if ((p = OSSL_PARAM_locate(params, OQS_HYBRID_PKEY_PARAM_PQ_PUB_KEY)) - != NULL - && !OSSL_PARAM_set_octet_string(p, pq_pubkey, pq_pubkey_len)) + if ((p = OSSL_PARAM_locate(params, OQS_HYBRID_PKEY_PARAM_PQ_PUB_KEY)) != + NULL && + !OSSL_PARAM_set_octet_string(p, pq_pubkey, pq_pubkey_len)) return -1; - if ((p = OSSL_PARAM_locate(params, OQS_HYBRID_PKEY_PARAM_PQ_PRIV_KEY)) - != NULL - && !OSSL_PARAM_set_octet_string(p, pq_privkey, pq_privkey_len)) + if ((p = OSSL_PARAM_locate(params, OQS_HYBRID_PKEY_PARAM_PQ_PRIV_KEY)) != + NULL && + !OSSL_PARAM_set_octet_string(p, pq_privkey, pq_privkey_len)) return -1; return 0; } // must handle param requests for KEM and SIG keys... -static int oqsx_get_params(void *key, OSSL_PARAM params[]) -{ +static int oqsx_get_params(void *key, OSSL_PARAM params[]) { OQSX_KEY *oqsxk = key; OSSL_PARAM *p; @@ -433,32 +417,34 @@ static int oqsx_get_params(void *key, OSSL_PARAM params[]) } OQS_KM_PRINTF2("OQSKEYMGMT: get_params called for %s\n", params[0].key); - if ((p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_BITS)) != NULL - && !OSSL_PARAM_set_int(p, oqsx_key_secbits(oqsxk))) + if ((p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_BITS)) != NULL && + !OSSL_PARAM_set_int(p, oqsx_key_secbits(oqsxk))) return 0; - if ((p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_SECURITY_BITS)) != NULL - && !OSSL_PARAM_set_int(p, oqsx_key_secbits(oqsxk))) + if ((p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_SECURITY_BITS)) != + NULL && + !OSSL_PARAM_set_int(p, oqsx_key_secbits(oqsxk))) return 0; - if ((p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_MAX_SIZE)) != NULL - && !OSSL_PARAM_set_int(p, oqsx_key_maxsize(oqsxk))) + if ((p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_MAX_SIZE)) != NULL && + !OSSL_PARAM_set_int(p, oqsx_key_maxsize(oqsxk))) return 0; /* add as temporary workaround TBC */ - if ((p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_DEFAULT_DIGEST)) != NULL - && !OSSL_PARAM_set_utf8_string(p, SN_undef)) + if ((p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_DEFAULT_DIGEST)) != + NULL && + !OSSL_PARAM_set_utf8_string(p, SN_undef)) return 0; - if ((p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_MANDATORY_DIGEST)) - != NULL - && !OSSL_PARAM_set_utf8_string(p, SN_undef)) + if ((p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_MANDATORY_DIGEST)) != + NULL && + !OSSL_PARAM_set_utf8_string(p, SN_undef)) return 0; /* end workaround */ - if ((p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_ENCODED_PUBLIC_KEY)) - != NULL) { + if ((p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_ENCODED_PUBLIC_KEY)) != + NULL) { // hybrid KEMs are special in that the classic length information shall // not be passed out: - if (oqsxk->keytype == KEY_TYPE_ECP_HYB_KEM - || oqsxk->keytype == KEY_TYPE_ECX_HYB_KEM) { + if (oqsxk->keytype == KEY_TYPE_ECP_HYB_KEM || + oqsxk->keytype == KEY_TYPE_ECX_HYB_KEM) { if (!OSSL_PARAM_set_octet_string( p, (char *)oqsxk->pubkey + SIZE_OF_UINT32, oqsxk->pubkeylen - SIZE_OF_UINT32)) @@ -485,22 +471,20 @@ static int oqsx_get_params(void *key, OSSL_PARAM params[]) return 1; } -static const OSSL_PARAM oqsx_gettable_params[] - = {OSSL_PARAM_int(OSSL_PKEY_PARAM_BITS, NULL), - OSSL_PARAM_int(OSSL_PKEY_PARAM_SECURITY_BITS, NULL), - OSSL_PARAM_int(OSSL_PKEY_PARAM_MAX_SIZE, NULL), - OSSL_PARAM_octet_string(OSSL_PKEY_PARAM_ENCODED_PUBLIC_KEY, NULL, 0), - OQS_KEY_TYPES(), - OSSL_PARAM_END}; +static const OSSL_PARAM oqsx_gettable_params[] = { + OSSL_PARAM_int(OSSL_PKEY_PARAM_BITS, NULL), + OSSL_PARAM_int(OSSL_PKEY_PARAM_SECURITY_BITS, NULL), + OSSL_PARAM_int(OSSL_PKEY_PARAM_MAX_SIZE, NULL), + OSSL_PARAM_octet_string(OSSL_PKEY_PARAM_ENCODED_PUBLIC_KEY, NULL, 0), + OQS_KEY_TYPES(), + OSSL_PARAM_END}; -static const OSSL_PARAM *oqs_gettable_params(void *provctx) -{ +static const OSSL_PARAM *oqs_gettable_params(void *provctx) { OQS_KM_PRINTF("OQSKEYMGMT: gettable_params called\n"); return oqsx_gettable_params; } -static int set_property_query(OQSX_KEY *oqsxkey, const char *propq) -{ +static int set_property_query(OQSX_KEY *oqsxkey, const char *propq) { OPENSSL_free(oqsxkey->propq); oqsxkey->propq = NULL; OQS_KM_PRINTF("OQSKEYMGMT: property_query called\n"); @@ -514,8 +498,7 @@ static int set_property_query(OQSX_KEY *oqsxkey, const char *propq) return 1; } -static int oqsx_set_params(void *key, const OSSL_PARAM params[]) -{ +static int oqsx_set_params(void *key, const OSSL_PARAM params[]) { OQSX_KEY *oqsxkey = key; const OSSL_PARAM *p; @@ -528,20 +511,20 @@ static int oqsx_set_params(void *key, const OSSL_PARAM params[]) if (p != NULL) { size_t used_len; int classic_pubkey_len; - if (oqsxkey->keytype == KEY_TYPE_ECP_HYB_KEM - || oqsxkey->keytype == KEY_TYPE_ECX_HYB_KEM) { + if (oqsxkey->keytype == KEY_TYPE_ECP_HYB_KEM || + oqsxkey->keytype == KEY_TYPE_ECX_HYB_KEM) { // classic key len already stored by key setup; only data needs to // be filled in - if (p->data_size != oqsxkey->pubkeylen - SIZE_OF_UINT32 - || !OSSL_PARAM_get_octet_string( + if (p->data_size != oqsxkey->pubkeylen - SIZE_OF_UINT32 || + !OSSL_PARAM_get_octet_string( p, &oqsxkey->comp_pubkey[0], oqsxkey->pubkeylen - SIZE_OF_UINT32, &used_len)) { return 0; } } else { - if (p->data_size != oqsxkey->pubkeylen - || !OSSL_PARAM_get_octet_string( - p, &oqsxkey->pubkey, oqsxkey->pubkeylen, &used_len)) { + if (p->data_size != oqsxkey->pubkeylen || + !OSSL_PARAM_get_octet_string(p, &oqsxkey->pubkey, + oqsxkey->pubkeylen, &used_len)) { return 0; } } @@ -550,8 +533,8 @@ static int oqsx_set_params(void *key, const OSSL_PARAM params[]) } p = OSSL_PARAM_locate_const(params, OSSL_PKEY_PARAM_PROPERTIES); if (p != NULL) { - if (p->data_type != OSSL_PARAM_UTF8_STRING - || !set_property_query(oqsxkey, p->data)) { + if (p->data_type != OSSL_PARAM_UTF8_STRING || + !set_property_query(oqsxkey, p->data)) { return 0; } } @@ -560,21 +543,19 @@ static int oqsx_set_params(void *key, const OSSL_PARAM params[]) return 1; } -static const OSSL_PARAM oqs_settable_params[] - = {OSSL_PARAM_octet_string(OSSL_PKEY_PARAM_ENCODED_PUBLIC_KEY, NULL, 0), - OSSL_PARAM_utf8_string(OSSL_PKEY_PARAM_PROPERTIES, NULL, 0), - OSSL_PARAM_END}; +static const OSSL_PARAM oqs_settable_params[] = { + OSSL_PARAM_octet_string(OSSL_PKEY_PARAM_ENCODED_PUBLIC_KEY, NULL, 0), + OSSL_PARAM_utf8_string(OSSL_PKEY_PARAM_PROPERTIES, NULL, 0), + OSSL_PARAM_END}; -static const OSSL_PARAM *oqsx_settable_params(void *provctx) -{ +static const OSSL_PARAM *oqsx_settable_params(void *provctx) { OQS_KM_PRINTF("OQSKEYMGMT: settable_params called\n"); return oqs_settable_params; } static void *oqsx_gen_init(void *provctx, int selection, char *oqs_name, char *tls_name, int primitive, int bit_security, - int alg_idx) -{ + int alg_idx) { OSSL_LIB_CTX *libctx = PROV_OQS_LIBCTX_OF(provctx); struct oqsx_gen_ctx *gctx = NULL; @@ -593,8 +574,7 @@ static void *oqsx_gen_init(void *provctx, int selection, char *oqs_name, return gctx; } -static void *oqsx_genkey(struct oqsx_gen_ctx *gctx) -{ +static void *oqsx_genkey(struct oqsx_gen_ctx *gctx) { OQSX_KEY *key; if (gctx == NULL) @@ -603,8 +583,7 @@ static void *oqsx_genkey(struct oqsx_gen_ctx *gctx) gctx->tls_name); if ((key = oqsx_key_new(gctx->libctx, gctx->oqs_name, gctx->tls_name, gctx->primitive, gctx->propq, gctx->bit_security, - gctx->alg_idx)) - == NULL) { + gctx->alg_idx)) == NULL) { OQS_KM_PRINTF2("OQSKM: Error generating key for %s\n", gctx->tls_name); ERR_raise(ERR_LIB_USER, ERR_R_MALLOC_FAILURE); return NULL; @@ -617,8 +596,7 @@ static void *oqsx_genkey(struct oqsx_gen_ctx *gctx) return key; } -static void *oqsx_gen(void *genctx, OSSL_CALLBACK *osslcb, void *cbarg) -{ +static void *oqsx_gen(void *genctx, OSSL_CALLBACK *osslcb, void *cbarg) { struct oqsx_gen_ctx *gctx = genctx; OQS_KM_PRINTF("OQSKEYMGMT: gen called\n"); @@ -626,8 +604,7 @@ static void *oqsx_gen(void *genctx, OSSL_CALLBACK *osslcb, void *cbarg) return oqsx_genkey(gctx); } -static void oqsx_gen_cleanup(void *genctx) -{ +static void oqsx_gen_cleanup(void *genctx) { struct oqsx_gen_ctx *gctx = genctx; OQS_KM_PRINTF("OQSKEYMGMT: gen_cleanup called\n"); @@ -637,8 +614,7 @@ static void oqsx_gen_cleanup(void *genctx) OPENSSL_free(gctx); } -void *oqsx_load(const void *reference, size_t reference_sz) -{ +void *oqsx_load(const void *reference, size_t reference_sz) { OQSX_KEY *key = NULL; OQS_KM_PRINTF("OQSKEYMGMT: load called\n"); @@ -652,17 +628,15 @@ void *oqsx_load(const void *reference, size_t reference_sz) return NULL; } -static const OSSL_PARAM *oqsx_gen_settable_params(void *provctx) -{ - static OSSL_PARAM settable[] - = {OSSL_PARAM_utf8_string(OSSL_PKEY_PARAM_GROUP_NAME, NULL, 0), - OSSL_PARAM_utf8_string(OSSL_KDF_PARAM_PROPERTIES, NULL, 0), - OSSL_PARAM_END}; +static const OSSL_PARAM *oqsx_gen_settable_params(void *provctx) { + static OSSL_PARAM settable[] = { + OSSL_PARAM_utf8_string(OSSL_PKEY_PARAM_GROUP_NAME, NULL, 0), + OSSL_PARAM_utf8_string(OSSL_KDF_PARAM_PROPERTIES, NULL, 0), + OSSL_PARAM_END}; return settable; } -static int oqsx_gen_set_params(void *genctx, const OSSL_PARAM params[]) -{ +static int oqsx_gen_set_params(void *genctx, const OSSL_PARAM params[]) { struct oqsx_gen_ctx *gctx = genctx; const OSSL_PARAM *p; @@ -691,607 +665,635 @@ static int oqsx_gen_set_params(void *genctx, const OSSL_PARAM params[]) } ///// OQS_TEMPLATE_FRAGMENT_KEYMGMT_CONSTRUCTORS_START -static void *dilithium2_new_key(void *provctx) -{ - return oqsx_key_new(PROV_OQS_LIBCTX_OF(provctx), OQS_SIG_alg_dilithium_2, "dilithium2", KEY_TYPE_SIG, NULL, 128, 0); +static void *dilithium2_new_key(void *provctx) { + return oqsx_key_new(PROV_OQS_LIBCTX_OF(provctx), OQS_SIG_alg_dilithium_2, + "dilithium2", KEY_TYPE_SIG, NULL, 128, 0); } -static void *dilithium2_gen_init(void *provctx, int selection) -{ - return oqsx_gen_init(provctx, selection, OQS_SIG_alg_dilithium_2, "dilithium2", 0, 128, 0); +static void *dilithium2_gen_init(void *provctx, int selection) { + return oqsx_gen_init(provctx, selection, OQS_SIG_alg_dilithium_2, + "dilithium2", 0, 128, 0); } -static void *p256_dilithium2_new_key(void *provctx) -{ - return oqsx_key_new(PROV_OQS_LIBCTX_OF(provctx), OQS_SIG_alg_dilithium_2, "p256_dilithium2", KEY_TYPE_HYB_SIG, NULL, 128, 1); +static void *p256_dilithium2_new_key(void *provctx) { + return oqsx_key_new(PROV_OQS_LIBCTX_OF(provctx), OQS_SIG_alg_dilithium_2, + "p256_dilithium2", KEY_TYPE_HYB_SIG, NULL, 128, 1); } -static void *p256_dilithium2_gen_init(void *provctx, int selection) -{ - return oqsx_gen_init(provctx, selection, OQS_SIG_alg_dilithium_2, "p256_dilithium2", KEY_TYPE_HYB_SIG, 128, 1); +static void *p256_dilithium2_gen_init(void *provctx, int selection) { + return oqsx_gen_init(provctx, selection, OQS_SIG_alg_dilithium_2, + "p256_dilithium2", KEY_TYPE_HYB_SIG, 128, 1); } -static void *rsa3072_dilithium2_new_key(void *provctx) -{ - return oqsx_key_new(PROV_OQS_LIBCTX_OF(provctx), OQS_SIG_alg_dilithium_2, "rsa3072_dilithium2", KEY_TYPE_HYB_SIG, NULL, 128, 2); +static void *rsa3072_dilithium2_new_key(void *provctx) { + return oqsx_key_new(PROV_OQS_LIBCTX_OF(provctx), OQS_SIG_alg_dilithium_2, + "rsa3072_dilithium2", KEY_TYPE_HYB_SIG, NULL, 128, 2); } -static void *rsa3072_dilithium2_gen_init(void *provctx, int selection) -{ - return oqsx_gen_init(provctx, selection, OQS_SIG_alg_dilithium_2, "rsa3072_dilithium2", KEY_TYPE_HYB_SIG, 128, 2); +static void *rsa3072_dilithium2_gen_init(void *provctx, int selection) { + return oqsx_gen_init(provctx, selection, OQS_SIG_alg_dilithium_2, + "rsa3072_dilithium2", KEY_TYPE_HYB_SIG, 128, 2); } -static void *dilithium3_new_key(void *provctx) -{ - return oqsx_key_new(PROV_OQS_LIBCTX_OF(provctx), OQS_SIG_alg_dilithium_3, "dilithium3", KEY_TYPE_SIG, NULL, 192, 3); +static void *dilithium3_new_key(void *provctx) { + return oqsx_key_new(PROV_OQS_LIBCTX_OF(provctx), OQS_SIG_alg_dilithium_3, + "dilithium3", KEY_TYPE_SIG, NULL, 192, 3); } -static void *dilithium3_gen_init(void *provctx, int selection) -{ - return oqsx_gen_init(provctx, selection, OQS_SIG_alg_dilithium_3, "dilithium3", 0, 192, 3); +static void *dilithium3_gen_init(void *provctx, int selection) { + return oqsx_gen_init(provctx, selection, OQS_SIG_alg_dilithium_3, + "dilithium3", 0, 192, 3); } -static void *p384_dilithium3_new_key(void *provctx) -{ - return oqsx_key_new(PROV_OQS_LIBCTX_OF(provctx), OQS_SIG_alg_dilithium_3, "p384_dilithium3", KEY_TYPE_HYB_SIG, NULL, 192, 4); +static void *p384_dilithium3_new_key(void *provctx) { + return oqsx_key_new(PROV_OQS_LIBCTX_OF(provctx), OQS_SIG_alg_dilithium_3, + "p384_dilithium3", KEY_TYPE_HYB_SIG, NULL, 192, 4); } -static void *p384_dilithium3_gen_init(void *provctx, int selection) -{ - return oqsx_gen_init(provctx, selection, OQS_SIG_alg_dilithium_3, "p384_dilithium3", KEY_TYPE_HYB_SIG, 192, 4); +static void *p384_dilithium3_gen_init(void *provctx, int selection) { + return oqsx_gen_init(provctx, selection, OQS_SIG_alg_dilithium_3, + "p384_dilithium3", KEY_TYPE_HYB_SIG, 192, 4); } -static void *dilithium5_new_key(void *provctx) -{ - return oqsx_key_new(PROV_OQS_LIBCTX_OF(provctx), OQS_SIG_alg_dilithium_5, "dilithium5", KEY_TYPE_SIG, NULL, 256, 5); +static void *dilithium5_new_key(void *provctx) { + return oqsx_key_new(PROV_OQS_LIBCTX_OF(provctx), OQS_SIG_alg_dilithium_5, + "dilithium5", KEY_TYPE_SIG, NULL, 256, 5); } -static void *dilithium5_gen_init(void *provctx, int selection) -{ - return oqsx_gen_init(provctx, selection, OQS_SIG_alg_dilithium_5, "dilithium5", 0, 256, 5); +static void *dilithium5_gen_init(void *provctx, int selection) { + return oqsx_gen_init(provctx, selection, OQS_SIG_alg_dilithium_5, + "dilithium5", 0, 256, 5); } -static void *p521_dilithium5_new_key(void *provctx) -{ - return oqsx_key_new(PROV_OQS_LIBCTX_OF(provctx), OQS_SIG_alg_dilithium_5, "p521_dilithium5", KEY_TYPE_HYB_SIG, NULL, 256, 6); +static void *p521_dilithium5_new_key(void *provctx) { + return oqsx_key_new(PROV_OQS_LIBCTX_OF(provctx), OQS_SIG_alg_dilithium_5, + "p521_dilithium5", KEY_TYPE_HYB_SIG, NULL, 256, 6); } -static void *p521_dilithium5_gen_init(void *provctx, int selection) -{ - return oqsx_gen_init(provctx, selection, OQS_SIG_alg_dilithium_5, "p521_dilithium5", KEY_TYPE_HYB_SIG, 256, 6); +static void *p521_dilithium5_gen_init(void *provctx, int selection) { + return oqsx_gen_init(provctx, selection, OQS_SIG_alg_dilithium_5, + "p521_dilithium5", KEY_TYPE_HYB_SIG, 256, 6); } -static void *mldsa44_new_key(void *provctx) -{ - return oqsx_key_new(PROV_OQS_LIBCTX_OF(provctx), OQS_SIG_alg_ml_dsa_44, "mldsa44", KEY_TYPE_SIG, NULL, 128, 7); +static void *mldsa44_new_key(void *provctx) { + return oqsx_key_new(PROV_OQS_LIBCTX_OF(provctx), OQS_SIG_alg_ml_dsa_44, + "mldsa44", KEY_TYPE_SIG, NULL, 128, 7); } -static void *mldsa44_gen_init(void *provctx, int selection) -{ - return oqsx_gen_init(provctx, selection, OQS_SIG_alg_ml_dsa_44, "mldsa44", 0, 128, 7); +static void *mldsa44_gen_init(void *provctx, int selection) { + return oqsx_gen_init(provctx, selection, OQS_SIG_alg_ml_dsa_44, "mldsa44", + 0, 128, 7); } -static void *p256_mldsa44_new_key(void *provctx) -{ - return oqsx_key_new(PROV_OQS_LIBCTX_OF(provctx), OQS_SIG_alg_ml_dsa_44, "p256_mldsa44", KEY_TYPE_HYB_SIG, NULL, 128, 8); +static void *p256_mldsa44_new_key(void *provctx) { + return oqsx_key_new(PROV_OQS_LIBCTX_OF(provctx), OQS_SIG_alg_ml_dsa_44, + "p256_mldsa44", KEY_TYPE_HYB_SIG, NULL, 128, 8); } -static void *p256_mldsa44_gen_init(void *provctx, int selection) -{ - return oqsx_gen_init(provctx, selection, OQS_SIG_alg_ml_dsa_44, "p256_mldsa44", KEY_TYPE_HYB_SIG, 128, 8); +static void *p256_mldsa44_gen_init(void *provctx, int selection) { + return oqsx_gen_init(provctx, selection, OQS_SIG_alg_ml_dsa_44, + "p256_mldsa44", KEY_TYPE_HYB_SIG, 128, 8); } -static void *rsa3072_mldsa44_new_key(void *provctx) -{ - return oqsx_key_new(PROV_OQS_LIBCTX_OF(provctx), OQS_SIG_alg_ml_dsa_44, "rsa3072_mldsa44", KEY_TYPE_HYB_SIG, NULL, 128, 9); +static void *rsa3072_mldsa44_new_key(void *provctx) { + return oqsx_key_new(PROV_OQS_LIBCTX_OF(provctx), OQS_SIG_alg_ml_dsa_44, + "rsa3072_mldsa44", KEY_TYPE_HYB_SIG, NULL, 128, 9); } -static void *rsa3072_mldsa44_gen_init(void *provctx, int selection) -{ - return oqsx_gen_init(provctx, selection, OQS_SIG_alg_ml_dsa_44, "rsa3072_mldsa44", KEY_TYPE_HYB_SIG, 128, 9); +static void *rsa3072_mldsa44_gen_init(void *provctx, int selection) { + return oqsx_gen_init(provctx, selection, OQS_SIG_alg_ml_dsa_44, + "rsa3072_mldsa44", KEY_TYPE_HYB_SIG, 128, 9); } -static void *mldsa44_pss2048_new_key(void *provctx) -{ - return oqsx_key_new(PROV_OQS_LIBCTX_OF(provctx), OQS_SIG_alg_ml_dsa_44, "mldsa44_pss2048", KEY_TYPE_CMP_SIG, NULL, 112, 10); +static void *mldsa44_pss2048_new_key(void *provctx) { + return oqsx_key_new(PROV_OQS_LIBCTX_OF(provctx), OQS_SIG_alg_ml_dsa_44, + "mldsa44_pss2048", KEY_TYPE_CMP_SIG, NULL, 112, 10); } -static void *mldsa44_pss2048_gen_init(void *provctx, int selection) -{ - return oqsx_gen_init(provctx, selection, OQS_SIG_alg_ml_dsa_44, "mldsa44_pss2048", KEY_TYPE_CMP_SIG, 112, 10); +static void *mldsa44_pss2048_gen_init(void *provctx, int selection) { + return oqsx_gen_init(provctx, selection, OQS_SIG_alg_ml_dsa_44, + "mldsa44_pss2048", KEY_TYPE_CMP_SIG, 112, 10); } -static void *mldsa44_rsa2048_new_key(void *provctx) -{ - return oqsx_key_new(PROV_OQS_LIBCTX_OF(provctx), OQS_SIG_alg_ml_dsa_44, "mldsa44_rsa2048", KEY_TYPE_CMP_SIG, NULL, 112, 11); +static void *mldsa44_rsa2048_new_key(void *provctx) { + return oqsx_key_new(PROV_OQS_LIBCTX_OF(provctx), OQS_SIG_alg_ml_dsa_44, + "mldsa44_rsa2048", KEY_TYPE_CMP_SIG, NULL, 112, 11); } -static void *mldsa44_rsa2048_gen_init(void *provctx, int selection) -{ - return oqsx_gen_init(provctx, selection, OQS_SIG_alg_ml_dsa_44, "mldsa44_rsa2048", KEY_TYPE_CMP_SIG, 112, 11); +static void *mldsa44_rsa2048_gen_init(void *provctx, int selection) { + return oqsx_gen_init(provctx, selection, OQS_SIG_alg_ml_dsa_44, + "mldsa44_rsa2048", KEY_TYPE_CMP_SIG, 112, 11); } -static void *mldsa44_ed25519_new_key(void *provctx) -{ - return oqsx_key_new(PROV_OQS_LIBCTX_OF(provctx), OQS_SIG_alg_ml_dsa_44, "mldsa44_ed25519", KEY_TYPE_CMP_SIG, NULL, 128, 12); +static void *mldsa44_ed25519_new_key(void *provctx) { + return oqsx_key_new(PROV_OQS_LIBCTX_OF(provctx), OQS_SIG_alg_ml_dsa_44, + "mldsa44_ed25519", KEY_TYPE_CMP_SIG, NULL, 128, 12); } -static void *mldsa44_ed25519_gen_init(void *provctx, int selection) -{ - return oqsx_gen_init(provctx, selection, OQS_SIG_alg_ml_dsa_44, "mldsa44_ed25519", KEY_TYPE_CMP_SIG, 128, 12); +static void *mldsa44_ed25519_gen_init(void *provctx, int selection) { + return oqsx_gen_init(provctx, selection, OQS_SIG_alg_ml_dsa_44, + "mldsa44_ed25519", KEY_TYPE_CMP_SIG, 128, 12); } -static void *mldsa44_p256_new_key(void *provctx) -{ - return oqsx_key_new(PROV_OQS_LIBCTX_OF(provctx), OQS_SIG_alg_ml_dsa_44, "mldsa44_p256", KEY_TYPE_CMP_SIG, NULL, 128, 13); +static void *mldsa44_p256_new_key(void *provctx) { + return oqsx_key_new(PROV_OQS_LIBCTX_OF(provctx), OQS_SIG_alg_ml_dsa_44, + "mldsa44_p256", KEY_TYPE_CMP_SIG, NULL, 128, 13); } -static void *mldsa44_p256_gen_init(void *provctx, int selection) -{ - return oqsx_gen_init(provctx, selection, OQS_SIG_alg_ml_dsa_44, "mldsa44_p256", KEY_TYPE_CMP_SIG, 128, 13); +static void *mldsa44_p256_gen_init(void *provctx, int selection) { + return oqsx_gen_init(provctx, selection, OQS_SIG_alg_ml_dsa_44, + "mldsa44_p256", KEY_TYPE_CMP_SIG, 128, 13); } -static void *mldsa44_bp256_new_key(void *provctx) -{ - return oqsx_key_new(PROV_OQS_LIBCTX_OF(provctx), OQS_SIG_alg_ml_dsa_44, "mldsa44_bp256", KEY_TYPE_CMP_SIG, NULL, 256, 14); +static void *mldsa44_bp256_new_key(void *provctx) { + return oqsx_key_new(PROV_OQS_LIBCTX_OF(provctx), OQS_SIG_alg_ml_dsa_44, + "mldsa44_bp256", KEY_TYPE_CMP_SIG, NULL, 256, 14); } -static void *mldsa44_bp256_gen_init(void *provctx, int selection) -{ - return oqsx_gen_init(provctx, selection, OQS_SIG_alg_ml_dsa_44, "mldsa44_bp256", KEY_TYPE_CMP_SIG, 256, 14); +static void *mldsa44_bp256_gen_init(void *provctx, int selection) { + return oqsx_gen_init(provctx, selection, OQS_SIG_alg_ml_dsa_44, + "mldsa44_bp256", KEY_TYPE_CMP_SIG, 256, 14); } -static void *mldsa65_new_key(void *provctx) -{ - return oqsx_key_new(PROV_OQS_LIBCTX_OF(provctx), OQS_SIG_alg_ml_dsa_65, "mldsa65", KEY_TYPE_SIG, NULL, 192, 15); +static void *mldsa65_new_key(void *provctx) { + return oqsx_key_new(PROV_OQS_LIBCTX_OF(provctx), OQS_SIG_alg_ml_dsa_65, + "mldsa65", KEY_TYPE_SIG, NULL, 192, 15); } -static void *mldsa65_gen_init(void *provctx, int selection) -{ - return oqsx_gen_init(provctx, selection, OQS_SIG_alg_ml_dsa_65, "mldsa65", 0, 192, 15); +static void *mldsa65_gen_init(void *provctx, int selection) { + return oqsx_gen_init(provctx, selection, OQS_SIG_alg_ml_dsa_65, "mldsa65", + 0, 192, 15); } -static void *p384_mldsa65_new_key(void *provctx) -{ - return oqsx_key_new(PROV_OQS_LIBCTX_OF(provctx), OQS_SIG_alg_ml_dsa_65, "p384_mldsa65", KEY_TYPE_HYB_SIG, NULL, 192, 16); +static void *p384_mldsa65_new_key(void *provctx) { + return oqsx_key_new(PROV_OQS_LIBCTX_OF(provctx), OQS_SIG_alg_ml_dsa_65, + "p384_mldsa65", KEY_TYPE_HYB_SIG, NULL, 192, 16); } -static void *p384_mldsa65_gen_init(void *provctx, int selection) -{ - return oqsx_gen_init(provctx, selection, OQS_SIG_alg_ml_dsa_65, "p384_mldsa65", KEY_TYPE_HYB_SIG, 192, 16); +static void *p384_mldsa65_gen_init(void *provctx, int selection) { + return oqsx_gen_init(provctx, selection, OQS_SIG_alg_ml_dsa_65, + "p384_mldsa65", KEY_TYPE_HYB_SIG, 192, 16); } -static void *mldsa65_pss3072_new_key(void *provctx) -{ - return oqsx_key_new(PROV_OQS_LIBCTX_OF(provctx), OQS_SIG_alg_ml_dsa_65, "mldsa65_pss3072", KEY_TYPE_CMP_SIG, NULL, 128, 17); +static void *mldsa65_pss3072_new_key(void *provctx) { + return oqsx_key_new(PROV_OQS_LIBCTX_OF(provctx), OQS_SIG_alg_ml_dsa_65, + "mldsa65_pss3072", KEY_TYPE_CMP_SIG, NULL, 128, 17); } -static void *mldsa65_pss3072_gen_init(void *provctx, int selection) -{ - return oqsx_gen_init(provctx, selection, OQS_SIG_alg_ml_dsa_65, "mldsa65_pss3072", KEY_TYPE_CMP_SIG, 128, 17); +static void *mldsa65_pss3072_gen_init(void *provctx, int selection) { + return oqsx_gen_init(provctx, selection, OQS_SIG_alg_ml_dsa_65, + "mldsa65_pss3072", KEY_TYPE_CMP_SIG, 128, 17); } -static void *mldsa65_rsa3072_new_key(void *provctx) -{ - return oqsx_key_new(PROV_OQS_LIBCTX_OF(provctx), OQS_SIG_alg_ml_dsa_65, "mldsa65_rsa3072", KEY_TYPE_CMP_SIG, NULL, 128, 18); +static void *mldsa65_rsa3072_new_key(void *provctx) { + return oqsx_key_new(PROV_OQS_LIBCTX_OF(provctx), OQS_SIG_alg_ml_dsa_65, + "mldsa65_rsa3072", KEY_TYPE_CMP_SIG, NULL, 128, 18); } -static void *mldsa65_rsa3072_gen_init(void *provctx, int selection) -{ - return oqsx_gen_init(provctx, selection, OQS_SIG_alg_ml_dsa_65, "mldsa65_rsa3072", KEY_TYPE_CMP_SIG, 128, 18); +static void *mldsa65_rsa3072_gen_init(void *provctx, int selection) { + return oqsx_gen_init(provctx, selection, OQS_SIG_alg_ml_dsa_65, + "mldsa65_rsa3072", KEY_TYPE_CMP_SIG, 128, 18); } -static void *mldsa65_p256_new_key(void *provctx) -{ - return oqsx_key_new(PROV_OQS_LIBCTX_OF(provctx), OQS_SIG_alg_ml_dsa_65, "mldsa65_p256", KEY_TYPE_CMP_SIG, NULL, 128, 19); +static void *mldsa65_p256_new_key(void *provctx) { + return oqsx_key_new(PROV_OQS_LIBCTX_OF(provctx), OQS_SIG_alg_ml_dsa_65, + "mldsa65_p256", KEY_TYPE_CMP_SIG, NULL, 128, 19); } -static void *mldsa65_p256_gen_init(void *provctx, int selection) -{ - return oqsx_gen_init(provctx, selection, OQS_SIG_alg_ml_dsa_65, "mldsa65_p256", KEY_TYPE_CMP_SIG, 128, 19); +static void *mldsa65_p256_gen_init(void *provctx, int selection) { + return oqsx_gen_init(provctx, selection, OQS_SIG_alg_ml_dsa_65, + "mldsa65_p256", KEY_TYPE_CMP_SIG, 128, 19); } -static void *mldsa65_bp256_new_key(void *provctx) -{ - return oqsx_key_new(PROV_OQS_LIBCTX_OF(provctx), OQS_SIG_alg_ml_dsa_65, "mldsa65_bp256", KEY_TYPE_CMP_SIG, NULL, 256, 20); +static void *mldsa65_bp256_new_key(void *provctx) { + return oqsx_key_new(PROV_OQS_LIBCTX_OF(provctx), OQS_SIG_alg_ml_dsa_65, + "mldsa65_bp256", KEY_TYPE_CMP_SIG, NULL, 256, 20); } -static void *mldsa65_bp256_gen_init(void *provctx, int selection) -{ - return oqsx_gen_init(provctx, selection, OQS_SIG_alg_ml_dsa_65, "mldsa65_bp256", KEY_TYPE_CMP_SIG, 256, 20); +static void *mldsa65_bp256_gen_init(void *provctx, int selection) { + return oqsx_gen_init(provctx, selection, OQS_SIG_alg_ml_dsa_65, + "mldsa65_bp256", KEY_TYPE_CMP_SIG, 256, 20); } -static void *mldsa65_ed25519_new_key(void *provctx) -{ - return oqsx_key_new(PROV_OQS_LIBCTX_OF(provctx), OQS_SIG_alg_ml_dsa_65, "mldsa65_ed25519", KEY_TYPE_CMP_SIG, NULL, 128, 21); +static void *mldsa65_ed25519_new_key(void *provctx) { + return oqsx_key_new(PROV_OQS_LIBCTX_OF(provctx), OQS_SIG_alg_ml_dsa_65, + "mldsa65_ed25519", KEY_TYPE_CMP_SIG, NULL, 128, 21); } -static void *mldsa65_ed25519_gen_init(void *provctx, int selection) -{ - return oqsx_gen_init(provctx, selection, OQS_SIG_alg_ml_dsa_65, "mldsa65_ed25519", KEY_TYPE_CMP_SIG, 128, 21); +static void *mldsa65_ed25519_gen_init(void *provctx, int selection) { + return oqsx_gen_init(provctx, selection, OQS_SIG_alg_ml_dsa_65, + "mldsa65_ed25519", KEY_TYPE_CMP_SIG, 128, 21); } -static void *mldsa87_new_key(void *provctx) -{ - return oqsx_key_new(PROV_OQS_LIBCTX_OF(provctx), OQS_SIG_alg_ml_dsa_87, "mldsa87", KEY_TYPE_SIG, NULL, 256, 22); +static void *mldsa87_new_key(void *provctx) { + return oqsx_key_new(PROV_OQS_LIBCTX_OF(provctx), OQS_SIG_alg_ml_dsa_87, + "mldsa87", KEY_TYPE_SIG, NULL, 256, 22); } -static void *mldsa87_gen_init(void *provctx, int selection) -{ - return oqsx_gen_init(provctx, selection, OQS_SIG_alg_ml_dsa_87, "mldsa87", 0, 256, 22); +static void *mldsa87_gen_init(void *provctx, int selection) { + return oqsx_gen_init(provctx, selection, OQS_SIG_alg_ml_dsa_87, "mldsa87", + 0, 256, 22); } -static void *p521_mldsa87_new_key(void *provctx) -{ - return oqsx_key_new(PROV_OQS_LIBCTX_OF(provctx), OQS_SIG_alg_ml_dsa_87, "p521_mldsa87", KEY_TYPE_HYB_SIG, NULL, 256, 23); +static void *p521_mldsa87_new_key(void *provctx) { + return oqsx_key_new(PROV_OQS_LIBCTX_OF(provctx), OQS_SIG_alg_ml_dsa_87, + "p521_mldsa87", KEY_TYPE_HYB_SIG, NULL, 256, 23); } -static void *p521_mldsa87_gen_init(void *provctx, int selection) -{ - return oqsx_gen_init(provctx, selection, OQS_SIG_alg_ml_dsa_87, "p521_mldsa87", KEY_TYPE_HYB_SIG, 256, 23); +static void *p521_mldsa87_gen_init(void *provctx, int selection) { + return oqsx_gen_init(provctx, selection, OQS_SIG_alg_ml_dsa_87, + "p521_mldsa87", KEY_TYPE_HYB_SIG, 256, 23); } -static void *mldsa87_p384_new_key(void *provctx) -{ - return oqsx_key_new(PROV_OQS_LIBCTX_OF(provctx), OQS_SIG_alg_ml_dsa_87, "mldsa87_p384", KEY_TYPE_CMP_SIG, NULL, 192, 24); +static void *mldsa87_p384_new_key(void *provctx) { + return oqsx_key_new(PROV_OQS_LIBCTX_OF(provctx), OQS_SIG_alg_ml_dsa_87, + "mldsa87_p384", KEY_TYPE_CMP_SIG, NULL, 192, 24); } -static void *mldsa87_p384_gen_init(void *provctx, int selection) -{ - return oqsx_gen_init(provctx, selection, OQS_SIG_alg_ml_dsa_87, "mldsa87_p384", KEY_TYPE_CMP_SIG, 192, 24); +static void *mldsa87_p384_gen_init(void *provctx, int selection) { + return oqsx_gen_init(provctx, selection, OQS_SIG_alg_ml_dsa_87, + "mldsa87_p384", KEY_TYPE_CMP_SIG, 192, 24); } -static void *mldsa87_bp384_new_key(void *provctx) -{ - return oqsx_key_new(PROV_OQS_LIBCTX_OF(provctx), OQS_SIG_alg_ml_dsa_87, "mldsa87_bp384", KEY_TYPE_CMP_SIG, NULL, 384, 25); +static void *mldsa87_bp384_new_key(void *provctx) { + return oqsx_key_new(PROV_OQS_LIBCTX_OF(provctx), OQS_SIG_alg_ml_dsa_87, + "mldsa87_bp384", KEY_TYPE_CMP_SIG, NULL, 384, 25); } -static void *mldsa87_bp384_gen_init(void *provctx, int selection) -{ - return oqsx_gen_init(provctx, selection, OQS_SIG_alg_ml_dsa_87, "mldsa87_bp384", KEY_TYPE_CMP_SIG, 384, 25); +static void *mldsa87_bp384_gen_init(void *provctx, int selection) { + return oqsx_gen_init(provctx, selection, OQS_SIG_alg_ml_dsa_87, + "mldsa87_bp384", KEY_TYPE_CMP_SIG, 384, 25); } -static void *mldsa87_ed448_new_key(void *provctx) -{ - return oqsx_key_new(PROV_OQS_LIBCTX_OF(provctx), OQS_SIG_alg_ml_dsa_87, "mldsa87_ed448", KEY_TYPE_CMP_SIG, NULL, 192, 26); +static void *mldsa87_ed448_new_key(void *provctx) { + return oqsx_key_new(PROV_OQS_LIBCTX_OF(provctx), OQS_SIG_alg_ml_dsa_87, + "mldsa87_ed448", KEY_TYPE_CMP_SIG, NULL, 192, 26); } -static void *mldsa87_ed448_gen_init(void *provctx, int selection) -{ - return oqsx_gen_init(provctx, selection, OQS_SIG_alg_ml_dsa_87, "mldsa87_ed448", KEY_TYPE_CMP_SIG, 192, 26); +static void *mldsa87_ed448_gen_init(void *provctx, int selection) { + return oqsx_gen_init(provctx, selection, OQS_SIG_alg_ml_dsa_87, + "mldsa87_ed448", KEY_TYPE_CMP_SIG, 192, 26); } -static void *falcon512_new_key(void *provctx) -{ - return oqsx_key_new(PROV_OQS_LIBCTX_OF(provctx), OQS_SIG_alg_falcon_512, "falcon512", KEY_TYPE_SIG, NULL, 128, 27); +static void *falcon512_new_key(void *provctx) { + return oqsx_key_new(PROV_OQS_LIBCTX_OF(provctx), OQS_SIG_alg_falcon_512, + "falcon512", KEY_TYPE_SIG, NULL, 128, 27); } -static void *falcon512_gen_init(void *provctx, int selection) -{ - return oqsx_gen_init(provctx, selection, OQS_SIG_alg_falcon_512, "falcon512", 0, 128, 27); +static void *falcon512_gen_init(void *provctx, int selection) { + return oqsx_gen_init(provctx, selection, OQS_SIG_alg_falcon_512, + "falcon512", 0, 128, 27); } -static void *p256_falcon512_new_key(void *provctx) -{ - return oqsx_key_new(PROV_OQS_LIBCTX_OF(provctx), OQS_SIG_alg_falcon_512, "p256_falcon512", KEY_TYPE_HYB_SIG, NULL, 128, 28); +static void *p256_falcon512_new_key(void *provctx) { + return oqsx_key_new(PROV_OQS_LIBCTX_OF(provctx), OQS_SIG_alg_falcon_512, + "p256_falcon512", KEY_TYPE_HYB_SIG, NULL, 128, 28); } -static void *p256_falcon512_gen_init(void *provctx, int selection) -{ - return oqsx_gen_init(provctx, selection, OQS_SIG_alg_falcon_512, "p256_falcon512", KEY_TYPE_HYB_SIG, 128, 28); +static void *p256_falcon512_gen_init(void *provctx, int selection) { + return oqsx_gen_init(provctx, selection, OQS_SIG_alg_falcon_512, + "p256_falcon512", KEY_TYPE_HYB_SIG, 128, 28); } -static void *rsa3072_falcon512_new_key(void *provctx) -{ - return oqsx_key_new(PROV_OQS_LIBCTX_OF(provctx), OQS_SIG_alg_falcon_512, "rsa3072_falcon512", KEY_TYPE_HYB_SIG, NULL, 128, 29); +static void *rsa3072_falcon512_new_key(void *provctx) { + return oqsx_key_new(PROV_OQS_LIBCTX_OF(provctx), OQS_SIG_alg_falcon_512, + "rsa3072_falcon512", KEY_TYPE_HYB_SIG, NULL, 128, 29); } -static void *rsa3072_falcon512_gen_init(void *provctx, int selection) -{ - return oqsx_gen_init(provctx, selection, OQS_SIG_alg_falcon_512, "rsa3072_falcon512", KEY_TYPE_HYB_SIG, 128, 29); +static void *rsa3072_falcon512_gen_init(void *provctx, int selection) { + return oqsx_gen_init(provctx, selection, OQS_SIG_alg_falcon_512, + "rsa3072_falcon512", KEY_TYPE_HYB_SIG, 128, 29); } -static void *falconpadded512_new_key(void *provctx) -{ - return oqsx_key_new(PROV_OQS_LIBCTX_OF(provctx), OQS_SIG_alg_falcon_padded_512, "falconpadded512", KEY_TYPE_SIG, NULL, 128, 30); +static void *falconpadded512_new_key(void *provctx) { + return oqsx_key_new(PROV_OQS_LIBCTX_OF(provctx), + OQS_SIG_alg_falcon_padded_512, "falconpadded512", + KEY_TYPE_SIG, NULL, 128, 30); } -static void *falconpadded512_gen_init(void *provctx, int selection) -{ - return oqsx_gen_init(provctx, selection, OQS_SIG_alg_falcon_padded_512, "falconpadded512", 0, 128, 30); +static void *falconpadded512_gen_init(void *provctx, int selection) { + return oqsx_gen_init(provctx, selection, OQS_SIG_alg_falcon_padded_512, + "falconpadded512", 0, 128, 30); } -static void *p256_falconpadded512_new_key(void *provctx) -{ - return oqsx_key_new(PROV_OQS_LIBCTX_OF(provctx), OQS_SIG_alg_falcon_padded_512, "p256_falconpadded512", KEY_TYPE_HYB_SIG, NULL, 128, 31); +static void *p256_falconpadded512_new_key(void *provctx) { + return oqsx_key_new(PROV_OQS_LIBCTX_OF(provctx), + OQS_SIG_alg_falcon_padded_512, "p256_falconpadded512", + KEY_TYPE_HYB_SIG, NULL, 128, 31); } -static void *p256_falconpadded512_gen_init(void *provctx, int selection) -{ - return oqsx_gen_init(provctx, selection, OQS_SIG_alg_falcon_padded_512, "p256_falconpadded512", KEY_TYPE_HYB_SIG, 128, 31); +static void *p256_falconpadded512_gen_init(void *provctx, int selection) { + return oqsx_gen_init(provctx, selection, OQS_SIG_alg_falcon_padded_512, + "p256_falconpadded512", KEY_TYPE_HYB_SIG, 128, 31); } -static void *rsa3072_falconpadded512_new_key(void *provctx) -{ - return oqsx_key_new(PROV_OQS_LIBCTX_OF(provctx), OQS_SIG_alg_falcon_padded_512, "rsa3072_falconpadded512", KEY_TYPE_HYB_SIG, NULL, 128, 32); +static void *rsa3072_falconpadded512_new_key(void *provctx) { + return oqsx_key_new( + PROV_OQS_LIBCTX_OF(provctx), OQS_SIG_alg_falcon_padded_512, + "rsa3072_falconpadded512", KEY_TYPE_HYB_SIG, NULL, 128, 32); } -static void *rsa3072_falconpadded512_gen_init(void *provctx, int selection) -{ - return oqsx_gen_init(provctx, selection, OQS_SIG_alg_falcon_padded_512, "rsa3072_falconpadded512", KEY_TYPE_HYB_SIG, 128, 32); +static void *rsa3072_falconpadded512_gen_init(void *provctx, int selection) { + return oqsx_gen_init(provctx, selection, OQS_SIG_alg_falcon_padded_512, + "rsa3072_falconpadded512", KEY_TYPE_HYB_SIG, 128, 32); } -static void *falcon1024_new_key(void *provctx) -{ - return oqsx_key_new(PROV_OQS_LIBCTX_OF(provctx), OQS_SIG_alg_falcon_1024, "falcon1024", KEY_TYPE_SIG, NULL, 256, 33); +static void *falcon1024_new_key(void *provctx) { + return oqsx_key_new(PROV_OQS_LIBCTX_OF(provctx), OQS_SIG_alg_falcon_1024, + "falcon1024", KEY_TYPE_SIG, NULL, 256, 33); } -static void *falcon1024_gen_init(void *provctx, int selection) -{ - return oqsx_gen_init(provctx, selection, OQS_SIG_alg_falcon_1024, "falcon1024", 0, 256, 33); +static void *falcon1024_gen_init(void *provctx, int selection) { + return oqsx_gen_init(provctx, selection, OQS_SIG_alg_falcon_1024, + "falcon1024", 0, 256, 33); } -static void *p521_falcon1024_new_key(void *provctx) -{ - return oqsx_key_new(PROV_OQS_LIBCTX_OF(provctx), OQS_SIG_alg_falcon_1024, "p521_falcon1024", KEY_TYPE_HYB_SIG, NULL, 256, 34); +static void *p521_falcon1024_new_key(void *provctx) { + return oqsx_key_new(PROV_OQS_LIBCTX_OF(provctx), OQS_SIG_alg_falcon_1024, + "p521_falcon1024", KEY_TYPE_HYB_SIG, NULL, 256, 34); } -static void *p521_falcon1024_gen_init(void *provctx, int selection) -{ - return oqsx_gen_init(provctx, selection, OQS_SIG_alg_falcon_1024, "p521_falcon1024", KEY_TYPE_HYB_SIG, 256, 34); +static void *p521_falcon1024_gen_init(void *provctx, int selection) { + return oqsx_gen_init(provctx, selection, OQS_SIG_alg_falcon_1024, + "p521_falcon1024", KEY_TYPE_HYB_SIG, 256, 34); } -static void *falconpadded1024_new_key(void *provctx) -{ - return oqsx_key_new(PROV_OQS_LIBCTX_OF(provctx), OQS_SIG_alg_falcon_padded_1024, "falconpadded1024", KEY_TYPE_SIG, NULL, 256, 35); +static void *falconpadded1024_new_key(void *provctx) { + return oqsx_key_new(PROV_OQS_LIBCTX_OF(provctx), + OQS_SIG_alg_falcon_padded_1024, "falconpadded1024", + KEY_TYPE_SIG, NULL, 256, 35); } -static void *falconpadded1024_gen_init(void *provctx, int selection) -{ - return oqsx_gen_init(provctx, selection, OQS_SIG_alg_falcon_padded_1024, "falconpadded1024", 0, 256, 35); +static void *falconpadded1024_gen_init(void *provctx, int selection) { + return oqsx_gen_init(provctx, selection, OQS_SIG_alg_falcon_padded_1024, + "falconpadded1024", 0, 256, 35); } -static void *p521_falconpadded1024_new_key(void *provctx) -{ - return oqsx_key_new(PROV_OQS_LIBCTX_OF(provctx), OQS_SIG_alg_falcon_padded_1024, "p521_falconpadded1024", KEY_TYPE_HYB_SIG, NULL, 256, 36); +static void *p521_falconpadded1024_new_key(void *provctx) { + return oqsx_key_new(PROV_OQS_LIBCTX_OF(provctx), + OQS_SIG_alg_falcon_padded_1024, "p521_falconpadded1024", + KEY_TYPE_HYB_SIG, NULL, 256, 36); } -static void *p521_falconpadded1024_gen_init(void *provctx, int selection) -{ - return oqsx_gen_init(provctx, selection, OQS_SIG_alg_falcon_padded_1024, "p521_falconpadded1024", KEY_TYPE_HYB_SIG, 256, 36); +static void *p521_falconpadded1024_gen_init(void *provctx, int selection) { + return oqsx_gen_init(provctx, selection, OQS_SIG_alg_falcon_padded_1024, + "p521_falconpadded1024", KEY_TYPE_HYB_SIG, 256, 36); } - -static void *sphincssha2128fsimple_new_key(void *provctx) -{ - return oqsx_key_new(PROV_OQS_LIBCTX_OF(provctx), OQS_SIG_alg_sphincs_sha2_128f_simple, "sphincssha2128fsimple", KEY_TYPE_SIG, NULL, 128, 37); +static void *sphincssha2128fsimple_new_key(void *provctx) { + return oqsx_key_new(PROV_OQS_LIBCTX_OF(provctx), + OQS_SIG_alg_sphincs_sha2_128f_simple, + "sphincssha2128fsimple", KEY_TYPE_SIG, NULL, 128, 37); } -static void *sphincssha2128fsimple_gen_init(void *provctx, int selection) -{ - return oqsx_gen_init(provctx, selection, OQS_SIG_alg_sphincs_sha2_128f_simple, "sphincssha2128fsimple", 0, 128, 37); +static void *sphincssha2128fsimple_gen_init(void *provctx, int selection) { + return oqsx_gen_init(provctx, selection, + OQS_SIG_alg_sphincs_sha2_128f_simple, + "sphincssha2128fsimple", 0, 128, 37); } -static void *p256_sphincssha2128fsimple_new_key(void *provctx) -{ - return oqsx_key_new(PROV_OQS_LIBCTX_OF(provctx), OQS_SIG_alg_sphincs_sha2_128f_simple, "p256_sphincssha2128fsimple", KEY_TYPE_HYB_SIG, NULL, 128, 38); +static void *p256_sphincssha2128fsimple_new_key(void *provctx) { + return oqsx_key_new( + PROV_OQS_LIBCTX_OF(provctx), OQS_SIG_alg_sphincs_sha2_128f_simple, + "p256_sphincssha2128fsimple", KEY_TYPE_HYB_SIG, NULL, 128, 38); } -static void *p256_sphincssha2128fsimple_gen_init(void *provctx, int selection) -{ - return oqsx_gen_init(provctx, selection, OQS_SIG_alg_sphincs_sha2_128f_simple, "p256_sphincssha2128fsimple", KEY_TYPE_HYB_SIG, 128, 38); +static void *p256_sphincssha2128fsimple_gen_init(void *provctx, int selection) { + return oqsx_gen_init( + provctx, selection, OQS_SIG_alg_sphincs_sha2_128f_simple, + "p256_sphincssha2128fsimple", KEY_TYPE_HYB_SIG, 128, 38); } -static void *rsa3072_sphincssha2128fsimple_new_key(void *provctx) -{ - return oqsx_key_new(PROV_OQS_LIBCTX_OF(provctx), OQS_SIG_alg_sphincs_sha2_128f_simple, "rsa3072_sphincssha2128fsimple", KEY_TYPE_HYB_SIG, NULL, 128, 39); +static void *rsa3072_sphincssha2128fsimple_new_key(void *provctx) { + return oqsx_key_new( + PROV_OQS_LIBCTX_OF(provctx), OQS_SIG_alg_sphincs_sha2_128f_simple, + "rsa3072_sphincssha2128fsimple", KEY_TYPE_HYB_SIG, NULL, 128, 39); } -static void *rsa3072_sphincssha2128fsimple_gen_init(void *provctx, int selection) -{ - return oqsx_gen_init(provctx, selection, OQS_SIG_alg_sphincs_sha2_128f_simple, "rsa3072_sphincssha2128fsimple", KEY_TYPE_HYB_SIG, 128, 39); +static void *rsa3072_sphincssha2128fsimple_gen_init(void *provctx, + int selection) { + return oqsx_gen_init( + provctx, selection, OQS_SIG_alg_sphincs_sha2_128f_simple, + "rsa3072_sphincssha2128fsimple", KEY_TYPE_HYB_SIG, 128, 39); } -static void *sphincssha2128ssimple_new_key(void *provctx) -{ - return oqsx_key_new(PROV_OQS_LIBCTX_OF(provctx), OQS_SIG_alg_sphincs_sha2_128s_simple, "sphincssha2128ssimple", KEY_TYPE_SIG, NULL, 128, 40); +static void *sphincssha2128ssimple_new_key(void *provctx) { + return oqsx_key_new(PROV_OQS_LIBCTX_OF(provctx), + OQS_SIG_alg_sphincs_sha2_128s_simple, + "sphincssha2128ssimple", KEY_TYPE_SIG, NULL, 128, 40); } -static void *sphincssha2128ssimple_gen_init(void *provctx, int selection) -{ - return oqsx_gen_init(provctx, selection, OQS_SIG_alg_sphincs_sha2_128s_simple, "sphincssha2128ssimple", 0, 128, 40); +static void *sphincssha2128ssimple_gen_init(void *provctx, int selection) { + return oqsx_gen_init(provctx, selection, + OQS_SIG_alg_sphincs_sha2_128s_simple, + "sphincssha2128ssimple", 0, 128, 40); } -static void *p256_sphincssha2128ssimple_new_key(void *provctx) -{ - return oqsx_key_new(PROV_OQS_LIBCTX_OF(provctx), OQS_SIG_alg_sphincs_sha2_128s_simple, "p256_sphincssha2128ssimple", KEY_TYPE_HYB_SIG, NULL, 128, 41); +static void *p256_sphincssha2128ssimple_new_key(void *provctx) { + return oqsx_key_new( + PROV_OQS_LIBCTX_OF(provctx), OQS_SIG_alg_sphincs_sha2_128s_simple, + "p256_sphincssha2128ssimple", KEY_TYPE_HYB_SIG, NULL, 128, 41); } -static void *p256_sphincssha2128ssimple_gen_init(void *provctx, int selection) -{ - return oqsx_gen_init(provctx, selection, OQS_SIG_alg_sphincs_sha2_128s_simple, "p256_sphincssha2128ssimple", KEY_TYPE_HYB_SIG, 128, 41); +static void *p256_sphincssha2128ssimple_gen_init(void *provctx, int selection) { + return oqsx_gen_init( + provctx, selection, OQS_SIG_alg_sphincs_sha2_128s_simple, + "p256_sphincssha2128ssimple", KEY_TYPE_HYB_SIG, 128, 41); } -static void *rsa3072_sphincssha2128ssimple_new_key(void *provctx) -{ - return oqsx_key_new(PROV_OQS_LIBCTX_OF(provctx), OQS_SIG_alg_sphincs_sha2_128s_simple, "rsa3072_sphincssha2128ssimple", KEY_TYPE_HYB_SIG, NULL, 128, 42); +static void *rsa3072_sphincssha2128ssimple_new_key(void *provctx) { + return oqsx_key_new( + PROV_OQS_LIBCTX_OF(provctx), OQS_SIG_alg_sphincs_sha2_128s_simple, + "rsa3072_sphincssha2128ssimple", KEY_TYPE_HYB_SIG, NULL, 128, 42); } -static void *rsa3072_sphincssha2128ssimple_gen_init(void *provctx, int selection) -{ - return oqsx_gen_init(provctx, selection, OQS_SIG_alg_sphincs_sha2_128s_simple, "rsa3072_sphincssha2128ssimple", KEY_TYPE_HYB_SIG, 128, 42); +static void *rsa3072_sphincssha2128ssimple_gen_init(void *provctx, + int selection) { + return oqsx_gen_init( + provctx, selection, OQS_SIG_alg_sphincs_sha2_128s_simple, + "rsa3072_sphincssha2128ssimple", KEY_TYPE_HYB_SIG, 128, 42); } -static void *sphincssha2192fsimple_new_key(void *provctx) -{ - return oqsx_key_new(PROV_OQS_LIBCTX_OF(provctx), OQS_SIG_alg_sphincs_sha2_192f_simple, "sphincssha2192fsimple", KEY_TYPE_SIG, NULL, 192, 43); +static void *sphincssha2192fsimple_new_key(void *provctx) { + return oqsx_key_new(PROV_OQS_LIBCTX_OF(provctx), + OQS_SIG_alg_sphincs_sha2_192f_simple, + "sphincssha2192fsimple", KEY_TYPE_SIG, NULL, 192, 43); } -static void *sphincssha2192fsimple_gen_init(void *provctx, int selection) -{ - return oqsx_gen_init(provctx, selection, OQS_SIG_alg_sphincs_sha2_192f_simple, "sphincssha2192fsimple", 0, 192, 43); +static void *sphincssha2192fsimple_gen_init(void *provctx, int selection) { + return oqsx_gen_init(provctx, selection, + OQS_SIG_alg_sphincs_sha2_192f_simple, + "sphincssha2192fsimple", 0, 192, 43); } -static void *p384_sphincssha2192fsimple_new_key(void *provctx) -{ - return oqsx_key_new(PROV_OQS_LIBCTX_OF(provctx), OQS_SIG_alg_sphincs_sha2_192f_simple, "p384_sphincssha2192fsimple", KEY_TYPE_HYB_SIG, NULL, 192, 44); +static void *p384_sphincssha2192fsimple_new_key(void *provctx) { + return oqsx_key_new( + PROV_OQS_LIBCTX_OF(provctx), OQS_SIG_alg_sphincs_sha2_192f_simple, + "p384_sphincssha2192fsimple", KEY_TYPE_HYB_SIG, NULL, 192, 44); } -static void *p384_sphincssha2192fsimple_gen_init(void *provctx, int selection) -{ - return oqsx_gen_init(provctx, selection, OQS_SIG_alg_sphincs_sha2_192f_simple, "p384_sphincssha2192fsimple", KEY_TYPE_HYB_SIG, 192, 44); +static void *p384_sphincssha2192fsimple_gen_init(void *provctx, int selection) { + return oqsx_gen_init( + provctx, selection, OQS_SIG_alg_sphincs_sha2_192f_simple, + "p384_sphincssha2192fsimple", KEY_TYPE_HYB_SIG, 192, 44); } -static void *sphincsshake128fsimple_new_key(void *provctx) -{ - return oqsx_key_new(PROV_OQS_LIBCTX_OF(provctx), OQS_SIG_alg_sphincs_shake_128f_simple, "sphincsshake128fsimple", KEY_TYPE_SIG, NULL, 128, 45); +static void *sphincsshake128fsimple_new_key(void *provctx) { + return oqsx_key_new(PROV_OQS_LIBCTX_OF(provctx), + OQS_SIG_alg_sphincs_shake_128f_simple, + "sphincsshake128fsimple", KEY_TYPE_SIG, NULL, 128, 45); } -static void *sphincsshake128fsimple_gen_init(void *provctx, int selection) -{ - return oqsx_gen_init(provctx, selection, OQS_SIG_alg_sphincs_shake_128f_simple, "sphincsshake128fsimple", 0, 128, 45); +static void *sphincsshake128fsimple_gen_init(void *provctx, int selection) { + return oqsx_gen_init(provctx, selection, + OQS_SIG_alg_sphincs_shake_128f_simple, + "sphincsshake128fsimple", 0, 128, 45); } -static void *p256_sphincsshake128fsimple_new_key(void *provctx) -{ - return oqsx_key_new(PROV_OQS_LIBCTX_OF(provctx), OQS_SIG_alg_sphincs_shake_128f_simple, "p256_sphincsshake128fsimple", KEY_TYPE_HYB_SIG, NULL, 128, 46); +static void *p256_sphincsshake128fsimple_new_key(void *provctx) { + return oqsx_key_new( + PROV_OQS_LIBCTX_OF(provctx), OQS_SIG_alg_sphincs_shake_128f_simple, + "p256_sphincsshake128fsimple", KEY_TYPE_HYB_SIG, NULL, 128, 46); } -static void *p256_sphincsshake128fsimple_gen_init(void *provctx, int selection) -{ - return oqsx_gen_init(provctx, selection, OQS_SIG_alg_sphincs_shake_128f_simple, "p256_sphincsshake128fsimple", KEY_TYPE_HYB_SIG, 128, 46); +static void *p256_sphincsshake128fsimple_gen_init(void *provctx, + int selection) { + return oqsx_gen_init( + provctx, selection, OQS_SIG_alg_sphincs_shake_128f_simple, + "p256_sphincsshake128fsimple", KEY_TYPE_HYB_SIG, 128, 46); } -static void *rsa3072_sphincsshake128fsimple_new_key(void *provctx) -{ - return oqsx_key_new(PROV_OQS_LIBCTX_OF(provctx), OQS_SIG_alg_sphincs_shake_128f_simple, "rsa3072_sphincsshake128fsimple", KEY_TYPE_HYB_SIG, NULL, 128, 47); +static void *rsa3072_sphincsshake128fsimple_new_key(void *provctx) { + return oqsx_key_new( + PROV_OQS_LIBCTX_OF(provctx), OQS_SIG_alg_sphincs_shake_128f_simple, + "rsa3072_sphincsshake128fsimple", KEY_TYPE_HYB_SIG, NULL, 128, 47); } -static void *rsa3072_sphincsshake128fsimple_gen_init(void *provctx, int selection) -{ - return oqsx_gen_init(provctx, selection, OQS_SIG_alg_sphincs_shake_128f_simple, "rsa3072_sphincsshake128fsimple", KEY_TYPE_HYB_SIG, 128, 47); +static void *rsa3072_sphincsshake128fsimple_gen_init(void *provctx, + int selection) { + return oqsx_gen_init( + provctx, selection, OQS_SIG_alg_sphincs_shake_128f_simple, + "rsa3072_sphincsshake128fsimple", KEY_TYPE_HYB_SIG, 128, 47); } -static void *mayo1_new_key(void *provctx) -{ - return oqsx_key_new(PROV_OQS_LIBCTX_OF(provctx), OQS_SIG_alg_mayo_1, "mayo1", KEY_TYPE_SIG, NULL, 128, 48); +static void *mayo1_new_key(void *provctx) { + return oqsx_key_new(PROV_OQS_LIBCTX_OF(provctx), OQS_SIG_alg_mayo_1, + "mayo1", KEY_TYPE_SIG, NULL, 128, 48); } -static void *mayo1_gen_init(void *provctx, int selection) -{ - return oqsx_gen_init(provctx, selection, OQS_SIG_alg_mayo_1, "mayo1", 0, 128, 48); +static void *mayo1_gen_init(void *provctx, int selection) { + return oqsx_gen_init(provctx, selection, OQS_SIG_alg_mayo_1, "mayo1", 0, + 128, 48); } -static void *p256_mayo1_new_key(void *provctx) -{ - return oqsx_key_new(PROV_OQS_LIBCTX_OF(provctx), OQS_SIG_alg_mayo_1, "p256_mayo1", KEY_TYPE_HYB_SIG, NULL, 128, 49); +static void *p256_mayo1_new_key(void *provctx) { + return oqsx_key_new(PROV_OQS_LIBCTX_OF(provctx), OQS_SIG_alg_mayo_1, + "p256_mayo1", KEY_TYPE_HYB_SIG, NULL, 128, 49); } -static void *p256_mayo1_gen_init(void *provctx, int selection) -{ - return oqsx_gen_init(provctx, selection, OQS_SIG_alg_mayo_1, "p256_mayo1", KEY_TYPE_HYB_SIG, 128, 49); +static void *p256_mayo1_gen_init(void *provctx, int selection) { + return oqsx_gen_init(provctx, selection, OQS_SIG_alg_mayo_1, "p256_mayo1", + KEY_TYPE_HYB_SIG, 128, 49); } -static void *mayo2_new_key(void *provctx) -{ - return oqsx_key_new(PROV_OQS_LIBCTX_OF(provctx), OQS_SIG_alg_mayo_2, "mayo2", KEY_TYPE_SIG, NULL, 128, 50); +static void *mayo2_new_key(void *provctx) { + return oqsx_key_new(PROV_OQS_LIBCTX_OF(provctx), OQS_SIG_alg_mayo_2, + "mayo2", KEY_TYPE_SIG, NULL, 128, 50); } -static void *mayo2_gen_init(void *provctx, int selection) -{ - return oqsx_gen_init(provctx, selection, OQS_SIG_alg_mayo_2, "mayo2", 0, 128, 50); +static void *mayo2_gen_init(void *provctx, int selection) { + return oqsx_gen_init(provctx, selection, OQS_SIG_alg_mayo_2, "mayo2", 0, + 128, 50); } -static void *p256_mayo2_new_key(void *provctx) -{ - return oqsx_key_new(PROV_OQS_LIBCTX_OF(provctx), OQS_SIG_alg_mayo_2, "p256_mayo2", KEY_TYPE_HYB_SIG, NULL, 128, 51); +static void *p256_mayo2_new_key(void *provctx) { + return oqsx_key_new(PROV_OQS_LIBCTX_OF(provctx), OQS_SIG_alg_mayo_2, + "p256_mayo2", KEY_TYPE_HYB_SIG, NULL, 128, 51); } -static void *p256_mayo2_gen_init(void *provctx, int selection) -{ - return oqsx_gen_init(provctx, selection, OQS_SIG_alg_mayo_2, "p256_mayo2", KEY_TYPE_HYB_SIG, 128, 51); +static void *p256_mayo2_gen_init(void *provctx, int selection) { + return oqsx_gen_init(provctx, selection, OQS_SIG_alg_mayo_2, "p256_mayo2", + KEY_TYPE_HYB_SIG, 128, 51); } -static void *mayo3_new_key(void *provctx) -{ - return oqsx_key_new(PROV_OQS_LIBCTX_OF(provctx), OQS_SIG_alg_mayo_3, "mayo3", KEY_TYPE_SIG, NULL, 192, 52); +static void *mayo3_new_key(void *provctx) { + return oqsx_key_new(PROV_OQS_LIBCTX_OF(provctx), OQS_SIG_alg_mayo_3, + "mayo3", KEY_TYPE_SIG, NULL, 192, 52); } -static void *mayo3_gen_init(void *provctx, int selection) -{ - return oqsx_gen_init(provctx, selection, OQS_SIG_alg_mayo_3, "mayo3", 0, 192, 52); +static void *mayo3_gen_init(void *provctx, int selection) { + return oqsx_gen_init(provctx, selection, OQS_SIG_alg_mayo_3, "mayo3", 0, + 192, 52); } -static void *p384_mayo3_new_key(void *provctx) -{ - return oqsx_key_new(PROV_OQS_LIBCTX_OF(provctx), OQS_SIG_alg_mayo_3, "p384_mayo3", KEY_TYPE_HYB_SIG, NULL, 192, 53); +static void *p384_mayo3_new_key(void *provctx) { + return oqsx_key_new(PROV_OQS_LIBCTX_OF(provctx), OQS_SIG_alg_mayo_3, + "p384_mayo3", KEY_TYPE_HYB_SIG, NULL, 192, 53); } -static void *p384_mayo3_gen_init(void *provctx, int selection) -{ - return oqsx_gen_init(provctx, selection, OQS_SIG_alg_mayo_3, "p384_mayo3", KEY_TYPE_HYB_SIG, 192, 53); +static void *p384_mayo3_gen_init(void *provctx, int selection) { + return oqsx_gen_init(provctx, selection, OQS_SIG_alg_mayo_3, "p384_mayo3", + KEY_TYPE_HYB_SIG, 192, 53); } -static void *mayo5_new_key(void *provctx) -{ - return oqsx_key_new(PROV_OQS_LIBCTX_OF(provctx), OQS_SIG_alg_mayo_5, "mayo5", KEY_TYPE_SIG, NULL, 256, 54); +static void *mayo5_new_key(void *provctx) { + return oqsx_key_new(PROV_OQS_LIBCTX_OF(provctx), OQS_SIG_alg_mayo_5, + "mayo5", KEY_TYPE_SIG, NULL, 256, 54); } -static void *mayo5_gen_init(void *provctx, int selection) -{ - return oqsx_gen_init(provctx, selection, OQS_SIG_alg_mayo_5, "mayo5", 0, 256, 54); +static void *mayo5_gen_init(void *provctx, int selection) { + return oqsx_gen_init(provctx, selection, OQS_SIG_alg_mayo_5, "mayo5", 0, + 256, 54); } -static void *p521_mayo5_new_key(void *provctx) -{ - return oqsx_key_new(PROV_OQS_LIBCTX_OF(provctx), OQS_SIG_alg_mayo_5, "p521_mayo5", KEY_TYPE_HYB_SIG, NULL, 256, 55); +static void *p521_mayo5_new_key(void *provctx) { + return oqsx_key_new(PROV_OQS_LIBCTX_OF(provctx), OQS_SIG_alg_mayo_5, + "p521_mayo5", KEY_TYPE_HYB_SIG, NULL, 256, 55); } -static void *p521_mayo5_gen_init(void *provctx, int selection) -{ - return oqsx_gen_init(provctx, selection, OQS_SIG_alg_mayo_5, "p521_mayo5", KEY_TYPE_HYB_SIG, 256, 55); +static void *p521_mayo5_gen_init(void *provctx, int selection) { + return oqsx_gen_init(provctx, selection, OQS_SIG_alg_mayo_5, "p521_mayo5", + KEY_TYPE_HYB_SIG, 256, 55); } -static void *CROSSrsdp128balanced_new_key(void *provctx) -{ - return oqsx_key_new(PROV_OQS_LIBCTX_OF(provctx), OQS_SIG_alg_cross_rsdp_128_balanced, "CROSSrsdp128balanced", KEY_TYPE_SIG, NULL, 128, 56); +static void *CROSSrsdp128balanced_new_key(void *provctx) { + return oqsx_key_new(PROV_OQS_LIBCTX_OF(provctx), + OQS_SIG_alg_cross_rsdp_128_balanced, + "CROSSrsdp128balanced", KEY_TYPE_SIG, NULL, 128, 56); } -static void *CROSSrsdp128balanced_gen_init(void *provctx, int selection) -{ - return oqsx_gen_init(provctx, selection, OQS_SIG_alg_cross_rsdp_128_balanced, "CROSSrsdp128balanced", 0, 128, 56); +static void *CROSSrsdp128balanced_gen_init(void *provctx, int selection) { + return oqsx_gen_init(provctx, selection, + OQS_SIG_alg_cross_rsdp_128_balanced, + "CROSSrsdp128balanced", 0, 128, 56); } ///// OQS_TEMPLATE_FRAGMENT_KEYMGMT_CONSTRUCTORS_END -#define MAKE_SIG_KEYMGMT_FUNCTIONS(alg) \ - \ - const OSSL_DISPATCH oqs_##alg##_keymgmt_functions[] = { \ - {OSSL_FUNC_KEYMGMT_NEW, (void (*)(void))alg##_new_key}, \ - {OSSL_FUNC_KEYMGMT_FREE, (void (*)(void))oqsx_key_free}, \ - {OSSL_FUNC_KEYMGMT_GET_PARAMS, (void (*)(void))oqsx_get_params}, \ - {OSSL_FUNC_KEYMGMT_SETTABLE_PARAMS, \ - (void (*)(void))oqsx_settable_params}, \ - {OSSL_FUNC_KEYMGMT_GETTABLE_PARAMS, \ - (void (*)(void))oqs_gettable_params}, \ - {OSSL_FUNC_KEYMGMT_SET_PARAMS, (void (*)(void))oqsx_set_params}, \ - {OSSL_FUNC_KEYMGMT_HAS, (void (*)(void))oqsx_has}, \ - {OSSL_FUNC_KEYMGMT_MATCH, (void (*)(void))oqsx_match}, \ - {OSSL_FUNC_KEYMGMT_IMPORT, (void (*)(void))oqsx_import}, \ - {OSSL_FUNC_KEYMGMT_IMPORT_TYPES, (void (*)(void))oqs_imexport_types}, \ - {OSSL_FUNC_KEYMGMT_EXPORT, (void (*)(void))oqsx_export}, \ - {OSSL_FUNC_KEYMGMT_EXPORT_TYPES, (void (*)(void))oqs_imexport_types}, \ - {OSSL_FUNC_KEYMGMT_GEN_INIT, (void (*)(void))alg##_gen_init}, \ - {OSSL_FUNC_KEYMGMT_GEN, (void (*)(void))oqsx_gen}, \ - {OSSL_FUNC_KEYMGMT_GEN_CLEANUP, (void (*)(void))oqsx_gen_cleanup}, \ - {OSSL_FUNC_KEYMGMT_GEN_SET_PARAMS, \ - (void (*)(void))oqsx_gen_set_params}, \ - {OSSL_FUNC_KEYMGMT_GEN_SETTABLE_PARAMS, \ - (void (*)(void))oqsx_gen_settable_params}, \ - {OSSL_FUNC_KEYMGMT_LOAD, (void (*)(void))oqsx_load}, \ +#define MAKE_SIG_KEYMGMT_FUNCTIONS(alg) \ + \ + const OSSL_DISPATCH oqs_##alg##_keymgmt_functions[] = { \ + {OSSL_FUNC_KEYMGMT_NEW, (void (*)(void))alg##_new_key}, \ + {OSSL_FUNC_KEYMGMT_FREE, (void (*)(void))oqsx_key_free}, \ + {OSSL_FUNC_KEYMGMT_GET_PARAMS, (void (*)(void))oqsx_get_params}, \ + {OSSL_FUNC_KEYMGMT_SETTABLE_PARAMS, \ + (void (*)(void))oqsx_settable_params}, \ + {OSSL_FUNC_KEYMGMT_GETTABLE_PARAMS, \ + (void (*)(void))oqs_gettable_params}, \ + {OSSL_FUNC_KEYMGMT_SET_PARAMS, (void (*)(void))oqsx_set_params}, \ + {OSSL_FUNC_KEYMGMT_HAS, (void (*)(void))oqsx_has}, \ + {OSSL_FUNC_KEYMGMT_MATCH, (void (*)(void))oqsx_match}, \ + {OSSL_FUNC_KEYMGMT_IMPORT, (void (*)(void))oqsx_import}, \ + {OSSL_FUNC_KEYMGMT_IMPORT_TYPES, (void (*)(void))oqs_imexport_types}, \ + {OSSL_FUNC_KEYMGMT_EXPORT, (void (*)(void))oqsx_export}, \ + {OSSL_FUNC_KEYMGMT_EXPORT_TYPES, (void (*)(void))oqs_imexport_types}, \ + {OSSL_FUNC_KEYMGMT_GEN_INIT, (void (*)(void))alg##_gen_init}, \ + {OSSL_FUNC_KEYMGMT_GEN, (void (*)(void))oqsx_gen}, \ + {OSSL_FUNC_KEYMGMT_GEN_CLEANUP, (void (*)(void))oqsx_gen_cleanup}, \ + {OSSL_FUNC_KEYMGMT_GEN_SET_PARAMS, \ + (void (*)(void))oqsx_gen_set_params}, \ + {OSSL_FUNC_KEYMGMT_GEN_SETTABLE_PARAMS, \ + (void (*)(void))oqsx_gen_settable_params}, \ + {OSSL_FUNC_KEYMGMT_LOAD, (void (*)(void))oqsx_load}, \ {0, NULL}}; -#define MAKE_KEM_KEYMGMT_FUNCTIONS(tokalg, tokoqsalg, bit_security) \ - \ - static void *tokalg##_new_key(void *provctx) \ - { \ - return oqsx_key_new(PROV_OQS_LIBCTX_OF(provctx), tokoqsalg, \ - "" #tokalg "", KEY_TYPE_KEM, NULL, bit_security, \ - -1); \ - } \ - \ - static void *tokalg##_gen_init(void *provctx, int selection) \ - { \ - return oqsx_gen_init(provctx, selection, tokoqsalg, "" #tokalg "", \ - KEY_TYPE_KEM, bit_security, -1); \ - } \ - \ - const OSSL_DISPATCH oqs_##tokalg##_keymgmt_functions[] = { \ - {OSSL_FUNC_KEYMGMT_NEW, (void (*)(void))tokalg##_new_key}, \ - {OSSL_FUNC_KEYMGMT_FREE, (void (*)(void))oqsx_key_free}, \ - {OSSL_FUNC_KEYMGMT_GET_PARAMS, (void (*)(void))oqsx_get_params}, \ - {OSSL_FUNC_KEYMGMT_SETTABLE_PARAMS, \ - (void (*)(void))oqsx_settable_params}, \ - {OSSL_FUNC_KEYMGMT_GETTABLE_PARAMS, \ - (void (*)(void))oqs_gettable_params}, \ - {OSSL_FUNC_KEYMGMT_SET_PARAMS, (void (*)(void))oqsx_set_params}, \ - {OSSL_FUNC_KEYMGMT_HAS, (void (*)(void))oqsx_has}, \ - {OSSL_FUNC_KEYMGMT_MATCH, (void (*)(void))oqsx_match}, \ - {OSSL_FUNC_KEYMGMT_IMPORT, (void (*)(void))oqsx_import}, \ - {OSSL_FUNC_KEYMGMT_IMPORT_TYPES, (void (*)(void))oqs_imexport_types}, \ - {OSSL_FUNC_KEYMGMT_EXPORT, (void (*)(void))oqsx_export}, \ - {OSSL_FUNC_KEYMGMT_EXPORT_TYPES, (void (*)(void))oqs_imexport_types}, \ - {OSSL_FUNC_KEYMGMT_GEN_INIT, (void (*)(void))tokalg##_gen_init}, \ - {OSSL_FUNC_KEYMGMT_GEN, (void (*)(void))oqsx_gen}, \ - {OSSL_FUNC_KEYMGMT_GEN_CLEANUP, (void (*)(void))oqsx_gen_cleanup}, \ - {OSSL_FUNC_KEYMGMT_GEN_SET_PARAMS, \ - (void (*)(void))oqsx_gen_set_params}, \ - {OSSL_FUNC_KEYMGMT_GEN_SETTABLE_PARAMS, \ - (void (*)(void))oqsx_gen_settable_params}, \ - {OSSL_FUNC_KEYMGMT_LOAD, (void (*)(void))oqsx_load}, \ +#define MAKE_KEM_KEYMGMT_FUNCTIONS(tokalg, tokoqsalg, bit_security) \ + \ + static void *tokalg##_new_key(void *provctx) { \ + return oqsx_key_new(PROV_OQS_LIBCTX_OF(provctx), tokoqsalg, \ + "" #tokalg "", KEY_TYPE_KEM, NULL, bit_security, \ + -1); \ + } \ + \ + static void *tokalg##_gen_init(void *provctx, int selection) { \ + return oqsx_gen_init(provctx, selection, tokoqsalg, "" #tokalg "", \ + KEY_TYPE_KEM, bit_security, -1); \ + } \ + \ + const OSSL_DISPATCH oqs_##tokalg##_keymgmt_functions[] = { \ + {OSSL_FUNC_KEYMGMT_NEW, (void (*)(void))tokalg##_new_key}, \ + {OSSL_FUNC_KEYMGMT_FREE, (void (*)(void))oqsx_key_free}, \ + {OSSL_FUNC_KEYMGMT_GET_PARAMS, (void (*)(void))oqsx_get_params}, \ + {OSSL_FUNC_KEYMGMT_SETTABLE_PARAMS, \ + (void (*)(void))oqsx_settable_params}, \ + {OSSL_FUNC_KEYMGMT_GETTABLE_PARAMS, \ + (void (*)(void))oqs_gettable_params}, \ + {OSSL_FUNC_KEYMGMT_SET_PARAMS, (void (*)(void))oqsx_set_params}, \ + {OSSL_FUNC_KEYMGMT_HAS, (void (*)(void))oqsx_has}, \ + {OSSL_FUNC_KEYMGMT_MATCH, (void (*)(void))oqsx_match}, \ + {OSSL_FUNC_KEYMGMT_IMPORT, (void (*)(void))oqsx_import}, \ + {OSSL_FUNC_KEYMGMT_IMPORT_TYPES, (void (*)(void))oqs_imexport_types}, \ + {OSSL_FUNC_KEYMGMT_EXPORT, (void (*)(void))oqsx_export}, \ + {OSSL_FUNC_KEYMGMT_EXPORT_TYPES, (void (*)(void))oqs_imexport_types}, \ + {OSSL_FUNC_KEYMGMT_GEN_INIT, (void (*)(void))tokalg##_gen_init}, \ + {OSSL_FUNC_KEYMGMT_GEN, (void (*)(void))oqsx_gen}, \ + {OSSL_FUNC_KEYMGMT_GEN_CLEANUP, (void (*)(void))oqsx_gen_cleanup}, \ + {OSSL_FUNC_KEYMGMT_GEN_SET_PARAMS, \ + (void (*)(void))oqsx_gen_set_params}, \ + {OSSL_FUNC_KEYMGMT_GEN_SETTABLE_PARAMS, \ + (void (*)(void))oqsx_gen_settable_params}, \ + {OSSL_FUNC_KEYMGMT_LOAD, (void (*)(void))oqsx_load}, \ {0, NULL}}; #define MAKE_KEM_ECP_KEYMGMT_FUNCTIONS(tokalg, tokoqsalg, bit_security) \ \ - static void *ecp_##tokalg##_new_key(void *provctx) \ - { \ + static void *ecp_##tokalg##_new_key(void *provctx) { \ return oqsx_key_new(PROV_OQS_LIBCTX_OF(provctx), tokoqsalg, \ "" #tokalg "", KEY_TYPE_ECP_HYB_KEM, NULL, \ bit_security, -1); \ } \ \ - static void *ecp_##tokalg##_gen_init(void *provctx, int selection) \ - { \ + static void *ecp_##tokalg##_gen_init(void *provctx, int selection) { \ return oqsx_gen_init(provctx, selection, tokoqsalg, "" #tokalg "", \ KEY_TYPE_ECP_HYB_KEM, bit_security, -1); \ } \ @@ -1322,15 +1324,13 @@ static void *CROSSrsdp128balanced_gen_init(void *provctx, int selection) {0, NULL}}; #define MAKE_KEM_ECX_KEYMGMT_FUNCTIONS(tokalg, tokoqsalg, bit_security) \ - static void *ecx_##tokalg##_new_key(void *provctx) \ - { \ + static void *ecx_##tokalg##_new_key(void *provctx) { \ return oqsx_key_new(PROV_OQS_LIBCTX_OF(provctx), tokoqsalg, \ "" #tokalg "", KEY_TYPE_ECX_HYB_KEM, NULL, \ bit_security, -1); \ } \ \ - static void *ecx_##tokalg##_gen_init(void *provctx, int selection) \ - { \ + static void *ecx_##tokalg##_gen_init(void *provctx, int selection) { \ return oqsx_gen_init(provctx, selection, tokoqsalg, "" #tokalg "", \ KEY_TYPE_ECX_HYB_KEM, bit_security, -1); \ } \ @@ -1421,30 +1421,40 @@ MAKE_SIG_KEYMGMT_FUNCTIONS(CROSSrsdp128balanced) MAKE_KEM_KEYMGMT_FUNCTIONS(frodo640aes, OQS_KEM_alg_frodokem_640_aes, 128) -MAKE_KEM_ECP_KEYMGMT_FUNCTIONS(p256_frodo640aes, OQS_KEM_alg_frodokem_640_aes, 128) +MAKE_KEM_ECP_KEYMGMT_FUNCTIONS(p256_frodo640aes, OQS_KEM_alg_frodokem_640_aes, + 128) -MAKE_KEM_ECX_KEYMGMT_FUNCTIONS(x25519_frodo640aes, OQS_KEM_alg_frodokem_640_aes, 128) +MAKE_KEM_ECX_KEYMGMT_FUNCTIONS(x25519_frodo640aes, OQS_KEM_alg_frodokem_640_aes, + 128) MAKE_KEM_KEYMGMT_FUNCTIONS(frodo640shake, OQS_KEM_alg_frodokem_640_shake, 128) -MAKE_KEM_ECP_KEYMGMT_FUNCTIONS(p256_frodo640shake, OQS_KEM_alg_frodokem_640_shake, 128) +MAKE_KEM_ECP_KEYMGMT_FUNCTIONS(p256_frodo640shake, + OQS_KEM_alg_frodokem_640_shake, 128) -MAKE_KEM_ECX_KEYMGMT_FUNCTIONS(x25519_frodo640shake, OQS_KEM_alg_frodokem_640_shake, 128) +MAKE_KEM_ECX_KEYMGMT_FUNCTIONS(x25519_frodo640shake, + OQS_KEM_alg_frodokem_640_shake, 128) MAKE_KEM_KEYMGMT_FUNCTIONS(frodo976aes, OQS_KEM_alg_frodokem_976_aes, 192) -MAKE_KEM_ECP_KEYMGMT_FUNCTIONS(p384_frodo976aes, OQS_KEM_alg_frodokem_976_aes, 192) +MAKE_KEM_ECP_KEYMGMT_FUNCTIONS(p384_frodo976aes, OQS_KEM_alg_frodokem_976_aes, + 192) -MAKE_KEM_ECX_KEYMGMT_FUNCTIONS(x448_frodo976aes, OQS_KEM_alg_frodokem_976_aes, 192) +MAKE_KEM_ECX_KEYMGMT_FUNCTIONS(x448_frodo976aes, OQS_KEM_alg_frodokem_976_aes, + 192) MAKE_KEM_KEYMGMT_FUNCTIONS(frodo976shake, OQS_KEM_alg_frodokem_976_shake, 192) -MAKE_KEM_ECP_KEYMGMT_FUNCTIONS(p384_frodo976shake, OQS_KEM_alg_frodokem_976_shake, 192) +MAKE_KEM_ECP_KEYMGMT_FUNCTIONS(p384_frodo976shake, + OQS_KEM_alg_frodokem_976_shake, 192) -MAKE_KEM_ECX_KEYMGMT_FUNCTIONS(x448_frodo976shake, OQS_KEM_alg_frodokem_976_shake, 192) +MAKE_KEM_ECX_KEYMGMT_FUNCTIONS(x448_frodo976shake, + OQS_KEM_alg_frodokem_976_shake, 192) MAKE_KEM_KEYMGMT_FUNCTIONS(frodo1344aes, OQS_KEM_alg_frodokem_1344_aes, 256) -MAKE_KEM_ECP_KEYMGMT_FUNCTIONS(p521_frodo1344aes, OQS_KEM_alg_frodokem_1344_aes, 256) +MAKE_KEM_ECP_KEYMGMT_FUNCTIONS(p521_frodo1344aes, OQS_KEM_alg_frodokem_1344_aes, + 256) MAKE_KEM_KEYMGMT_FUNCTIONS(frodo1344shake, OQS_KEM_alg_frodokem_1344_shake, 256) -MAKE_KEM_ECP_KEYMGMT_FUNCTIONS(p521_frodo1344shake, OQS_KEM_alg_frodokem_1344_shake, 256) +MAKE_KEM_ECP_KEYMGMT_FUNCTIONS(p521_frodo1344shake, + OQS_KEM_alg_frodokem_1344_shake, 256) MAKE_KEM_KEYMGMT_FUNCTIONS(kyber512, OQS_KEM_alg_kyber_512, 128) MAKE_KEM_ECP_KEYMGMT_FUNCTIONS(p256_kyber512, OQS_KEM_alg_kyber_512, 128) diff --git a/oqsprov/oqs_prov.h b/oqsprov/oqs_prov.h index b8d6f494..046609ff 100644 --- a/oqsprov/oqs_prov.h +++ b/oqsprov/oqs_prov.h @@ -12,7 +12,7 @@ #define OQSX_H #ifndef OQS_PROVIDER_NOATOMIC -# include +#include #endif #include @@ -27,34 +27,34 @@ #define OSSL_NELEM(x) (sizeof(x) / sizeof((x)[0])) #ifdef _MSC_VER -# define strncasecmp _strnicmp -# define strcasecmp _stricmp +#define strncasecmp _strnicmp +#define strcasecmp _stricmp #endif /* oqsprovider error codes */ -#define OQSPROV_R_INVALID_DIGEST 1 -#define OQSPROV_R_INVALID_SIZE 2 -#define OQSPROV_R_INVALID_KEY 3 -#define OQSPROV_R_UNSUPPORTED 4 -#define OQSPROV_R_MISSING_OID 5 -#define OQSPROV_R_OBJ_CREATE_ERR 6 -#define OQSPROV_R_INVALID_ENCODING 7 -#define OQSPROV_R_SIGN_ERROR 8 -#define OQSPROV_R_LIB_CREATE_ERR 9 -#define OQSPROV_R_NO_PRIVATE_KEY 10 +#define OQSPROV_R_INVALID_DIGEST 1 +#define OQSPROV_R_INVALID_SIZE 2 +#define OQSPROV_R_INVALID_KEY 3 +#define OQSPROV_R_UNSUPPORTED 4 +#define OQSPROV_R_MISSING_OID 5 +#define OQSPROV_R_OBJ_CREATE_ERR 6 +#define OQSPROV_R_INVALID_ENCODING 7 +#define OQSPROV_R_SIGN_ERROR 8 +#define OQSPROV_R_LIB_CREATE_ERR 9 +#define OQSPROV_R_NO_PRIVATE_KEY 10 #define OQSPROV_R_BUFFER_LENGTH_WRONG 11 -#define OQSPROV_R_SIGNING_FAILED 12 -#define OQSPROV_R_WRONG_PARAMETERS 13 -#define OQSPROV_R_VERIFY_ERROR 14 -#define OQSPROV_R_EVPINFO_MISSING 15 -#define OQSPROV_R_INTERNAL_ERROR 16 +#define OQSPROV_R_SIGNING_FAILED 12 +#define OQSPROV_R_WRONG_PARAMETERS 13 +#define OQSPROV_R_VERIFY_ERROR 14 +#define OQSPROV_R_EVPINFO_MISSING 15 +#define OQSPROV_R_INTERNAL_ERROR 16 /* Extra OpenSSL parameters for hybrid EVP_PKEY. */ -#define OQS_HYBRID_PKEY_PARAM_CLASSICAL_PUB_KEY \ +#define OQS_HYBRID_PKEY_PARAM_CLASSICAL_PUB_KEY \ "hybrid_classical_" OSSL_PKEY_PARAM_PUB_KEY -#define OQS_HYBRID_PKEY_PARAM_CLASSICAL_PRIV_KEY \ +#define OQS_HYBRID_PKEY_PARAM_CLASSICAL_PRIV_KEY \ "hybrid_classical_" OSSL_PKEY_PARAM_PRIV_KEY -#define OQS_HYBRID_PKEY_PARAM_PQ_PUB_KEY "hybrid_pq_" OSSL_PKEY_PARAM_PUB_KEY +#define OQS_HYBRID_PKEY_PARAM_PQ_PUB_KEY "hybrid_pq_" OSSL_PKEY_PARAM_PUB_KEY #define OQS_HYBRID_PKEY_PARAM_PQ_PRIV_KEY "hybrid_pq_" OSSL_PKEY_PARAM_PRIV_KEY /* Extras for OQS extension */ @@ -74,15 +74,15 @@ i |= ((uint32_t)((unsigned char *)pbuf)[3]) // clang-format on -#define ON_ERR_SET_GOTO(condition, ret, code, gt) \ - if ((condition)) { \ - (ret) = (code); \ - goto gt; \ +#define ON_ERR_SET_GOTO(condition, ret, code, gt) \ + if ((condition)) { \ + (ret) = (code); \ + goto gt; \ } -#define ON_ERR_GOTO(condition, gt) \ - if ((condition)) { \ - goto gt; \ +#define ON_ERR_GOTO(condition, gt) \ + if ((condition)) { \ + goto gt; \ } typedef struct prov_oqs_ctx_st { @@ -94,12 +94,12 @@ typedef struct prov_oqs_ctx_st { PROV_OQS_CTX *oqsx_newprovctx(OSSL_LIB_CTX *libctx, const OSSL_CORE_HANDLE *handle, BIO_METHOD *bm); void oqsx_freeprovctx(PROV_OQS_CTX *ctx); -#define PROV_OQS_LIBCTX_OF(provctx) \ +#define PROV_OQS_LIBCTX_OF(provctx) \ provctx ? (((PROV_OQS_CTX *)provctx)->libctx) : NULL #include "oqs/oqs.h" #ifdef USE_ENCODING_LIB -# include +#include #endif /* helper structure for classic key components in hybrid keys. @@ -274,949 +274,1974 @@ extern const OSSL_DISPATCH oqs_signature_functions[]; ///// OQS_TEMPLATE_FRAGMENT_ENDECODER_FUNCTIONS_START #ifdef OQS_KEM_ENCODERS - -extern const OSSL_DISPATCH oqs_frodo640aes_to_PrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_frodo640aes_to_PrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_frodo640aes_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_frodo640aes_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_frodo640aes_to_SubjectPublicKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_frodo640aes_to_SubjectPublicKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_frodo640aes_to_PrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_frodo640aes_to_PrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_frodo640aes_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_frodo640aes_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_frodo640aes_to_SubjectPublicKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_frodo640aes_to_SubjectPublicKeyInfo_pem_encoder_functions[]; extern const OSSL_DISPATCH oqs_frodo640aes_to_text_encoder_functions[]; -extern const OSSL_DISPATCH oqs_PrivateKeyInfo_der_to_frodo640aes_decoder_functions[]; -extern const OSSL_DISPATCH oqs_SubjectPublicKeyInfo_der_to_frodo640aes_decoder_functions[];extern const OSSL_DISPATCH oqs_p256_frodo640aes_to_PrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p256_frodo640aes_to_PrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p256_frodo640aes_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p256_frodo640aes_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p256_frodo640aes_to_SubjectPublicKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p256_frodo640aes_to_SubjectPublicKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_PrivateKeyInfo_der_to_frodo640aes_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_SubjectPublicKeyInfo_der_to_frodo640aes_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_p256_frodo640aes_to_PrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_p256_frodo640aes_to_PrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_p256_frodo640aes_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_p256_frodo640aes_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_p256_frodo640aes_to_SubjectPublicKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_p256_frodo640aes_to_SubjectPublicKeyInfo_pem_encoder_functions[]; extern const OSSL_DISPATCH oqs_p256_frodo640aes_to_text_encoder_functions[]; -extern const OSSL_DISPATCH oqs_PrivateKeyInfo_der_to_p256_frodo640aes_decoder_functions[]; -extern const OSSL_DISPATCH oqs_SubjectPublicKeyInfo_der_to_p256_frodo640aes_decoder_functions[];extern const OSSL_DISPATCH oqs_x25519_frodo640aes_to_PrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_x25519_frodo640aes_to_PrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_x25519_frodo640aes_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_x25519_frodo640aes_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_x25519_frodo640aes_to_SubjectPublicKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_x25519_frodo640aes_to_SubjectPublicKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_PrivateKeyInfo_der_to_p256_frodo640aes_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_SubjectPublicKeyInfo_der_to_p256_frodo640aes_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_x25519_frodo640aes_to_PrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_x25519_frodo640aes_to_PrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_x25519_frodo640aes_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_x25519_frodo640aes_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_x25519_frodo640aes_to_SubjectPublicKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_x25519_frodo640aes_to_SubjectPublicKeyInfo_pem_encoder_functions[]; extern const OSSL_DISPATCH oqs_x25519_frodo640aes_to_text_encoder_functions[]; -extern const OSSL_DISPATCH oqs_PrivateKeyInfo_der_to_x25519_frodo640aes_decoder_functions[]; -extern const OSSL_DISPATCH oqs_SubjectPublicKeyInfo_der_to_x25519_frodo640aes_decoder_functions[]; -extern const OSSL_DISPATCH oqs_frodo640shake_to_PrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_frodo640shake_to_PrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_frodo640shake_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_frodo640shake_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_frodo640shake_to_SubjectPublicKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_frodo640shake_to_SubjectPublicKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_PrivateKeyInfo_der_to_x25519_frodo640aes_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_SubjectPublicKeyInfo_der_to_x25519_frodo640aes_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_frodo640shake_to_PrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_frodo640shake_to_PrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_frodo640shake_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_frodo640shake_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_frodo640shake_to_SubjectPublicKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_frodo640shake_to_SubjectPublicKeyInfo_pem_encoder_functions[]; extern const OSSL_DISPATCH oqs_frodo640shake_to_text_encoder_functions[]; -extern const OSSL_DISPATCH oqs_PrivateKeyInfo_der_to_frodo640shake_decoder_functions[]; -extern const OSSL_DISPATCH oqs_SubjectPublicKeyInfo_der_to_frodo640shake_decoder_functions[];extern const OSSL_DISPATCH oqs_p256_frodo640shake_to_PrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p256_frodo640shake_to_PrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p256_frodo640shake_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p256_frodo640shake_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p256_frodo640shake_to_SubjectPublicKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p256_frodo640shake_to_SubjectPublicKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_PrivateKeyInfo_der_to_frodo640shake_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_SubjectPublicKeyInfo_der_to_frodo640shake_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_p256_frodo640shake_to_PrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_p256_frodo640shake_to_PrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_p256_frodo640shake_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_p256_frodo640shake_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_p256_frodo640shake_to_SubjectPublicKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_p256_frodo640shake_to_SubjectPublicKeyInfo_pem_encoder_functions[]; extern const OSSL_DISPATCH oqs_p256_frodo640shake_to_text_encoder_functions[]; -extern const OSSL_DISPATCH oqs_PrivateKeyInfo_der_to_p256_frodo640shake_decoder_functions[]; -extern const OSSL_DISPATCH oqs_SubjectPublicKeyInfo_der_to_p256_frodo640shake_decoder_functions[];extern const OSSL_DISPATCH oqs_x25519_frodo640shake_to_PrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_x25519_frodo640shake_to_PrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_x25519_frodo640shake_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_x25519_frodo640shake_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_x25519_frodo640shake_to_SubjectPublicKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_x25519_frodo640shake_to_SubjectPublicKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_PrivateKeyInfo_der_to_p256_frodo640shake_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_SubjectPublicKeyInfo_der_to_p256_frodo640shake_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_x25519_frodo640shake_to_PrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_x25519_frodo640shake_to_PrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_x25519_frodo640shake_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_x25519_frodo640shake_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_x25519_frodo640shake_to_SubjectPublicKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_x25519_frodo640shake_to_SubjectPublicKeyInfo_pem_encoder_functions[]; extern const OSSL_DISPATCH oqs_x25519_frodo640shake_to_text_encoder_functions[]; -extern const OSSL_DISPATCH oqs_PrivateKeyInfo_der_to_x25519_frodo640shake_decoder_functions[]; -extern const OSSL_DISPATCH oqs_SubjectPublicKeyInfo_der_to_x25519_frodo640shake_decoder_functions[]; -extern const OSSL_DISPATCH oqs_frodo976aes_to_PrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_frodo976aes_to_PrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_frodo976aes_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_frodo976aes_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_frodo976aes_to_SubjectPublicKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_frodo976aes_to_SubjectPublicKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_PrivateKeyInfo_der_to_x25519_frodo640shake_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_SubjectPublicKeyInfo_der_to_x25519_frodo640shake_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_frodo976aes_to_PrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_frodo976aes_to_PrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_frodo976aes_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_frodo976aes_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_frodo976aes_to_SubjectPublicKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_frodo976aes_to_SubjectPublicKeyInfo_pem_encoder_functions[]; extern const OSSL_DISPATCH oqs_frodo976aes_to_text_encoder_functions[]; -extern const OSSL_DISPATCH oqs_PrivateKeyInfo_der_to_frodo976aes_decoder_functions[]; -extern const OSSL_DISPATCH oqs_SubjectPublicKeyInfo_der_to_frodo976aes_decoder_functions[];extern const OSSL_DISPATCH oqs_p384_frodo976aes_to_PrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p384_frodo976aes_to_PrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p384_frodo976aes_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p384_frodo976aes_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p384_frodo976aes_to_SubjectPublicKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p384_frodo976aes_to_SubjectPublicKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_PrivateKeyInfo_der_to_frodo976aes_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_SubjectPublicKeyInfo_der_to_frodo976aes_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_p384_frodo976aes_to_PrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_p384_frodo976aes_to_PrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_p384_frodo976aes_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_p384_frodo976aes_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_p384_frodo976aes_to_SubjectPublicKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_p384_frodo976aes_to_SubjectPublicKeyInfo_pem_encoder_functions[]; extern const OSSL_DISPATCH oqs_p384_frodo976aes_to_text_encoder_functions[]; -extern const OSSL_DISPATCH oqs_PrivateKeyInfo_der_to_p384_frodo976aes_decoder_functions[]; -extern const OSSL_DISPATCH oqs_SubjectPublicKeyInfo_der_to_p384_frodo976aes_decoder_functions[];extern const OSSL_DISPATCH oqs_x448_frodo976aes_to_PrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_x448_frodo976aes_to_PrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_x448_frodo976aes_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_x448_frodo976aes_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_x448_frodo976aes_to_SubjectPublicKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_x448_frodo976aes_to_SubjectPublicKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_PrivateKeyInfo_der_to_p384_frodo976aes_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_SubjectPublicKeyInfo_der_to_p384_frodo976aes_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_x448_frodo976aes_to_PrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_x448_frodo976aes_to_PrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_x448_frodo976aes_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_x448_frodo976aes_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_x448_frodo976aes_to_SubjectPublicKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_x448_frodo976aes_to_SubjectPublicKeyInfo_pem_encoder_functions[]; extern const OSSL_DISPATCH oqs_x448_frodo976aes_to_text_encoder_functions[]; -extern const OSSL_DISPATCH oqs_PrivateKeyInfo_der_to_x448_frodo976aes_decoder_functions[]; -extern const OSSL_DISPATCH oqs_SubjectPublicKeyInfo_der_to_x448_frodo976aes_decoder_functions[]; -extern const OSSL_DISPATCH oqs_frodo976shake_to_PrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_frodo976shake_to_PrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_frodo976shake_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_frodo976shake_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_frodo976shake_to_SubjectPublicKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_frodo976shake_to_SubjectPublicKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_PrivateKeyInfo_der_to_x448_frodo976aes_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_SubjectPublicKeyInfo_der_to_x448_frodo976aes_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_frodo976shake_to_PrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_frodo976shake_to_PrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_frodo976shake_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_frodo976shake_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_frodo976shake_to_SubjectPublicKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_frodo976shake_to_SubjectPublicKeyInfo_pem_encoder_functions[]; extern const OSSL_DISPATCH oqs_frodo976shake_to_text_encoder_functions[]; -extern const OSSL_DISPATCH oqs_PrivateKeyInfo_der_to_frodo976shake_decoder_functions[]; -extern const OSSL_DISPATCH oqs_SubjectPublicKeyInfo_der_to_frodo976shake_decoder_functions[];extern const OSSL_DISPATCH oqs_p384_frodo976shake_to_PrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p384_frodo976shake_to_PrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p384_frodo976shake_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p384_frodo976shake_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p384_frodo976shake_to_SubjectPublicKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p384_frodo976shake_to_SubjectPublicKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_PrivateKeyInfo_der_to_frodo976shake_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_SubjectPublicKeyInfo_der_to_frodo976shake_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_p384_frodo976shake_to_PrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_p384_frodo976shake_to_PrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_p384_frodo976shake_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_p384_frodo976shake_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_p384_frodo976shake_to_SubjectPublicKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_p384_frodo976shake_to_SubjectPublicKeyInfo_pem_encoder_functions[]; extern const OSSL_DISPATCH oqs_p384_frodo976shake_to_text_encoder_functions[]; -extern const OSSL_DISPATCH oqs_PrivateKeyInfo_der_to_p384_frodo976shake_decoder_functions[]; -extern const OSSL_DISPATCH oqs_SubjectPublicKeyInfo_der_to_p384_frodo976shake_decoder_functions[];extern const OSSL_DISPATCH oqs_x448_frodo976shake_to_PrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_x448_frodo976shake_to_PrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_x448_frodo976shake_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_x448_frodo976shake_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_x448_frodo976shake_to_SubjectPublicKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_x448_frodo976shake_to_SubjectPublicKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_PrivateKeyInfo_der_to_p384_frodo976shake_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_SubjectPublicKeyInfo_der_to_p384_frodo976shake_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_x448_frodo976shake_to_PrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_x448_frodo976shake_to_PrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_x448_frodo976shake_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_x448_frodo976shake_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_x448_frodo976shake_to_SubjectPublicKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_x448_frodo976shake_to_SubjectPublicKeyInfo_pem_encoder_functions[]; extern const OSSL_DISPATCH oqs_x448_frodo976shake_to_text_encoder_functions[]; -extern const OSSL_DISPATCH oqs_PrivateKeyInfo_der_to_x448_frodo976shake_decoder_functions[]; -extern const OSSL_DISPATCH oqs_SubjectPublicKeyInfo_der_to_x448_frodo976shake_decoder_functions[]; -extern const OSSL_DISPATCH oqs_frodo1344aes_to_PrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_frodo1344aes_to_PrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_frodo1344aes_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_frodo1344aes_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_frodo1344aes_to_SubjectPublicKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_frodo1344aes_to_SubjectPublicKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_PrivateKeyInfo_der_to_x448_frodo976shake_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_SubjectPublicKeyInfo_der_to_x448_frodo976shake_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_frodo1344aes_to_PrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_frodo1344aes_to_PrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_frodo1344aes_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_frodo1344aes_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_frodo1344aes_to_SubjectPublicKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_frodo1344aes_to_SubjectPublicKeyInfo_pem_encoder_functions[]; extern const OSSL_DISPATCH oqs_frodo1344aes_to_text_encoder_functions[]; -extern const OSSL_DISPATCH oqs_PrivateKeyInfo_der_to_frodo1344aes_decoder_functions[]; -extern const OSSL_DISPATCH oqs_SubjectPublicKeyInfo_der_to_frodo1344aes_decoder_functions[];extern const OSSL_DISPATCH oqs_p521_frodo1344aes_to_PrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p521_frodo1344aes_to_PrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p521_frodo1344aes_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p521_frodo1344aes_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p521_frodo1344aes_to_SubjectPublicKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p521_frodo1344aes_to_SubjectPublicKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_PrivateKeyInfo_der_to_frodo1344aes_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_SubjectPublicKeyInfo_der_to_frodo1344aes_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_p521_frodo1344aes_to_PrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_p521_frodo1344aes_to_PrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_p521_frodo1344aes_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_p521_frodo1344aes_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_p521_frodo1344aes_to_SubjectPublicKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_p521_frodo1344aes_to_SubjectPublicKeyInfo_pem_encoder_functions[]; extern const OSSL_DISPATCH oqs_p521_frodo1344aes_to_text_encoder_functions[]; -extern const OSSL_DISPATCH oqs_PrivateKeyInfo_der_to_p521_frodo1344aes_decoder_functions[]; -extern const OSSL_DISPATCH oqs_SubjectPublicKeyInfo_der_to_p521_frodo1344aes_decoder_functions[]; -extern const OSSL_DISPATCH oqs_frodo1344shake_to_PrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_frodo1344shake_to_PrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_frodo1344shake_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_frodo1344shake_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_frodo1344shake_to_SubjectPublicKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_frodo1344shake_to_SubjectPublicKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_PrivateKeyInfo_der_to_p521_frodo1344aes_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_SubjectPublicKeyInfo_der_to_p521_frodo1344aes_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_frodo1344shake_to_PrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_frodo1344shake_to_PrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_frodo1344shake_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_frodo1344shake_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_frodo1344shake_to_SubjectPublicKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_frodo1344shake_to_SubjectPublicKeyInfo_pem_encoder_functions[]; extern const OSSL_DISPATCH oqs_frodo1344shake_to_text_encoder_functions[]; -extern const OSSL_DISPATCH oqs_PrivateKeyInfo_der_to_frodo1344shake_decoder_functions[]; -extern const OSSL_DISPATCH oqs_SubjectPublicKeyInfo_der_to_frodo1344shake_decoder_functions[];extern const OSSL_DISPATCH oqs_p521_frodo1344shake_to_PrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p521_frodo1344shake_to_PrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p521_frodo1344shake_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p521_frodo1344shake_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p521_frodo1344shake_to_SubjectPublicKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p521_frodo1344shake_to_SubjectPublicKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_PrivateKeyInfo_der_to_frodo1344shake_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_SubjectPublicKeyInfo_der_to_frodo1344shake_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_p521_frodo1344shake_to_PrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_p521_frodo1344shake_to_PrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_p521_frodo1344shake_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_p521_frodo1344shake_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_p521_frodo1344shake_to_SubjectPublicKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_p521_frodo1344shake_to_SubjectPublicKeyInfo_pem_encoder_functions[]; extern const OSSL_DISPATCH oqs_p521_frodo1344shake_to_text_encoder_functions[]; -extern const OSSL_DISPATCH oqs_PrivateKeyInfo_der_to_p521_frodo1344shake_decoder_functions[]; -extern const OSSL_DISPATCH oqs_SubjectPublicKeyInfo_der_to_p521_frodo1344shake_decoder_functions[]; -extern const OSSL_DISPATCH oqs_kyber512_to_PrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_kyber512_to_PrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_kyber512_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_kyber512_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_kyber512_to_SubjectPublicKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_kyber512_to_SubjectPublicKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_PrivateKeyInfo_der_to_p521_frodo1344shake_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_SubjectPublicKeyInfo_der_to_p521_frodo1344shake_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_kyber512_to_PrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_kyber512_to_PrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_kyber512_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_kyber512_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_kyber512_to_SubjectPublicKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_kyber512_to_SubjectPublicKeyInfo_pem_encoder_functions[]; extern const OSSL_DISPATCH oqs_kyber512_to_text_encoder_functions[]; -extern const OSSL_DISPATCH oqs_PrivateKeyInfo_der_to_kyber512_decoder_functions[]; -extern const OSSL_DISPATCH oqs_SubjectPublicKeyInfo_der_to_kyber512_decoder_functions[];extern const OSSL_DISPATCH oqs_p256_kyber512_to_PrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p256_kyber512_to_PrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p256_kyber512_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p256_kyber512_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p256_kyber512_to_SubjectPublicKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p256_kyber512_to_SubjectPublicKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_PrivateKeyInfo_der_to_kyber512_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_SubjectPublicKeyInfo_der_to_kyber512_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_p256_kyber512_to_PrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_p256_kyber512_to_PrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_p256_kyber512_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_p256_kyber512_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_p256_kyber512_to_SubjectPublicKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_p256_kyber512_to_SubjectPublicKeyInfo_pem_encoder_functions[]; extern const OSSL_DISPATCH oqs_p256_kyber512_to_text_encoder_functions[]; -extern const OSSL_DISPATCH oqs_PrivateKeyInfo_der_to_p256_kyber512_decoder_functions[]; -extern const OSSL_DISPATCH oqs_SubjectPublicKeyInfo_der_to_p256_kyber512_decoder_functions[];extern const OSSL_DISPATCH oqs_x25519_kyber512_to_PrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_x25519_kyber512_to_PrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_x25519_kyber512_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_x25519_kyber512_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_x25519_kyber512_to_SubjectPublicKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_x25519_kyber512_to_SubjectPublicKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_PrivateKeyInfo_der_to_p256_kyber512_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_SubjectPublicKeyInfo_der_to_p256_kyber512_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_x25519_kyber512_to_PrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_x25519_kyber512_to_PrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_x25519_kyber512_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_x25519_kyber512_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_x25519_kyber512_to_SubjectPublicKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_x25519_kyber512_to_SubjectPublicKeyInfo_pem_encoder_functions[]; extern const OSSL_DISPATCH oqs_x25519_kyber512_to_text_encoder_functions[]; -extern const OSSL_DISPATCH oqs_PrivateKeyInfo_der_to_x25519_kyber512_decoder_functions[]; -extern const OSSL_DISPATCH oqs_SubjectPublicKeyInfo_der_to_x25519_kyber512_decoder_functions[]; -extern const OSSL_DISPATCH oqs_kyber768_to_PrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_kyber768_to_PrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_kyber768_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_kyber768_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_kyber768_to_SubjectPublicKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_kyber768_to_SubjectPublicKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_PrivateKeyInfo_der_to_x25519_kyber512_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_SubjectPublicKeyInfo_der_to_x25519_kyber512_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_kyber768_to_PrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_kyber768_to_PrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_kyber768_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_kyber768_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_kyber768_to_SubjectPublicKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_kyber768_to_SubjectPublicKeyInfo_pem_encoder_functions[]; extern const OSSL_DISPATCH oqs_kyber768_to_text_encoder_functions[]; -extern const OSSL_DISPATCH oqs_PrivateKeyInfo_der_to_kyber768_decoder_functions[]; -extern const OSSL_DISPATCH oqs_SubjectPublicKeyInfo_der_to_kyber768_decoder_functions[];extern const OSSL_DISPATCH oqs_p384_kyber768_to_PrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p384_kyber768_to_PrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p384_kyber768_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p384_kyber768_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p384_kyber768_to_SubjectPublicKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p384_kyber768_to_SubjectPublicKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_PrivateKeyInfo_der_to_kyber768_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_SubjectPublicKeyInfo_der_to_kyber768_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_p384_kyber768_to_PrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_p384_kyber768_to_PrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_p384_kyber768_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_p384_kyber768_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_p384_kyber768_to_SubjectPublicKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_p384_kyber768_to_SubjectPublicKeyInfo_pem_encoder_functions[]; extern const OSSL_DISPATCH oqs_p384_kyber768_to_text_encoder_functions[]; -extern const OSSL_DISPATCH oqs_PrivateKeyInfo_der_to_p384_kyber768_decoder_functions[]; -extern const OSSL_DISPATCH oqs_SubjectPublicKeyInfo_der_to_p384_kyber768_decoder_functions[];extern const OSSL_DISPATCH oqs_x448_kyber768_to_PrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_x448_kyber768_to_PrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_x448_kyber768_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_x448_kyber768_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_x448_kyber768_to_SubjectPublicKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_x448_kyber768_to_SubjectPublicKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_PrivateKeyInfo_der_to_p384_kyber768_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_SubjectPublicKeyInfo_der_to_p384_kyber768_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_x448_kyber768_to_PrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_x448_kyber768_to_PrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_x448_kyber768_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_x448_kyber768_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_x448_kyber768_to_SubjectPublicKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_x448_kyber768_to_SubjectPublicKeyInfo_pem_encoder_functions[]; extern const OSSL_DISPATCH oqs_x448_kyber768_to_text_encoder_functions[]; -extern const OSSL_DISPATCH oqs_PrivateKeyInfo_der_to_x448_kyber768_decoder_functions[]; -extern const OSSL_DISPATCH oqs_SubjectPublicKeyInfo_der_to_x448_kyber768_decoder_functions[];extern const OSSL_DISPATCH oqs_x25519_kyber768_to_PrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_x25519_kyber768_to_PrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_x25519_kyber768_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_x25519_kyber768_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_x25519_kyber768_to_SubjectPublicKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_x25519_kyber768_to_SubjectPublicKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_PrivateKeyInfo_der_to_x448_kyber768_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_SubjectPublicKeyInfo_der_to_x448_kyber768_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_x25519_kyber768_to_PrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_x25519_kyber768_to_PrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_x25519_kyber768_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_x25519_kyber768_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_x25519_kyber768_to_SubjectPublicKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_x25519_kyber768_to_SubjectPublicKeyInfo_pem_encoder_functions[]; extern const OSSL_DISPATCH oqs_x25519_kyber768_to_text_encoder_functions[]; -extern const OSSL_DISPATCH oqs_PrivateKeyInfo_der_to_x25519_kyber768_decoder_functions[]; -extern const OSSL_DISPATCH oqs_SubjectPublicKeyInfo_der_to_x25519_kyber768_decoder_functions[];extern const OSSL_DISPATCH oqs_p256_kyber768_to_PrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p256_kyber768_to_PrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p256_kyber768_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p256_kyber768_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p256_kyber768_to_SubjectPublicKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p256_kyber768_to_SubjectPublicKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_PrivateKeyInfo_der_to_x25519_kyber768_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_SubjectPublicKeyInfo_der_to_x25519_kyber768_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_p256_kyber768_to_PrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_p256_kyber768_to_PrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_p256_kyber768_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_p256_kyber768_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_p256_kyber768_to_SubjectPublicKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_p256_kyber768_to_SubjectPublicKeyInfo_pem_encoder_functions[]; extern const OSSL_DISPATCH oqs_p256_kyber768_to_text_encoder_functions[]; -extern const OSSL_DISPATCH oqs_PrivateKeyInfo_der_to_p256_kyber768_decoder_functions[]; -extern const OSSL_DISPATCH oqs_SubjectPublicKeyInfo_der_to_p256_kyber768_decoder_functions[]; -extern const OSSL_DISPATCH oqs_kyber1024_to_PrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_kyber1024_to_PrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_kyber1024_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_kyber1024_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_kyber1024_to_SubjectPublicKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_kyber1024_to_SubjectPublicKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_PrivateKeyInfo_der_to_p256_kyber768_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_SubjectPublicKeyInfo_der_to_p256_kyber768_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_kyber1024_to_PrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_kyber1024_to_PrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_kyber1024_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_kyber1024_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_kyber1024_to_SubjectPublicKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_kyber1024_to_SubjectPublicKeyInfo_pem_encoder_functions[]; extern const OSSL_DISPATCH oqs_kyber1024_to_text_encoder_functions[]; -extern const OSSL_DISPATCH oqs_PrivateKeyInfo_der_to_kyber1024_decoder_functions[]; -extern const OSSL_DISPATCH oqs_SubjectPublicKeyInfo_der_to_kyber1024_decoder_functions[];extern const OSSL_DISPATCH oqs_p521_kyber1024_to_PrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p521_kyber1024_to_PrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p521_kyber1024_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p521_kyber1024_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p521_kyber1024_to_SubjectPublicKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p521_kyber1024_to_SubjectPublicKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_PrivateKeyInfo_der_to_kyber1024_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_SubjectPublicKeyInfo_der_to_kyber1024_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_p521_kyber1024_to_PrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_p521_kyber1024_to_PrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_p521_kyber1024_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_p521_kyber1024_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_p521_kyber1024_to_SubjectPublicKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_p521_kyber1024_to_SubjectPublicKeyInfo_pem_encoder_functions[]; extern const OSSL_DISPATCH oqs_p521_kyber1024_to_text_encoder_functions[]; -extern const OSSL_DISPATCH oqs_PrivateKeyInfo_der_to_p521_kyber1024_decoder_functions[]; -extern const OSSL_DISPATCH oqs_SubjectPublicKeyInfo_der_to_p521_kyber1024_decoder_functions[]; -extern const OSSL_DISPATCH oqs_mlkem512_to_PrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_mlkem512_to_PrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_mlkem512_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_mlkem512_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_mlkem512_to_SubjectPublicKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_mlkem512_to_SubjectPublicKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_PrivateKeyInfo_der_to_p521_kyber1024_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_SubjectPublicKeyInfo_der_to_p521_kyber1024_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_mlkem512_to_PrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_mlkem512_to_PrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_mlkem512_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_mlkem512_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_mlkem512_to_SubjectPublicKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_mlkem512_to_SubjectPublicKeyInfo_pem_encoder_functions[]; extern const OSSL_DISPATCH oqs_mlkem512_to_text_encoder_functions[]; -extern const OSSL_DISPATCH oqs_PrivateKeyInfo_der_to_mlkem512_decoder_functions[]; -extern const OSSL_DISPATCH oqs_SubjectPublicKeyInfo_der_to_mlkem512_decoder_functions[];extern const OSSL_DISPATCH oqs_p256_mlkem512_to_PrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p256_mlkem512_to_PrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p256_mlkem512_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p256_mlkem512_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p256_mlkem512_to_SubjectPublicKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p256_mlkem512_to_SubjectPublicKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_PrivateKeyInfo_der_to_mlkem512_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_SubjectPublicKeyInfo_der_to_mlkem512_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_p256_mlkem512_to_PrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_p256_mlkem512_to_PrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_p256_mlkem512_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_p256_mlkem512_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_p256_mlkem512_to_SubjectPublicKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_p256_mlkem512_to_SubjectPublicKeyInfo_pem_encoder_functions[]; extern const OSSL_DISPATCH oqs_p256_mlkem512_to_text_encoder_functions[]; -extern const OSSL_DISPATCH oqs_PrivateKeyInfo_der_to_p256_mlkem512_decoder_functions[]; -extern const OSSL_DISPATCH oqs_SubjectPublicKeyInfo_der_to_p256_mlkem512_decoder_functions[];extern const OSSL_DISPATCH oqs_x25519_mlkem512_to_PrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_x25519_mlkem512_to_PrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_x25519_mlkem512_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_x25519_mlkem512_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_x25519_mlkem512_to_SubjectPublicKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_x25519_mlkem512_to_SubjectPublicKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_PrivateKeyInfo_der_to_p256_mlkem512_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_SubjectPublicKeyInfo_der_to_p256_mlkem512_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_x25519_mlkem512_to_PrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_x25519_mlkem512_to_PrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_x25519_mlkem512_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_x25519_mlkem512_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_x25519_mlkem512_to_SubjectPublicKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_x25519_mlkem512_to_SubjectPublicKeyInfo_pem_encoder_functions[]; extern const OSSL_DISPATCH oqs_x25519_mlkem512_to_text_encoder_functions[]; -extern const OSSL_DISPATCH oqs_PrivateKeyInfo_der_to_x25519_mlkem512_decoder_functions[]; -extern const OSSL_DISPATCH oqs_SubjectPublicKeyInfo_der_to_x25519_mlkem512_decoder_functions[]; -extern const OSSL_DISPATCH oqs_mlkem768_to_PrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_mlkem768_to_PrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_mlkem768_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_mlkem768_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_mlkem768_to_SubjectPublicKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_mlkem768_to_SubjectPublicKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_PrivateKeyInfo_der_to_x25519_mlkem512_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_SubjectPublicKeyInfo_der_to_x25519_mlkem512_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_mlkem768_to_PrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_mlkem768_to_PrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_mlkem768_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_mlkem768_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_mlkem768_to_SubjectPublicKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_mlkem768_to_SubjectPublicKeyInfo_pem_encoder_functions[]; extern const OSSL_DISPATCH oqs_mlkem768_to_text_encoder_functions[]; -extern const OSSL_DISPATCH oqs_PrivateKeyInfo_der_to_mlkem768_decoder_functions[]; -extern const OSSL_DISPATCH oqs_SubjectPublicKeyInfo_der_to_mlkem768_decoder_functions[];extern const OSSL_DISPATCH oqs_p384_mlkem768_to_PrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p384_mlkem768_to_PrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p384_mlkem768_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p384_mlkem768_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p384_mlkem768_to_SubjectPublicKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p384_mlkem768_to_SubjectPublicKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_PrivateKeyInfo_der_to_mlkem768_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_SubjectPublicKeyInfo_der_to_mlkem768_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_p384_mlkem768_to_PrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_p384_mlkem768_to_PrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_p384_mlkem768_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_p384_mlkem768_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_p384_mlkem768_to_SubjectPublicKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_p384_mlkem768_to_SubjectPublicKeyInfo_pem_encoder_functions[]; extern const OSSL_DISPATCH oqs_p384_mlkem768_to_text_encoder_functions[]; -extern const OSSL_DISPATCH oqs_PrivateKeyInfo_der_to_p384_mlkem768_decoder_functions[]; -extern const OSSL_DISPATCH oqs_SubjectPublicKeyInfo_der_to_p384_mlkem768_decoder_functions[];extern const OSSL_DISPATCH oqs_x448_mlkem768_to_PrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_x448_mlkem768_to_PrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_x448_mlkem768_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_x448_mlkem768_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_x448_mlkem768_to_SubjectPublicKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_x448_mlkem768_to_SubjectPublicKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_PrivateKeyInfo_der_to_p384_mlkem768_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_SubjectPublicKeyInfo_der_to_p384_mlkem768_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_x448_mlkem768_to_PrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_x448_mlkem768_to_PrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_x448_mlkem768_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_x448_mlkem768_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_x448_mlkem768_to_SubjectPublicKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_x448_mlkem768_to_SubjectPublicKeyInfo_pem_encoder_functions[]; extern const OSSL_DISPATCH oqs_x448_mlkem768_to_text_encoder_functions[]; -extern const OSSL_DISPATCH oqs_PrivateKeyInfo_der_to_x448_mlkem768_decoder_functions[]; -extern const OSSL_DISPATCH oqs_SubjectPublicKeyInfo_der_to_x448_mlkem768_decoder_functions[];extern const OSSL_DISPATCH oqs_x25519_mlkem768_to_PrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_x25519_mlkem768_to_PrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_x25519_mlkem768_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_x25519_mlkem768_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_x25519_mlkem768_to_SubjectPublicKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_x25519_mlkem768_to_SubjectPublicKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_PrivateKeyInfo_der_to_x448_mlkem768_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_SubjectPublicKeyInfo_der_to_x448_mlkem768_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_x25519_mlkem768_to_PrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_x25519_mlkem768_to_PrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_x25519_mlkem768_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_x25519_mlkem768_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_x25519_mlkem768_to_SubjectPublicKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_x25519_mlkem768_to_SubjectPublicKeyInfo_pem_encoder_functions[]; extern const OSSL_DISPATCH oqs_x25519_mlkem768_to_text_encoder_functions[]; -extern const OSSL_DISPATCH oqs_PrivateKeyInfo_der_to_x25519_mlkem768_decoder_functions[]; -extern const OSSL_DISPATCH oqs_SubjectPublicKeyInfo_der_to_x25519_mlkem768_decoder_functions[];extern const OSSL_DISPATCH oqs_p256_mlkem768_to_PrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p256_mlkem768_to_PrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p256_mlkem768_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p256_mlkem768_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p256_mlkem768_to_SubjectPublicKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p256_mlkem768_to_SubjectPublicKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_PrivateKeyInfo_der_to_x25519_mlkem768_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_SubjectPublicKeyInfo_der_to_x25519_mlkem768_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_p256_mlkem768_to_PrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_p256_mlkem768_to_PrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_p256_mlkem768_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_p256_mlkem768_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_p256_mlkem768_to_SubjectPublicKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_p256_mlkem768_to_SubjectPublicKeyInfo_pem_encoder_functions[]; extern const OSSL_DISPATCH oqs_p256_mlkem768_to_text_encoder_functions[]; -extern const OSSL_DISPATCH oqs_PrivateKeyInfo_der_to_p256_mlkem768_decoder_functions[]; -extern const OSSL_DISPATCH oqs_SubjectPublicKeyInfo_der_to_p256_mlkem768_decoder_functions[]; -extern const OSSL_DISPATCH oqs_mlkem1024_to_PrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_mlkem1024_to_PrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_mlkem1024_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_mlkem1024_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_mlkem1024_to_SubjectPublicKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_mlkem1024_to_SubjectPublicKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_PrivateKeyInfo_der_to_p256_mlkem768_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_SubjectPublicKeyInfo_der_to_p256_mlkem768_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_mlkem1024_to_PrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_mlkem1024_to_PrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_mlkem1024_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_mlkem1024_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_mlkem1024_to_SubjectPublicKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_mlkem1024_to_SubjectPublicKeyInfo_pem_encoder_functions[]; extern const OSSL_DISPATCH oqs_mlkem1024_to_text_encoder_functions[]; -extern const OSSL_DISPATCH oqs_PrivateKeyInfo_der_to_mlkem1024_decoder_functions[]; -extern const OSSL_DISPATCH oqs_SubjectPublicKeyInfo_der_to_mlkem1024_decoder_functions[];extern const OSSL_DISPATCH oqs_p521_mlkem1024_to_PrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p521_mlkem1024_to_PrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p521_mlkem1024_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p521_mlkem1024_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p521_mlkem1024_to_SubjectPublicKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p521_mlkem1024_to_SubjectPublicKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_PrivateKeyInfo_der_to_mlkem1024_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_SubjectPublicKeyInfo_der_to_mlkem1024_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_p521_mlkem1024_to_PrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_p521_mlkem1024_to_PrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_p521_mlkem1024_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_p521_mlkem1024_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_p521_mlkem1024_to_SubjectPublicKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_p521_mlkem1024_to_SubjectPublicKeyInfo_pem_encoder_functions[]; extern const OSSL_DISPATCH oqs_p521_mlkem1024_to_text_encoder_functions[]; -extern const OSSL_DISPATCH oqs_PrivateKeyInfo_der_to_p521_mlkem1024_decoder_functions[]; -extern const OSSL_DISPATCH oqs_SubjectPublicKeyInfo_der_to_p521_mlkem1024_decoder_functions[];extern const OSSL_DISPATCH oqs_p384_mlkem1024_to_PrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p384_mlkem1024_to_PrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p384_mlkem1024_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p384_mlkem1024_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p384_mlkem1024_to_SubjectPublicKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p384_mlkem1024_to_SubjectPublicKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_PrivateKeyInfo_der_to_p521_mlkem1024_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_SubjectPublicKeyInfo_der_to_p521_mlkem1024_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_p384_mlkem1024_to_PrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_p384_mlkem1024_to_PrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_p384_mlkem1024_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_p384_mlkem1024_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_p384_mlkem1024_to_SubjectPublicKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_p384_mlkem1024_to_SubjectPublicKeyInfo_pem_encoder_functions[]; extern const OSSL_DISPATCH oqs_p384_mlkem1024_to_text_encoder_functions[]; -extern const OSSL_DISPATCH oqs_PrivateKeyInfo_der_to_p384_mlkem1024_decoder_functions[]; -extern const OSSL_DISPATCH oqs_SubjectPublicKeyInfo_der_to_p384_mlkem1024_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_PrivateKeyInfo_der_to_p384_mlkem1024_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_SubjectPublicKeyInfo_der_to_p384_mlkem1024_decoder_functions[]; extern const OSSL_DISPATCH oqs_bikel1_to_PrivateKeyInfo_der_encoder_functions[]; extern const OSSL_DISPATCH oqs_bikel1_to_PrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_bikel1_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_bikel1_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_bikel1_to_SubjectPublicKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_bikel1_to_SubjectPublicKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_bikel1_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_bikel1_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_bikel1_to_SubjectPublicKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_bikel1_to_SubjectPublicKeyInfo_pem_encoder_functions[]; extern const OSSL_DISPATCH oqs_bikel1_to_text_encoder_functions[]; extern const OSSL_DISPATCH oqs_PrivateKeyInfo_der_to_bikel1_decoder_functions[]; -extern const OSSL_DISPATCH oqs_SubjectPublicKeyInfo_der_to_bikel1_decoder_functions[];extern const OSSL_DISPATCH oqs_p256_bikel1_to_PrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p256_bikel1_to_PrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p256_bikel1_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p256_bikel1_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p256_bikel1_to_SubjectPublicKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p256_bikel1_to_SubjectPublicKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_SubjectPublicKeyInfo_der_to_bikel1_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_p256_bikel1_to_PrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_p256_bikel1_to_PrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_p256_bikel1_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_p256_bikel1_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_p256_bikel1_to_SubjectPublicKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_p256_bikel1_to_SubjectPublicKeyInfo_pem_encoder_functions[]; extern const OSSL_DISPATCH oqs_p256_bikel1_to_text_encoder_functions[]; -extern const OSSL_DISPATCH oqs_PrivateKeyInfo_der_to_p256_bikel1_decoder_functions[]; -extern const OSSL_DISPATCH oqs_SubjectPublicKeyInfo_der_to_p256_bikel1_decoder_functions[];extern const OSSL_DISPATCH oqs_x25519_bikel1_to_PrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_x25519_bikel1_to_PrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_x25519_bikel1_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_x25519_bikel1_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_x25519_bikel1_to_SubjectPublicKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_x25519_bikel1_to_SubjectPublicKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_PrivateKeyInfo_der_to_p256_bikel1_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_SubjectPublicKeyInfo_der_to_p256_bikel1_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_x25519_bikel1_to_PrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_x25519_bikel1_to_PrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_x25519_bikel1_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_x25519_bikel1_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_x25519_bikel1_to_SubjectPublicKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_x25519_bikel1_to_SubjectPublicKeyInfo_pem_encoder_functions[]; extern const OSSL_DISPATCH oqs_x25519_bikel1_to_text_encoder_functions[]; -extern const OSSL_DISPATCH oqs_PrivateKeyInfo_der_to_x25519_bikel1_decoder_functions[]; -extern const OSSL_DISPATCH oqs_SubjectPublicKeyInfo_der_to_x25519_bikel1_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_PrivateKeyInfo_der_to_x25519_bikel1_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_SubjectPublicKeyInfo_der_to_x25519_bikel1_decoder_functions[]; extern const OSSL_DISPATCH oqs_bikel3_to_PrivateKeyInfo_der_encoder_functions[]; extern const OSSL_DISPATCH oqs_bikel3_to_PrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_bikel3_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_bikel3_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_bikel3_to_SubjectPublicKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_bikel3_to_SubjectPublicKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_bikel3_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_bikel3_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_bikel3_to_SubjectPublicKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_bikel3_to_SubjectPublicKeyInfo_pem_encoder_functions[]; extern const OSSL_DISPATCH oqs_bikel3_to_text_encoder_functions[]; extern const OSSL_DISPATCH oqs_PrivateKeyInfo_der_to_bikel3_decoder_functions[]; -extern const OSSL_DISPATCH oqs_SubjectPublicKeyInfo_der_to_bikel3_decoder_functions[];extern const OSSL_DISPATCH oqs_p384_bikel3_to_PrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p384_bikel3_to_PrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p384_bikel3_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p384_bikel3_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p384_bikel3_to_SubjectPublicKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p384_bikel3_to_SubjectPublicKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_SubjectPublicKeyInfo_der_to_bikel3_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_p384_bikel3_to_PrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_p384_bikel3_to_PrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_p384_bikel3_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_p384_bikel3_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_p384_bikel3_to_SubjectPublicKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_p384_bikel3_to_SubjectPublicKeyInfo_pem_encoder_functions[]; extern const OSSL_DISPATCH oqs_p384_bikel3_to_text_encoder_functions[]; -extern const OSSL_DISPATCH oqs_PrivateKeyInfo_der_to_p384_bikel3_decoder_functions[]; -extern const OSSL_DISPATCH oqs_SubjectPublicKeyInfo_der_to_p384_bikel3_decoder_functions[];extern const OSSL_DISPATCH oqs_x448_bikel3_to_PrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_x448_bikel3_to_PrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_x448_bikel3_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_x448_bikel3_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_x448_bikel3_to_SubjectPublicKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_x448_bikel3_to_SubjectPublicKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_PrivateKeyInfo_der_to_p384_bikel3_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_SubjectPublicKeyInfo_der_to_p384_bikel3_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_x448_bikel3_to_PrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_x448_bikel3_to_PrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_x448_bikel3_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_x448_bikel3_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_x448_bikel3_to_SubjectPublicKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_x448_bikel3_to_SubjectPublicKeyInfo_pem_encoder_functions[]; extern const OSSL_DISPATCH oqs_x448_bikel3_to_text_encoder_functions[]; -extern const OSSL_DISPATCH oqs_PrivateKeyInfo_der_to_x448_bikel3_decoder_functions[]; -extern const OSSL_DISPATCH oqs_SubjectPublicKeyInfo_der_to_x448_bikel3_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_PrivateKeyInfo_der_to_x448_bikel3_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_SubjectPublicKeyInfo_der_to_x448_bikel3_decoder_functions[]; extern const OSSL_DISPATCH oqs_bikel5_to_PrivateKeyInfo_der_encoder_functions[]; extern const OSSL_DISPATCH oqs_bikel5_to_PrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_bikel5_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_bikel5_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_bikel5_to_SubjectPublicKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_bikel5_to_SubjectPublicKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_bikel5_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_bikel5_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_bikel5_to_SubjectPublicKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_bikel5_to_SubjectPublicKeyInfo_pem_encoder_functions[]; extern const OSSL_DISPATCH oqs_bikel5_to_text_encoder_functions[]; extern const OSSL_DISPATCH oqs_PrivateKeyInfo_der_to_bikel5_decoder_functions[]; -extern const OSSL_DISPATCH oqs_SubjectPublicKeyInfo_der_to_bikel5_decoder_functions[];extern const OSSL_DISPATCH oqs_p521_bikel5_to_PrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p521_bikel5_to_PrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p521_bikel5_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p521_bikel5_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p521_bikel5_to_SubjectPublicKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p521_bikel5_to_SubjectPublicKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_SubjectPublicKeyInfo_der_to_bikel5_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_p521_bikel5_to_PrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_p521_bikel5_to_PrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_p521_bikel5_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_p521_bikel5_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_p521_bikel5_to_SubjectPublicKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_p521_bikel5_to_SubjectPublicKeyInfo_pem_encoder_functions[]; extern const OSSL_DISPATCH oqs_p521_bikel5_to_text_encoder_functions[]; -extern const OSSL_DISPATCH oqs_PrivateKeyInfo_der_to_p521_bikel5_decoder_functions[]; -extern const OSSL_DISPATCH oqs_SubjectPublicKeyInfo_der_to_p521_bikel5_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_PrivateKeyInfo_der_to_p521_bikel5_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_SubjectPublicKeyInfo_der_to_p521_bikel5_decoder_functions[]; extern const OSSL_DISPATCH oqs_hqc128_to_PrivateKeyInfo_der_encoder_functions[]; extern const OSSL_DISPATCH oqs_hqc128_to_PrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_hqc128_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_hqc128_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_hqc128_to_SubjectPublicKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_hqc128_to_SubjectPublicKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_hqc128_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_hqc128_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_hqc128_to_SubjectPublicKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_hqc128_to_SubjectPublicKeyInfo_pem_encoder_functions[]; extern const OSSL_DISPATCH oqs_hqc128_to_text_encoder_functions[]; extern const OSSL_DISPATCH oqs_PrivateKeyInfo_der_to_hqc128_decoder_functions[]; -extern const OSSL_DISPATCH oqs_SubjectPublicKeyInfo_der_to_hqc128_decoder_functions[];extern const OSSL_DISPATCH oqs_p256_hqc128_to_PrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p256_hqc128_to_PrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p256_hqc128_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p256_hqc128_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p256_hqc128_to_SubjectPublicKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p256_hqc128_to_SubjectPublicKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_SubjectPublicKeyInfo_der_to_hqc128_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_p256_hqc128_to_PrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_p256_hqc128_to_PrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_p256_hqc128_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_p256_hqc128_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_p256_hqc128_to_SubjectPublicKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_p256_hqc128_to_SubjectPublicKeyInfo_pem_encoder_functions[]; extern const OSSL_DISPATCH oqs_p256_hqc128_to_text_encoder_functions[]; -extern const OSSL_DISPATCH oqs_PrivateKeyInfo_der_to_p256_hqc128_decoder_functions[]; -extern const OSSL_DISPATCH oqs_SubjectPublicKeyInfo_der_to_p256_hqc128_decoder_functions[];extern const OSSL_DISPATCH oqs_x25519_hqc128_to_PrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_x25519_hqc128_to_PrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_x25519_hqc128_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_x25519_hqc128_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_x25519_hqc128_to_SubjectPublicKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_x25519_hqc128_to_SubjectPublicKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_PrivateKeyInfo_der_to_p256_hqc128_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_SubjectPublicKeyInfo_der_to_p256_hqc128_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_x25519_hqc128_to_PrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_x25519_hqc128_to_PrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_x25519_hqc128_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_x25519_hqc128_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_x25519_hqc128_to_SubjectPublicKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_x25519_hqc128_to_SubjectPublicKeyInfo_pem_encoder_functions[]; extern const OSSL_DISPATCH oqs_x25519_hqc128_to_text_encoder_functions[]; -extern const OSSL_DISPATCH oqs_PrivateKeyInfo_der_to_x25519_hqc128_decoder_functions[]; -extern const OSSL_DISPATCH oqs_SubjectPublicKeyInfo_der_to_x25519_hqc128_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_PrivateKeyInfo_der_to_x25519_hqc128_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_SubjectPublicKeyInfo_der_to_x25519_hqc128_decoder_functions[]; extern const OSSL_DISPATCH oqs_hqc192_to_PrivateKeyInfo_der_encoder_functions[]; extern const OSSL_DISPATCH oqs_hqc192_to_PrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_hqc192_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_hqc192_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_hqc192_to_SubjectPublicKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_hqc192_to_SubjectPublicKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_hqc192_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_hqc192_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_hqc192_to_SubjectPublicKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_hqc192_to_SubjectPublicKeyInfo_pem_encoder_functions[]; extern const OSSL_DISPATCH oqs_hqc192_to_text_encoder_functions[]; extern const OSSL_DISPATCH oqs_PrivateKeyInfo_der_to_hqc192_decoder_functions[]; -extern const OSSL_DISPATCH oqs_SubjectPublicKeyInfo_der_to_hqc192_decoder_functions[];extern const OSSL_DISPATCH oqs_p384_hqc192_to_PrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p384_hqc192_to_PrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p384_hqc192_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p384_hqc192_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p384_hqc192_to_SubjectPublicKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p384_hqc192_to_SubjectPublicKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_SubjectPublicKeyInfo_der_to_hqc192_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_p384_hqc192_to_PrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_p384_hqc192_to_PrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_p384_hqc192_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_p384_hqc192_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_p384_hqc192_to_SubjectPublicKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_p384_hqc192_to_SubjectPublicKeyInfo_pem_encoder_functions[]; extern const OSSL_DISPATCH oqs_p384_hqc192_to_text_encoder_functions[]; -extern const OSSL_DISPATCH oqs_PrivateKeyInfo_der_to_p384_hqc192_decoder_functions[]; -extern const OSSL_DISPATCH oqs_SubjectPublicKeyInfo_der_to_p384_hqc192_decoder_functions[];extern const OSSL_DISPATCH oqs_x448_hqc192_to_PrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_x448_hqc192_to_PrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_x448_hqc192_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_x448_hqc192_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_x448_hqc192_to_SubjectPublicKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_x448_hqc192_to_SubjectPublicKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_PrivateKeyInfo_der_to_p384_hqc192_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_SubjectPublicKeyInfo_der_to_p384_hqc192_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_x448_hqc192_to_PrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_x448_hqc192_to_PrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_x448_hqc192_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_x448_hqc192_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_x448_hqc192_to_SubjectPublicKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_x448_hqc192_to_SubjectPublicKeyInfo_pem_encoder_functions[]; extern const OSSL_DISPATCH oqs_x448_hqc192_to_text_encoder_functions[]; -extern const OSSL_DISPATCH oqs_PrivateKeyInfo_der_to_x448_hqc192_decoder_functions[]; -extern const OSSL_DISPATCH oqs_SubjectPublicKeyInfo_der_to_x448_hqc192_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_PrivateKeyInfo_der_to_x448_hqc192_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_SubjectPublicKeyInfo_der_to_x448_hqc192_decoder_functions[]; extern const OSSL_DISPATCH oqs_hqc256_to_PrivateKeyInfo_der_encoder_functions[]; extern const OSSL_DISPATCH oqs_hqc256_to_PrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_hqc256_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_hqc256_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_hqc256_to_SubjectPublicKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_hqc256_to_SubjectPublicKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_hqc256_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_hqc256_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_hqc256_to_SubjectPublicKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_hqc256_to_SubjectPublicKeyInfo_pem_encoder_functions[]; extern const OSSL_DISPATCH oqs_hqc256_to_text_encoder_functions[]; extern const OSSL_DISPATCH oqs_PrivateKeyInfo_der_to_hqc256_decoder_functions[]; -extern const OSSL_DISPATCH oqs_SubjectPublicKeyInfo_der_to_hqc256_decoder_functions[];extern const OSSL_DISPATCH oqs_p521_hqc256_to_PrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p521_hqc256_to_PrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p521_hqc256_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p521_hqc256_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p521_hqc256_to_SubjectPublicKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p521_hqc256_to_SubjectPublicKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_SubjectPublicKeyInfo_der_to_hqc256_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_p521_hqc256_to_PrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_p521_hqc256_to_PrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_p521_hqc256_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_p521_hqc256_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_p521_hqc256_to_SubjectPublicKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_p521_hqc256_to_SubjectPublicKeyInfo_pem_encoder_functions[]; extern const OSSL_DISPATCH oqs_p521_hqc256_to_text_encoder_functions[]; -extern const OSSL_DISPATCH oqs_PrivateKeyInfo_der_to_p521_hqc256_decoder_functions[]; -extern const OSSL_DISPATCH oqs_SubjectPublicKeyInfo_der_to_p521_hqc256_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_PrivateKeyInfo_der_to_p521_hqc256_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_SubjectPublicKeyInfo_der_to_p521_hqc256_decoder_functions[]; #endif /* OQS_KEM_ENCODERS */ - -extern const OSSL_DISPATCH oqs_dilithium2_to_PrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_dilithium2_to_PrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_dilithium2_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_dilithium2_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_dilithium2_to_SubjectPublicKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_dilithium2_to_SubjectPublicKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_dilithium2_to_PrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_dilithium2_to_PrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_dilithium2_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_dilithium2_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_dilithium2_to_SubjectPublicKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_dilithium2_to_SubjectPublicKeyInfo_pem_encoder_functions[]; extern const OSSL_DISPATCH oqs_dilithium2_to_text_encoder_functions[]; -extern const OSSL_DISPATCH oqs_PrivateKeyInfo_der_to_dilithium2_decoder_functions[]; -extern const OSSL_DISPATCH oqs_SubjectPublicKeyInfo_der_to_dilithium2_decoder_functions[];extern const OSSL_DISPATCH oqs_p256_dilithium2_to_PrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p256_dilithium2_to_PrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p256_dilithium2_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p256_dilithium2_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p256_dilithium2_to_SubjectPublicKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p256_dilithium2_to_SubjectPublicKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_PrivateKeyInfo_der_to_dilithium2_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_SubjectPublicKeyInfo_der_to_dilithium2_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_p256_dilithium2_to_PrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_p256_dilithium2_to_PrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_p256_dilithium2_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_p256_dilithium2_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_p256_dilithium2_to_SubjectPublicKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_p256_dilithium2_to_SubjectPublicKeyInfo_pem_encoder_functions[]; extern const OSSL_DISPATCH oqs_p256_dilithium2_to_text_encoder_functions[]; -extern const OSSL_DISPATCH oqs_PrivateKeyInfo_der_to_p256_dilithium2_decoder_functions[]; -extern const OSSL_DISPATCH oqs_SubjectPublicKeyInfo_der_to_p256_dilithium2_decoder_functions[];extern const OSSL_DISPATCH oqs_rsa3072_dilithium2_to_PrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_rsa3072_dilithium2_to_PrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_rsa3072_dilithium2_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_rsa3072_dilithium2_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_rsa3072_dilithium2_to_SubjectPublicKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_rsa3072_dilithium2_to_SubjectPublicKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_PrivateKeyInfo_der_to_p256_dilithium2_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_SubjectPublicKeyInfo_der_to_p256_dilithium2_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_rsa3072_dilithium2_to_PrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_rsa3072_dilithium2_to_PrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_rsa3072_dilithium2_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_rsa3072_dilithium2_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_rsa3072_dilithium2_to_SubjectPublicKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_rsa3072_dilithium2_to_SubjectPublicKeyInfo_pem_encoder_functions[]; extern const OSSL_DISPATCH oqs_rsa3072_dilithium2_to_text_encoder_functions[]; -extern const OSSL_DISPATCH oqs_PrivateKeyInfo_der_to_rsa3072_dilithium2_decoder_functions[]; -extern const OSSL_DISPATCH oqs_SubjectPublicKeyInfo_der_to_rsa3072_dilithium2_decoder_functions[]; -extern const OSSL_DISPATCH oqs_dilithium3_to_PrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_dilithium3_to_PrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_dilithium3_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_dilithium3_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_dilithium3_to_SubjectPublicKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_dilithium3_to_SubjectPublicKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_PrivateKeyInfo_der_to_rsa3072_dilithium2_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_SubjectPublicKeyInfo_der_to_rsa3072_dilithium2_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_dilithium3_to_PrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_dilithium3_to_PrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_dilithium3_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_dilithium3_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_dilithium3_to_SubjectPublicKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_dilithium3_to_SubjectPublicKeyInfo_pem_encoder_functions[]; extern const OSSL_DISPATCH oqs_dilithium3_to_text_encoder_functions[]; -extern const OSSL_DISPATCH oqs_PrivateKeyInfo_der_to_dilithium3_decoder_functions[]; -extern const OSSL_DISPATCH oqs_SubjectPublicKeyInfo_der_to_dilithium3_decoder_functions[];extern const OSSL_DISPATCH oqs_p384_dilithium3_to_PrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p384_dilithium3_to_PrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p384_dilithium3_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p384_dilithium3_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p384_dilithium3_to_SubjectPublicKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p384_dilithium3_to_SubjectPublicKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_PrivateKeyInfo_der_to_dilithium3_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_SubjectPublicKeyInfo_der_to_dilithium3_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_p384_dilithium3_to_PrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_p384_dilithium3_to_PrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_p384_dilithium3_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_p384_dilithium3_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_p384_dilithium3_to_SubjectPublicKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_p384_dilithium3_to_SubjectPublicKeyInfo_pem_encoder_functions[]; extern const OSSL_DISPATCH oqs_p384_dilithium3_to_text_encoder_functions[]; -extern const OSSL_DISPATCH oqs_PrivateKeyInfo_der_to_p384_dilithium3_decoder_functions[]; -extern const OSSL_DISPATCH oqs_SubjectPublicKeyInfo_der_to_p384_dilithium3_decoder_functions[]; -extern const OSSL_DISPATCH oqs_dilithium5_to_PrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_dilithium5_to_PrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_dilithium5_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_dilithium5_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_dilithium5_to_SubjectPublicKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_dilithium5_to_SubjectPublicKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_PrivateKeyInfo_der_to_p384_dilithium3_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_SubjectPublicKeyInfo_der_to_p384_dilithium3_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_dilithium5_to_PrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_dilithium5_to_PrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_dilithium5_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_dilithium5_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_dilithium5_to_SubjectPublicKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_dilithium5_to_SubjectPublicKeyInfo_pem_encoder_functions[]; extern const OSSL_DISPATCH oqs_dilithium5_to_text_encoder_functions[]; -extern const OSSL_DISPATCH oqs_PrivateKeyInfo_der_to_dilithium5_decoder_functions[]; -extern const OSSL_DISPATCH oqs_SubjectPublicKeyInfo_der_to_dilithium5_decoder_functions[];extern const OSSL_DISPATCH oqs_p521_dilithium5_to_PrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p521_dilithium5_to_PrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p521_dilithium5_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p521_dilithium5_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p521_dilithium5_to_SubjectPublicKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p521_dilithium5_to_SubjectPublicKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_PrivateKeyInfo_der_to_dilithium5_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_SubjectPublicKeyInfo_der_to_dilithium5_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_p521_dilithium5_to_PrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_p521_dilithium5_to_PrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_p521_dilithium5_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_p521_dilithium5_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_p521_dilithium5_to_SubjectPublicKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_p521_dilithium5_to_SubjectPublicKeyInfo_pem_encoder_functions[]; extern const OSSL_DISPATCH oqs_p521_dilithium5_to_text_encoder_functions[]; -extern const OSSL_DISPATCH oqs_PrivateKeyInfo_der_to_p521_dilithium5_decoder_functions[]; -extern const OSSL_DISPATCH oqs_SubjectPublicKeyInfo_der_to_p521_dilithium5_decoder_functions[]; -extern const OSSL_DISPATCH oqs_mldsa44_to_PrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_mldsa44_to_PrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_mldsa44_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_mldsa44_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_mldsa44_to_SubjectPublicKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_mldsa44_to_SubjectPublicKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_PrivateKeyInfo_der_to_p521_dilithium5_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_SubjectPublicKeyInfo_der_to_p521_dilithium5_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_mldsa44_to_PrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_mldsa44_to_PrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_mldsa44_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_mldsa44_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_mldsa44_to_SubjectPublicKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_mldsa44_to_SubjectPublicKeyInfo_pem_encoder_functions[]; extern const OSSL_DISPATCH oqs_mldsa44_to_text_encoder_functions[]; -extern const OSSL_DISPATCH oqs_PrivateKeyInfo_der_to_mldsa44_decoder_functions[]; -extern const OSSL_DISPATCH oqs_SubjectPublicKeyInfo_der_to_mldsa44_decoder_functions[];extern const OSSL_DISPATCH oqs_p256_mldsa44_to_PrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p256_mldsa44_to_PrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p256_mldsa44_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p256_mldsa44_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p256_mldsa44_to_SubjectPublicKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p256_mldsa44_to_SubjectPublicKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_PrivateKeyInfo_der_to_mldsa44_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_SubjectPublicKeyInfo_der_to_mldsa44_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_p256_mldsa44_to_PrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_p256_mldsa44_to_PrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_p256_mldsa44_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_p256_mldsa44_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_p256_mldsa44_to_SubjectPublicKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_p256_mldsa44_to_SubjectPublicKeyInfo_pem_encoder_functions[]; extern const OSSL_DISPATCH oqs_p256_mldsa44_to_text_encoder_functions[]; -extern const OSSL_DISPATCH oqs_PrivateKeyInfo_der_to_p256_mldsa44_decoder_functions[]; -extern const OSSL_DISPATCH oqs_SubjectPublicKeyInfo_der_to_p256_mldsa44_decoder_functions[];extern const OSSL_DISPATCH oqs_rsa3072_mldsa44_to_PrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_rsa3072_mldsa44_to_PrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_rsa3072_mldsa44_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_rsa3072_mldsa44_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_rsa3072_mldsa44_to_SubjectPublicKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_rsa3072_mldsa44_to_SubjectPublicKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_PrivateKeyInfo_der_to_p256_mldsa44_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_SubjectPublicKeyInfo_der_to_p256_mldsa44_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_rsa3072_mldsa44_to_PrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_rsa3072_mldsa44_to_PrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_rsa3072_mldsa44_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_rsa3072_mldsa44_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_rsa3072_mldsa44_to_SubjectPublicKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_rsa3072_mldsa44_to_SubjectPublicKeyInfo_pem_encoder_functions[]; extern const OSSL_DISPATCH oqs_rsa3072_mldsa44_to_text_encoder_functions[]; -extern const OSSL_DISPATCH oqs_PrivateKeyInfo_der_to_rsa3072_mldsa44_decoder_functions[]; -extern const OSSL_DISPATCH oqs_SubjectPublicKeyInfo_der_to_rsa3072_mldsa44_decoder_functions[];extern const OSSL_DISPATCH oqs_mldsa44_pss2048_to_PrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_mldsa44_pss2048_to_PrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_mldsa44_pss2048_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_mldsa44_pss2048_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_mldsa44_pss2048_to_SubjectPublicKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_mldsa44_pss2048_to_SubjectPublicKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_PrivateKeyInfo_der_to_rsa3072_mldsa44_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_SubjectPublicKeyInfo_der_to_rsa3072_mldsa44_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_mldsa44_pss2048_to_PrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_mldsa44_pss2048_to_PrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_mldsa44_pss2048_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_mldsa44_pss2048_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_mldsa44_pss2048_to_SubjectPublicKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_mldsa44_pss2048_to_SubjectPublicKeyInfo_pem_encoder_functions[]; extern const OSSL_DISPATCH oqs_mldsa44_pss2048_to_text_encoder_functions[]; -extern const OSSL_DISPATCH oqs_PrivateKeyInfo_der_to_mldsa44_pss2048_decoder_functions[]; -extern const OSSL_DISPATCH oqs_SubjectPublicKeyInfo_der_to_mldsa44_pss2048_decoder_functions[];extern const OSSL_DISPATCH oqs_mldsa44_rsa2048_to_PrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_mldsa44_rsa2048_to_PrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_mldsa44_rsa2048_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_mldsa44_rsa2048_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_mldsa44_rsa2048_to_SubjectPublicKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_mldsa44_rsa2048_to_SubjectPublicKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_PrivateKeyInfo_der_to_mldsa44_pss2048_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_SubjectPublicKeyInfo_der_to_mldsa44_pss2048_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_mldsa44_rsa2048_to_PrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_mldsa44_rsa2048_to_PrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_mldsa44_rsa2048_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_mldsa44_rsa2048_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_mldsa44_rsa2048_to_SubjectPublicKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_mldsa44_rsa2048_to_SubjectPublicKeyInfo_pem_encoder_functions[]; extern const OSSL_DISPATCH oqs_mldsa44_rsa2048_to_text_encoder_functions[]; -extern const OSSL_DISPATCH oqs_PrivateKeyInfo_der_to_mldsa44_rsa2048_decoder_functions[]; -extern const OSSL_DISPATCH oqs_SubjectPublicKeyInfo_der_to_mldsa44_rsa2048_decoder_functions[];extern const OSSL_DISPATCH oqs_mldsa44_ed25519_to_PrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_mldsa44_ed25519_to_PrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_mldsa44_ed25519_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_mldsa44_ed25519_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_mldsa44_ed25519_to_SubjectPublicKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_mldsa44_ed25519_to_SubjectPublicKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_PrivateKeyInfo_der_to_mldsa44_rsa2048_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_SubjectPublicKeyInfo_der_to_mldsa44_rsa2048_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_mldsa44_ed25519_to_PrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_mldsa44_ed25519_to_PrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_mldsa44_ed25519_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_mldsa44_ed25519_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_mldsa44_ed25519_to_SubjectPublicKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_mldsa44_ed25519_to_SubjectPublicKeyInfo_pem_encoder_functions[]; extern const OSSL_DISPATCH oqs_mldsa44_ed25519_to_text_encoder_functions[]; -extern const OSSL_DISPATCH oqs_PrivateKeyInfo_der_to_mldsa44_ed25519_decoder_functions[]; -extern const OSSL_DISPATCH oqs_SubjectPublicKeyInfo_der_to_mldsa44_ed25519_decoder_functions[];extern const OSSL_DISPATCH oqs_mldsa44_p256_to_PrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_mldsa44_p256_to_PrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_mldsa44_p256_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_mldsa44_p256_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_mldsa44_p256_to_SubjectPublicKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_mldsa44_p256_to_SubjectPublicKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_PrivateKeyInfo_der_to_mldsa44_ed25519_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_SubjectPublicKeyInfo_der_to_mldsa44_ed25519_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_mldsa44_p256_to_PrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_mldsa44_p256_to_PrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_mldsa44_p256_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_mldsa44_p256_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_mldsa44_p256_to_SubjectPublicKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_mldsa44_p256_to_SubjectPublicKeyInfo_pem_encoder_functions[]; extern const OSSL_DISPATCH oqs_mldsa44_p256_to_text_encoder_functions[]; -extern const OSSL_DISPATCH oqs_PrivateKeyInfo_der_to_mldsa44_p256_decoder_functions[]; -extern const OSSL_DISPATCH oqs_SubjectPublicKeyInfo_der_to_mldsa44_p256_decoder_functions[];extern const OSSL_DISPATCH oqs_mldsa44_bp256_to_PrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_mldsa44_bp256_to_PrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_mldsa44_bp256_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_mldsa44_bp256_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_mldsa44_bp256_to_SubjectPublicKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_mldsa44_bp256_to_SubjectPublicKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_PrivateKeyInfo_der_to_mldsa44_p256_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_SubjectPublicKeyInfo_der_to_mldsa44_p256_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_mldsa44_bp256_to_PrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_mldsa44_bp256_to_PrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_mldsa44_bp256_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_mldsa44_bp256_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_mldsa44_bp256_to_SubjectPublicKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_mldsa44_bp256_to_SubjectPublicKeyInfo_pem_encoder_functions[]; extern const OSSL_DISPATCH oqs_mldsa44_bp256_to_text_encoder_functions[]; -extern const OSSL_DISPATCH oqs_PrivateKeyInfo_der_to_mldsa44_bp256_decoder_functions[]; -extern const OSSL_DISPATCH oqs_SubjectPublicKeyInfo_der_to_mldsa44_bp256_decoder_functions[]; -extern const OSSL_DISPATCH oqs_mldsa65_to_PrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_mldsa65_to_PrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_mldsa65_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_mldsa65_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_mldsa65_to_SubjectPublicKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_mldsa65_to_SubjectPublicKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_PrivateKeyInfo_der_to_mldsa44_bp256_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_SubjectPublicKeyInfo_der_to_mldsa44_bp256_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_mldsa65_to_PrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_mldsa65_to_PrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_mldsa65_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_mldsa65_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_mldsa65_to_SubjectPublicKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_mldsa65_to_SubjectPublicKeyInfo_pem_encoder_functions[]; extern const OSSL_DISPATCH oqs_mldsa65_to_text_encoder_functions[]; -extern const OSSL_DISPATCH oqs_PrivateKeyInfo_der_to_mldsa65_decoder_functions[]; -extern const OSSL_DISPATCH oqs_SubjectPublicKeyInfo_der_to_mldsa65_decoder_functions[];extern const OSSL_DISPATCH oqs_p384_mldsa65_to_PrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p384_mldsa65_to_PrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p384_mldsa65_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p384_mldsa65_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p384_mldsa65_to_SubjectPublicKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p384_mldsa65_to_SubjectPublicKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_PrivateKeyInfo_der_to_mldsa65_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_SubjectPublicKeyInfo_der_to_mldsa65_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_p384_mldsa65_to_PrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_p384_mldsa65_to_PrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_p384_mldsa65_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_p384_mldsa65_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_p384_mldsa65_to_SubjectPublicKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_p384_mldsa65_to_SubjectPublicKeyInfo_pem_encoder_functions[]; extern const OSSL_DISPATCH oqs_p384_mldsa65_to_text_encoder_functions[]; -extern const OSSL_DISPATCH oqs_PrivateKeyInfo_der_to_p384_mldsa65_decoder_functions[]; -extern const OSSL_DISPATCH oqs_SubjectPublicKeyInfo_der_to_p384_mldsa65_decoder_functions[];extern const OSSL_DISPATCH oqs_mldsa65_pss3072_to_PrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_mldsa65_pss3072_to_PrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_mldsa65_pss3072_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_mldsa65_pss3072_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_mldsa65_pss3072_to_SubjectPublicKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_mldsa65_pss3072_to_SubjectPublicKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_PrivateKeyInfo_der_to_p384_mldsa65_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_SubjectPublicKeyInfo_der_to_p384_mldsa65_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_mldsa65_pss3072_to_PrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_mldsa65_pss3072_to_PrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_mldsa65_pss3072_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_mldsa65_pss3072_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_mldsa65_pss3072_to_SubjectPublicKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_mldsa65_pss3072_to_SubjectPublicKeyInfo_pem_encoder_functions[]; extern const OSSL_DISPATCH oqs_mldsa65_pss3072_to_text_encoder_functions[]; -extern const OSSL_DISPATCH oqs_PrivateKeyInfo_der_to_mldsa65_pss3072_decoder_functions[]; -extern const OSSL_DISPATCH oqs_SubjectPublicKeyInfo_der_to_mldsa65_pss3072_decoder_functions[];extern const OSSL_DISPATCH oqs_mldsa65_rsa3072_to_PrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_mldsa65_rsa3072_to_PrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_mldsa65_rsa3072_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_mldsa65_rsa3072_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_mldsa65_rsa3072_to_SubjectPublicKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_mldsa65_rsa3072_to_SubjectPublicKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_PrivateKeyInfo_der_to_mldsa65_pss3072_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_SubjectPublicKeyInfo_der_to_mldsa65_pss3072_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_mldsa65_rsa3072_to_PrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_mldsa65_rsa3072_to_PrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_mldsa65_rsa3072_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_mldsa65_rsa3072_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_mldsa65_rsa3072_to_SubjectPublicKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_mldsa65_rsa3072_to_SubjectPublicKeyInfo_pem_encoder_functions[]; extern const OSSL_DISPATCH oqs_mldsa65_rsa3072_to_text_encoder_functions[]; -extern const OSSL_DISPATCH oqs_PrivateKeyInfo_der_to_mldsa65_rsa3072_decoder_functions[]; -extern const OSSL_DISPATCH oqs_SubjectPublicKeyInfo_der_to_mldsa65_rsa3072_decoder_functions[];extern const OSSL_DISPATCH oqs_mldsa65_p256_to_PrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_mldsa65_p256_to_PrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_mldsa65_p256_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_mldsa65_p256_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_mldsa65_p256_to_SubjectPublicKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_mldsa65_p256_to_SubjectPublicKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_PrivateKeyInfo_der_to_mldsa65_rsa3072_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_SubjectPublicKeyInfo_der_to_mldsa65_rsa3072_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_mldsa65_p256_to_PrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_mldsa65_p256_to_PrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_mldsa65_p256_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_mldsa65_p256_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_mldsa65_p256_to_SubjectPublicKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_mldsa65_p256_to_SubjectPublicKeyInfo_pem_encoder_functions[]; extern const OSSL_DISPATCH oqs_mldsa65_p256_to_text_encoder_functions[]; -extern const OSSL_DISPATCH oqs_PrivateKeyInfo_der_to_mldsa65_p256_decoder_functions[]; -extern const OSSL_DISPATCH oqs_SubjectPublicKeyInfo_der_to_mldsa65_p256_decoder_functions[];extern const OSSL_DISPATCH oqs_mldsa65_bp256_to_PrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_mldsa65_bp256_to_PrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_mldsa65_bp256_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_mldsa65_bp256_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_mldsa65_bp256_to_SubjectPublicKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_mldsa65_bp256_to_SubjectPublicKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_PrivateKeyInfo_der_to_mldsa65_p256_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_SubjectPublicKeyInfo_der_to_mldsa65_p256_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_mldsa65_bp256_to_PrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_mldsa65_bp256_to_PrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_mldsa65_bp256_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_mldsa65_bp256_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_mldsa65_bp256_to_SubjectPublicKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_mldsa65_bp256_to_SubjectPublicKeyInfo_pem_encoder_functions[]; extern const OSSL_DISPATCH oqs_mldsa65_bp256_to_text_encoder_functions[]; -extern const OSSL_DISPATCH oqs_PrivateKeyInfo_der_to_mldsa65_bp256_decoder_functions[]; -extern const OSSL_DISPATCH oqs_SubjectPublicKeyInfo_der_to_mldsa65_bp256_decoder_functions[];extern const OSSL_DISPATCH oqs_mldsa65_ed25519_to_PrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_mldsa65_ed25519_to_PrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_mldsa65_ed25519_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_mldsa65_ed25519_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_mldsa65_ed25519_to_SubjectPublicKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_mldsa65_ed25519_to_SubjectPublicKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_PrivateKeyInfo_der_to_mldsa65_bp256_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_SubjectPublicKeyInfo_der_to_mldsa65_bp256_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_mldsa65_ed25519_to_PrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_mldsa65_ed25519_to_PrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_mldsa65_ed25519_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_mldsa65_ed25519_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_mldsa65_ed25519_to_SubjectPublicKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_mldsa65_ed25519_to_SubjectPublicKeyInfo_pem_encoder_functions[]; extern const OSSL_DISPATCH oqs_mldsa65_ed25519_to_text_encoder_functions[]; -extern const OSSL_DISPATCH oqs_PrivateKeyInfo_der_to_mldsa65_ed25519_decoder_functions[]; -extern const OSSL_DISPATCH oqs_SubjectPublicKeyInfo_der_to_mldsa65_ed25519_decoder_functions[]; -extern const OSSL_DISPATCH oqs_mldsa87_to_PrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_mldsa87_to_PrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_mldsa87_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_mldsa87_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_mldsa87_to_SubjectPublicKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_mldsa87_to_SubjectPublicKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_PrivateKeyInfo_der_to_mldsa65_ed25519_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_SubjectPublicKeyInfo_der_to_mldsa65_ed25519_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_mldsa87_to_PrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_mldsa87_to_PrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_mldsa87_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_mldsa87_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_mldsa87_to_SubjectPublicKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_mldsa87_to_SubjectPublicKeyInfo_pem_encoder_functions[]; extern const OSSL_DISPATCH oqs_mldsa87_to_text_encoder_functions[]; -extern const OSSL_DISPATCH oqs_PrivateKeyInfo_der_to_mldsa87_decoder_functions[]; -extern const OSSL_DISPATCH oqs_SubjectPublicKeyInfo_der_to_mldsa87_decoder_functions[];extern const OSSL_DISPATCH oqs_p521_mldsa87_to_PrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p521_mldsa87_to_PrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p521_mldsa87_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p521_mldsa87_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p521_mldsa87_to_SubjectPublicKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p521_mldsa87_to_SubjectPublicKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_PrivateKeyInfo_der_to_mldsa87_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_SubjectPublicKeyInfo_der_to_mldsa87_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_p521_mldsa87_to_PrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_p521_mldsa87_to_PrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_p521_mldsa87_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_p521_mldsa87_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_p521_mldsa87_to_SubjectPublicKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_p521_mldsa87_to_SubjectPublicKeyInfo_pem_encoder_functions[]; extern const OSSL_DISPATCH oqs_p521_mldsa87_to_text_encoder_functions[]; -extern const OSSL_DISPATCH oqs_PrivateKeyInfo_der_to_p521_mldsa87_decoder_functions[]; -extern const OSSL_DISPATCH oqs_SubjectPublicKeyInfo_der_to_p521_mldsa87_decoder_functions[];extern const OSSL_DISPATCH oqs_mldsa87_p384_to_PrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_mldsa87_p384_to_PrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_mldsa87_p384_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_mldsa87_p384_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_mldsa87_p384_to_SubjectPublicKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_mldsa87_p384_to_SubjectPublicKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_PrivateKeyInfo_der_to_p521_mldsa87_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_SubjectPublicKeyInfo_der_to_p521_mldsa87_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_mldsa87_p384_to_PrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_mldsa87_p384_to_PrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_mldsa87_p384_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_mldsa87_p384_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_mldsa87_p384_to_SubjectPublicKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_mldsa87_p384_to_SubjectPublicKeyInfo_pem_encoder_functions[]; extern const OSSL_DISPATCH oqs_mldsa87_p384_to_text_encoder_functions[]; -extern const OSSL_DISPATCH oqs_PrivateKeyInfo_der_to_mldsa87_p384_decoder_functions[]; -extern const OSSL_DISPATCH oqs_SubjectPublicKeyInfo_der_to_mldsa87_p384_decoder_functions[];extern const OSSL_DISPATCH oqs_mldsa87_bp384_to_PrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_mldsa87_bp384_to_PrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_mldsa87_bp384_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_mldsa87_bp384_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_mldsa87_bp384_to_SubjectPublicKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_mldsa87_bp384_to_SubjectPublicKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_PrivateKeyInfo_der_to_mldsa87_p384_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_SubjectPublicKeyInfo_der_to_mldsa87_p384_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_mldsa87_bp384_to_PrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_mldsa87_bp384_to_PrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_mldsa87_bp384_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_mldsa87_bp384_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_mldsa87_bp384_to_SubjectPublicKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_mldsa87_bp384_to_SubjectPublicKeyInfo_pem_encoder_functions[]; extern const OSSL_DISPATCH oqs_mldsa87_bp384_to_text_encoder_functions[]; -extern const OSSL_DISPATCH oqs_PrivateKeyInfo_der_to_mldsa87_bp384_decoder_functions[]; -extern const OSSL_DISPATCH oqs_SubjectPublicKeyInfo_der_to_mldsa87_bp384_decoder_functions[];extern const OSSL_DISPATCH oqs_mldsa87_ed448_to_PrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_mldsa87_ed448_to_PrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_mldsa87_ed448_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_mldsa87_ed448_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_mldsa87_ed448_to_SubjectPublicKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_mldsa87_ed448_to_SubjectPublicKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_PrivateKeyInfo_der_to_mldsa87_bp384_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_SubjectPublicKeyInfo_der_to_mldsa87_bp384_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_mldsa87_ed448_to_PrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_mldsa87_ed448_to_PrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_mldsa87_ed448_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_mldsa87_ed448_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_mldsa87_ed448_to_SubjectPublicKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_mldsa87_ed448_to_SubjectPublicKeyInfo_pem_encoder_functions[]; extern const OSSL_DISPATCH oqs_mldsa87_ed448_to_text_encoder_functions[]; -extern const OSSL_DISPATCH oqs_PrivateKeyInfo_der_to_mldsa87_ed448_decoder_functions[]; -extern const OSSL_DISPATCH oqs_SubjectPublicKeyInfo_der_to_mldsa87_ed448_decoder_functions[]; -extern const OSSL_DISPATCH oqs_falcon512_to_PrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_falcon512_to_PrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_falcon512_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_falcon512_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_falcon512_to_SubjectPublicKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_falcon512_to_SubjectPublicKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_PrivateKeyInfo_der_to_mldsa87_ed448_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_SubjectPublicKeyInfo_der_to_mldsa87_ed448_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_falcon512_to_PrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_falcon512_to_PrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_falcon512_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_falcon512_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_falcon512_to_SubjectPublicKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_falcon512_to_SubjectPublicKeyInfo_pem_encoder_functions[]; extern const OSSL_DISPATCH oqs_falcon512_to_text_encoder_functions[]; -extern const OSSL_DISPATCH oqs_PrivateKeyInfo_der_to_falcon512_decoder_functions[]; -extern const OSSL_DISPATCH oqs_SubjectPublicKeyInfo_der_to_falcon512_decoder_functions[];extern const OSSL_DISPATCH oqs_p256_falcon512_to_PrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p256_falcon512_to_PrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p256_falcon512_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p256_falcon512_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p256_falcon512_to_SubjectPublicKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p256_falcon512_to_SubjectPublicKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_PrivateKeyInfo_der_to_falcon512_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_SubjectPublicKeyInfo_der_to_falcon512_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_p256_falcon512_to_PrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_p256_falcon512_to_PrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_p256_falcon512_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_p256_falcon512_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_p256_falcon512_to_SubjectPublicKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_p256_falcon512_to_SubjectPublicKeyInfo_pem_encoder_functions[]; extern const OSSL_DISPATCH oqs_p256_falcon512_to_text_encoder_functions[]; -extern const OSSL_DISPATCH oqs_PrivateKeyInfo_der_to_p256_falcon512_decoder_functions[]; -extern const OSSL_DISPATCH oqs_SubjectPublicKeyInfo_der_to_p256_falcon512_decoder_functions[];extern const OSSL_DISPATCH oqs_rsa3072_falcon512_to_PrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_rsa3072_falcon512_to_PrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_rsa3072_falcon512_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_rsa3072_falcon512_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_rsa3072_falcon512_to_SubjectPublicKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_rsa3072_falcon512_to_SubjectPublicKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_PrivateKeyInfo_der_to_p256_falcon512_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_SubjectPublicKeyInfo_der_to_p256_falcon512_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_rsa3072_falcon512_to_PrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_rsa3072_falcon512_to_PrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_rsa3072_falcon512_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_rsa3072_falcon512_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_rsa3072_falcon512_to_SubjectPublicKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_rsa3072_falcon512_to_SubjectPublicKeyInfo_pem_encoder_functions[]; extern const OSSL_DISPATCH oqs_rsa3072_falcon512_to_text_encoder_functions[]; -extern const OSSL_DISPATCH oqs_PrivateKeyInfo_der_to_rsa3072_falcon512_decoder_functions[]; -extern const OSSL_DISPATCH oqs_SubjectPublicKeyInfo_der_to_rsa3072_falcon512_decoder_functions[]; -extern const OSSL_DISPATCH oqs_falconpadded512_to_PrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_falconpadded512_to_PrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_falconpadded512_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_falconpadded512_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_falconpadded512_to_SubjectPublicKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_falconpadded512_to_SubjectPublicKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_PrivateKeyInfo_der_to_rsa3072_falcon512_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_SubjectPublicKeyInfo_der_to_rsa3072_falcon512_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_falconpadded512_to_PrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_falconpadded512_to_PrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_falconpadded512_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_falconpadded512_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_falconpadded512_to_SubjectPublicKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_falconpadded512_to_SubjectPublicKeyInfo_pem_encoder_functions[]; extern const OSSL_DISPATCH oqs_falconpadded512_to_text_encoder_functions[]; -extern const OSSL_DISPATCH oqs_PrivateKeyInfo_der_to_falconpadded512_decoder_functions[]; -extern const OSSL_DISPATCH oqs_SubjectPublicKeyInfo_der_to_falconpadded512_decoder_functions[];extern const OSSL_DISPATCH oqs_p256_falconpadded512_to_PrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p256_falconpadded512_to_PrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p256_falconpadded512_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p256_falconpadded512_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p256_falconpadded512_to_SubjectPublicKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p256_falconpadded512_to_SubjectPublicKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_PrivateKeyInfo_der_to_falconpadded512_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_SubjectPublicKeyInfo_der_to_falconpadded512_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_p256_falconpadded512_to_PrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_p256_falconpadded512_to_PrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_p256_falconpadded512_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_p256_falconpadded512_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_p256_falconpadded512_to_SubjectPublicKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_p256_falconpadded512_to_SubjectPublicKeyInfo_pem_encoder_functions[]; extern const OSSL_DISPATCH oqs_p256_falconpadded512_to_text_encoder_functions[]; -extern const OSSL_DISPATCH oqs_PrivateKeyInfo_der_to_p256_falconpadded512_decoder_functions[]; -extern const OSSL_DISPATCH oqs_SubjectPublicKeyInfo_der_to_p256_falconpadded512_decoder_functions[];extern const OSSL_DISPATCH oqs_rsa3072_falconpadded512_to_PrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_rsa3072_falconpadded512_to_PrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_rsa3072_falconpadded512_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_rsa3072_falconpadded512_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_rsa3072_falconpadded512_to_SubjectPublicKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_rsa3072_falconpadded512_to_SubjectPublicKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_rsa3072_falconpadded512_to_text_encoder_functions[]; -extern const OSSL_DISPATCH oqs_PrivateKeyInfo_der_to_rsa3072_falconpadded512_decoder_functions[]; -extern const OSSL_DISPATCH oqs_SubjectPublicKeyInfo_der_to_rsa3072_falconpadded512_decoder_functions[]; -extern const OSSL_DISPATCH oqs_falcon1024_to_PrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_falcon1024_to_PrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_falcon1024_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_falcon1024_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_falcon1024_to_SubjectPublicKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_falcon1024_to_SubjectPublicKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_PrivateKeyInfo_der_to_p256_falconpadded512_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_SubjectPublicKeyInfo_der_to_p256_falconpadded512_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_rsa3072_falconpadded512_to_PrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_rsa3072_falconpadded512_to_PrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_rsa3072_falconpadded512_to_EncryptedPrivateKeyInfo_der_encoder_functions + []; +extern const OSSL_DISPATCH + oqs_rsa3072_falconpadded512_to_EncryptedPrivateKeyInfo_pem_encoder_functions + []; +extern const OSSL_DISPATCH + oqs_rsa3072_falconpadded512_to_SubjectPublicKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_rsa3072_falconpadded512_to_SubjectPublicKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_rsa3072_falconpadded512_to_text_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_PrivateKeyInfo_der_to_rsa3072_falconpadded512_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_SubjectPublicKeyInfo_der_to_rsa3072_falconpadded512_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_falcon1024_to_PrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_falcon1024_to_PrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_falcon1024_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_falcon1024_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_falcon1024_to_SubjectPublicKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_falcon1024_to_SubjectPublicKeyInfo_pem_encoder_functions[]; extern const OSSL_DISPATCH oqs_falcon1024_to_text_encoder_functions[]; -extern const OSSL_DISPATCH oqs_PrivateKeyInfo_der_to_falcon1024_decoder_functions[]; -extern const OSSL_DISPATCH oqs_SubjectPublicKeyInfo_der_to_falcon1024_decoder_functions[];extern const OSSL_DISPATCH oqs_p521_falcon1024_to_PrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p521_falcon1024_to_PrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p521_falcon1024_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p521_falcon1024_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p521_falcon1024_to_SubjectPublicKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p521_falcon1024_to_SubjectPublicKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_PrivateKeyInfo_der_to_falcon1024_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_SubjectPublicKeyInfo_der_to_falcon1024_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_p521_falcon1024_to_PrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_p521_falcon1024_to_PrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_p521_falcon1024_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_p521_falcon1024_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_p521_falcon1024_to_SubjectPublicKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_p521_falcon1024_to_SubjectPublicKeyInfo_pem_encoder_functions[]; extern const OSSL_DISPATCH oqs_p521_falcon1024_to_text_encoder_functions[]; -extern const OSSL_DISPATCH oqs_PrivateKeyInfo_der_to_p521_falcon1024_decoder_functions[]; -extern const OSSL_DISPATCH oqs_SubjectPublicKeyInfo_der_to_p521_falcon1024_decoder_functions[]; -extern const OSSL_DISPATCH oqs_falconpadded1024_to_PrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_falconpadded1024_to_PrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_falconpadded1024_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_falconpadded1024_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_falconpadded1024_to_SubjectPublicKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_falconpadded1024_to_SubjectPublicKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_PrivateKeyInfo_der_to_p521_falcon1024_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_SubjectPublicKeyInfo_der_to_p521_falcon1024_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_falconpadded1024_to_PrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_falconpadded1024_to_PrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_falconpadded1024_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_falconpadded1024_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_falconpadded1024_to_SubjectPublicKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_falconpadded1024_to_SubjectPublicKeyInfo_pem_encoder_functions[]; extern const OSSL_DISPATCH oqs_falconpadded1024_to_text_encoder_functions[]; -extern const OSSL_DISPATCH oqs_PrivateKeyInfo_der_to_falconpadded1024_decoder_functions[]; -extern const OSSL_DISPATCH oqs_SubjectPublicKeyInfo_der_to_falconpadded1024_decoder_functions[];extern const OSSL_DISPATCH oqs_p521_falconpadded1024_to_PrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p521_falconpadded1024_to_PrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p521_falconpadded1024_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p521_falconpadded1024_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p521_falconpadded1024_to_SubjectPublicKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p521_falconpadded1024_to_SubjectPublicKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p521_falconpadded1024_to_text_encoder_functions[]; -extern const OSSL_DISPATCH oqs_PrivateKeyInfo_der_to_p521_falconpadded1024_decoder_functions[]; -extern const OSSL_DISPATCH oqs_SubjectPublicKeyInfo_der_to_p521_falconpadded1024_decoder_functions[]; -extern const OSSL_DISPATCH oqs_sphincssha2128fsimple_to_PrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_sphincssha2128fsimple_to_PrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_sphincssha2128fsimple_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_sphincssha2128fsimple_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_sphincssha2128fsimple_to_SubjectPublicKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_sphincssha2128fsimple_to_SubjectPublicKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_sphincssha2128fsimple_to_text_encoder_functions[]; -extern const OSSL_DISPATCH oqs_PrivateKeyInfo_der_to_sphincssha2128fsimple_decoder_functions[]; -extern const OSSL_DISPATCH oqs_SubjectPublicKeyInfo_der_to_sphincssha2128fsimple_decoder_functions[];extern const OSSL_DISPATCH oqs_p256_sphincssha2128fsimple_to_PrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p256_sphincssha2128fsimple_to_PrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p256_sphincssha2128fsimple_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p256_sphincssha2128fsimple_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p256_sphincssha2128fsimple_to_SubjectPublicKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p256_sphincssha2128fsimple_to_SubjectPublicKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p256_sphincssha2128fsimple_to_text_encoder_functions[]; -extern const OSSL_DISPATCH oqs_PrivateKeyInfo_der_to_p256_sphincssha2128fsimple_decoder_functions[]; -extern const OSSL_DISPATCH oqs_SubjectPublicKeyInfo_der_to_p256_sphincssha2128fsimple_decoder_functions[];extern const OSSL_DISPATCH oqs_rsa3072_sphincssha2128fsimple_to_PrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_rsa3072_sphincssha2128fsimple_to_PrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_rsa3072_sphincssha2128fsimple_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_rsa3072_sphincssha2128fsimple_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_rsa3072_sphincssha2128fsimple_to_SubjectPublicKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_rsa3072_sphincssha2128fsimple_to_SubjectPublicKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_rsa3072_sphincssha2128fsimple_to_text_encoder_functions[]; -extern const OSSL_DISPATCH oqs_PrivateKeyInfo_der_to_rsa3072_sphincssha2128fsimple_decoder_functions[]; -extern const OSSL_DISPATCH oqs_SubjectPublicKeyInfo_der_to_rsa3072_sphincssha2128fsimple_decoder_functions[]; -extern const OSSL_DISPATCH oqs_sphincssha2128ssimple_to_PrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_sphincssha2128ssimple_to_PrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_sphincssha2128ssimple_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_sphincssha2128ssimple_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_sphincssha2128ssimple_to_SubjectPublicKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_sphincssha2128ssimple_to_SubjectPublicKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_sphincssha2128ssimple_to_text_encoder_functions[]; -extern const OSSL_DISPATCH oqs_PrivateKeyInfo_der_to_sphincssha2128ssimple_decoder_functions[]; -extern const OSSL_DISPATCH oqs_SubjectPublicKeyInfo_der_to_sphincssha2128ssimple_decoder_functions[];extern const OSSL_DISPATCH oqs_p256_sphincssha2128ssimple_to_PrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p256_sphincssha2128ssimple_to_PrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p256_sphincssha2128ssimple_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p256_sphincssha2128ssimple_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p256_sphincssha2128ssimple_to_SubjectPublicKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p256_sphincssha2128ssimple_to_SubjectPublicKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p256_sphincssha2128ssimple_to_text_encoder_functions[]; -extern const OSSL_DISPATCH oqs_PrivateKeyInfo_der_to_p256_sphincssha2128ssimple_decoder_functions[]; -extern const OSSL_DISPATCH oqs_SubjectPublicKeyInfo_der_to_p256_sphincssha2128ssimple_decoder_functions[];extern const OSSL_DISPATCH oqs_rsa3072_sphincssha2128ssimple_to_PrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_rsa3072_sphincssha2128ssimple_to_PrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_rsa3072_sphincssha2128ssimple_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_rsa3072_sphincssha2128ssimple_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_rsa3072_sphincssha2128ssimple_to_SubjectPublicKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_rsa3072_sphincssha2128ssimple_to_SubjectPublicKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_rsa3072_sphincssha2128ssimple_to_text_encoder_functions[]; -extern const OSSL_DISPATCH oqs_PrivateKeyInfo_der_to_rsa3072_sphincssha2128ssimple_decoder_functions[]; -extern const OSSL_DISPATCH oqs_SubjectPublicKeyInfo_der_to_rsa3072_sphincssha2128ssimple_decoder_functions[]; -extern const OSSL_DISPATCH oqs_sphincssha2192fsimple_to_PrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_sphincssha2192fsimple_to_PrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_sphincssha2192fsimple_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_sphincssha2192fsimple_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_sphincssha2192fsimple_to_SubjectPublicKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_sphincssha2192fsimple_to_SubjectPublicKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_sphincssha2192fsimple_to_text_encoder_functions[]; -extern const OSSL_DISPATCH oqs_PrivateKeyInfo_der_to_sphincssha2192fsimple_decoder_functions[]; -extern const OSSL_DISPATCH oqs_SubjectPublicKeyInfo_der_to_sphincssha2192fsimple_decoder_functions[];extern const OSSL_DISPATCH oqs_p384_sphincssha2192fsimple_to_PrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p384_sphincssha2192fsimple_to_PrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p384_sphincssha2192fsimple_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p384_sphincssha2192fsimple_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p384_sphincssha2192fsimple_to_SubjectPublicKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p384_sphincssha2192fsimple_to_SubjectPublicKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p384_sphincssha2192fsimple_to_text_encoder_functions[]; -extern const OSSL_DISPATCH oqs_PrivateKeyInfo_der_to_p384_sphincssha2192fsimple_decoder_functions[]; -extern const OSSL_DISPATCH oqs_SubjectPublicKeyInfo_der_to_p384_sphincssha2192fsimple_decoder_functions[]; -extern const OSSL_DISPATCH oqs_sphincsshake128fsimple_to_PrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_sphincsshake128fsimple_to_PrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_sphincsshake128fsimple_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_sphincsshake128fsimple_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_sphincsshake128fsimple_to_SubjectPublicKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_sphincsshake128fsimple_to_SubjectPublicKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_sphincsshake128fsimple_to_text_encoder_functions[]; -extern const OSSL_DISPATCH oqs_PrivateKeyInfo_der_to_sphincsshake128fsimple_decoder_functions[]; -extern const OSSL_DISPATCH oqs_SubjectPublicKeyInfo_der_to_sphincsshake128fsimple_decoder_functions[];extern const OSSL_DISPATCH oqs_p256_sphincsshake128fsimple_to_PrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p256_sphincsshake128fsimple_to_PrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p256_sphincsshake128fsimple_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p256_sphincsshake128fsimple_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p256_sphincsshake128fsimple_to_SubjectPublicKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p256_sphincsshake128fsimple_to_SubjectPublicKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p256_sphincsshake128fsimple_to_text_encoder_functions[]; -extern const OSSL_DISPATCH oqs_PrivateKeyInfo_der_to_p256_sphincsshake128fsimple_decoder_functions[]; -extern const OSSL_DISPATCH oqs_SubjectPublicKeyInfo_der_to_p256_sphincsshake128fsimple_decoder_functions[];extern const OSSL_DISPATCH oqs_rsa3072_sphincsshake128fsimple_to_PrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_rsa3072_sphincsshake128fsimple_to_PrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_rsa3072_sphincsshake128fsimple_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_rsa3072_sphincsshake128fsimple_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_rsa3072_sphincsshake128fsimple_to_SubjectPublicKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_rsa3072_sphincsshake128fsimple_to_SubjectPublicKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_rsa3072_sphincsshake128fsimple_to_text_encoder_functions[]; -extern const OSSL_DISPATCH oqs_PrivateKeyInfo_der_to_rsa3072_sphincsshake128fsimple_decoder_functions[]; -extern const OSSL_DISPATCH oqs_SubjectPublicKeyInfo_der_to_rsa3072_sphincsshake128fsimple_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_PrivateKeyInfo_der_to_falconpadded1024_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_SubjectPublicKeyInfo_der_to_falconpadded1024_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_p521_falconpadded1024_to_PrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_p521_falconpadded1024_to_PrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_p521_falconpadded1024_to_EncryptedPrivateKeyInfo_der_encoder_functions + []; +extern const OSSL_DISPATCH + oqs_p521_falconpadded1024_to_EncryptedPrivateKeyInfo_pem_encoder_functions + []; +extern const OSSL_DISPATCH + oqs_p521_falconpadded1024_to_SubjectPublicKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_p521_falconpadded1024_to_SubjectPublicKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_p521_falconpadded1024_to_text_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_PrivateKeyInfo_der_to_p521_falconpadded1024_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_SubjectPublicKeyInfo_der_to_p521_falconpadded1024_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_sphincssha2128fsimple_to_PrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_sphincssha2128fsimple_to_PrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_sphincssha2128fsimple_to_EncryptedPrivateKeyInfo_der_encoder_functions + []; +extern const OSSL_DISPATCH + oqs_sphincssha2128fsimple_to_EncryptedPrivateKeyInfo_pem_encoder_functions + []; +extern const OSSL_DISPATCH + oqs_sphincssha2128fsimple_to_SubjectPublicKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_sphincssha2128fsimple_to_SubjectPublicKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_sphincssha2128fsimple_to_text_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_PrivateKeyInfo_der_to_sphincssha2128fsimple_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_SubjectPublicKeyInfo_der_to_sphincssha2128fsimple_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_p256_sphincssha2128fsimple_to_PrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_p256_sphincssha2128fsimple_to_PrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_p256_sphincssha2128fsimple_to_EncryptedPrivateKeyInfo_der_encoder_functions + []; +extern const OSSL_DISPATCH + oqs_p256_sphincssha2128fsimple_to_EncryptedPrivateKeyInfo_pem_encoder_functions + []; +extern const OSSL_DISPATCH + oqs_p256_sphincssha2128fsimple_to_SubjectPublicKeyInfo_der_encoder_functions + []; +extern const OSSL_DISPATCH + oqs_p256_sphincssha2128fsimple_to_SubjectPublicKeyInfo_pem_encoder_functions + []; +extern const OSSL_DISPATCH + oqs_p256_sphincssha2128fsimple_to_text_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_PrivateKeyInfo_der_to_p256_sphincssha2128fsimple_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_SubjectPublicKeyInfo_der_to_p256_sphincssha2128fsimple_decoder_functions + []; +extern const OSSL_DISPATCH + oqs_rsa3072_sphincssha2128fsimple_to_PrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_rsa3072_sphincssha2128fsimple_to_PrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_rsa3072_sphincssha2128fsimple_to_EncryptedPrivateKeyInfo_der_encoder_functions + []; +extern const OSSL_DISPATCH + oqs_rsa3072_sphincssha2128fsimple_to_EncryptedPrivateKeyInfo_pem_encoder_functions + []; +extern const OSSL_DISPATCH + oqs_rsa3072_sphincssha2128fsimple_to_SubjectPublicKeyInfo_der_encoder_functions + []; +extern const OSSL_DISPATCH + oqs_rsa3072_sphincssha2128fsimple_to_SubjectPublicKeyInfo_pem_encoder_functions + []; +extern const OSSL_DISPATCH + oqs_rsa3072_sphincssha2128fsimple_to_text_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_PrivateKeyInfo_der_to_rsa3072_sphincssha2128fsimple_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_SubjectPublicKeyInfo_der_to_rsa3072_sphincssha2128fsimple_decoder_functions + []; +extern const OSSL_DISPATCH + oqs_sphincssha2128ssimple_to_PrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_sphincssha2128ssimple_to_PrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_sphincssha2128ssimple_to_EncryptedPrivateKeyInfo_der_encoder_functions + []; +extern const OSSL_DISPATCH + oqs_sphincssha2128ssimple_to_EncryptedPrivateKeyInfo_pem_encoder_functions + []; +extern const OSSL_DISPATCH + oqs_sphincssha2128ssimple_to_SubjectPublicKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_sphincssha2128ssimple_to_SubjectPublicKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_sphincssha2128ssimple_to_text_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_PrivateKeyInfo_der_to_sphincssha2128ssimple_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_SubjectPublicKeyInfo_der_to_sphincssha2128ssimple_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_p256_sphincssha2128ssimple_to_PrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_p256_sphincssha2128ssimple_to_PrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_p256_sphincssha2128ssimple_to_EncryptedPrivateKeyInfo_der_encoder_functions + []; +extern const OSSL_DISPATCH + oqs_p256_sphincssha2128ssimple_to_EncryptedPrivateKeyInfo_pem_encoder_functions + []; +extern const OSSL_DISPATCH + oqs_p256_sphincssha2128ssimple_to_SubjectPublicKeyInfo_der_encoder_functions + []; +extern const OSSL_DISPATCH + oqs_p256_sphincssha2128ssimple_to_SubjectPublicKeyInfo_pem_encoder_functions + []; +extern const OSSL_DISPATCH + oqs_p256_sphincssha2128ssimple_to_text_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_PrivateKeyInfo_der_to_p256_sphincssha2128ssimple_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_SubjectPublicKeyInfo_der_to_p256_sphincssha2128ssimple_decoder_functions + []; +extern const OSSL_DISPATCH + oqs_rsa3072_sphincssha2128ssimple_to_PrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_rsa3072_sphincssha2128ssimple_to_PrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_rsa3072_sphincssha2128ssimple_to_EncryptedPrivateKeyInfo_der_encoder_functions + []; +extern const OSSL_DISPATCH + oqs_rsa3072_sphincssha2128ssimple_to_EncryptedPrivateKeyInfo_pem_encoder_functions + []; +extern const OSSL_DISPATCH + oqs_rsa3072_sphincssha2128ssimple_to_SubjectPublicKeyInfo_der_encoder_functions + []; +extern const OSSL_DISPATCH + oqs_rsa3072_sphincssha2128ssimple_to_SubjectPublicKeyInfo_pem_encoder_functions + []; +extern const OSSL_DISPATCH + oqs_rsa3072_sphincssha2128ssimple_to_text_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_PrivateKeyInfo_der_to_rsa3072_sphincssha2128ssimple_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_SubjectPublicKeyInfo_der_to_rsa3072_sphincssha2128ssimple_decoder_functions + []; +extern const OSSL_DISPATCH + oqs_sphincssha2192fsimple_to_PrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_sphincssha2192fsimple_to_PrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_sphincssha2192fsimple_to_EncryptedPrivateKeyInfo_der_encoder_functions + []; +extern const OSSL_DISPATCH + oqs_sphincssha2192fsimple_to_EncryptedPrivateKeyInfo_pem_encoder_functions + []; +extern const OSSL_DISPATCH + oqs_sphincssha2192fsimple_to_SubjectPublicKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_sphincssha2192fsimple_to_SubjectPublicKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_sphincssha2192fsimple_to_text_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_PrivateKeyInfo_der_to_sphincssha2192fsimple_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_SubjectPublicKeyInfo_der_to_sphincssha2192fsimple_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_p384_sphincssha2192fsimple_to_PrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_p384_sphincssha2192fsimple_to_PrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_p384_sphincssha2192fsimple_to_EncryptedPrivateKeyInfo_der_encoder_functions + []; +extern const OSSL_DISPATCH + oqs_p384_sphincssha2192fsimple_to_EncryptedPrivateKeyInfo_pem_encoder_functions + []; +extern const OSSL_DISPATCH + oqs_p384_sphincssha2192fsimple_to_SubjectPublicKeyInfo_der_encoder_functions + []; +extern const OSSL_DISPATCH + oqs_p384_sphincssha2192fsimple_to_SubjectPublicKeyInfo_pem_encoder_functions + []; +extern const OSSL_DISPATCH + oqs_p384_sphincssha2192fsimple_to_text_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_PrivateKeyInfo_der_to_p384_sphincssha2192fsimple_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_SubjectPublicKeyInfo_der_to_p384_sphincssha2192fsimple_decoder_functions + []; +extern const OSSL_DISPATCH + oqs_sphincsshake128fsimple_to_PrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_sphincsshake128fsimple_to_PrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_sphincsshake128fsimple_to_EncryptedPrivateKeyInfo_der_encoder_functions + []; +extern const OSSL_DISPATCH + oqs_sphincsshake128fsimple_to_EncryptedPrivateKeyInfo_pem_encoder_functions + []; +extern const OSSL_DISPATCH + oqs_sphincsshake128fsimple_to_SubjectPublicKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_sphincsshake128fsimple_to_SubjectPublicKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_sphincsshake128fsimple_to_text_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_PrivateKeyInfo_der_to_sphincsshake128fsimple_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_SubjectPublicKeyInfo_der_to_sphincsshake128fsimple_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_p256_sphincsshake128fsimple_to_PrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_p256_sphincsshake128fsimple_to_PrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_p256_sphincsshake128fsimple_to_EncryptedPrivateKeyInfo_der_encoder_functions + []; +extern const OSSL_DISPATCH + oqs_p256_sphincsshake128fsimple_to_EncryptedPrivateKeyInfo_pem_encoder_functions + []; +extern const OSSL_DISPATCH + oqs_p256_sphincsshake128fsimple_to_SubjectPublicKeyInfo_der_encoder_functions + []; +extern const OSSL_DISPATCH + oqs_p256_sphincsshake128fsimple_to_SubjectPublicKeyInfo_pem_encoder_functions + []; +extern const OSSL_DISPATCH + oqs_p256_sphincsshake128fsimple_to_text_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_PrivateKeyInfo_der_to_p256_sphincsshake128fsimple_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_SubjectPublicKeyInfo_der_to_p256_sphincsshake128fsimple_decoder_functions + []; +extern const OSSL_DISPATCH + oqs_rsa3072_sphincsshake128fsimple_to_PrivateKeyInfo_der_encoder_functions + []; +extern const OSSL_DISPATCH + oqs_rsa3072_sphincsshake128fsimple_to_PrivateKeyInfo_pem_encoder_functions + []; +extern const OSSL_DISPATCH + oqs_rsa3072_sphincsshake128fsimple_to_EncryptedPrivateKeyInfo_der_encoder_functions + []; +extern const OSSL_DISPATCH + oqs_rsa3072_sphincsshake128fsimple_to_EncryptedPrivateKeyInfo_pem_encoder_functions + []; +extern const OSSL_DISPATCH + oqs_rsa3072_sphincsshake128fsimple_to_SubjectPublicKeyInfo_der_encoder_functions + []; +extern const OSSL_DISPATCH + oqs_rsa3072_sphincsshake128fsimple_to_SubjectPublicKeyInfo_pem_encoder_functions + []; +extern const OSSL_DISPATCH + oqs_rsa3072_sphincsshake128fsimple_to_text_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_PrivateKeyInfo_der_to_rsa3072_sphincsshake128fsimple_decoder_functions + []; +extern const OSSL_DISPATCH + oqs_SubjectPublicKeyInfo_der_to_rsa3072_sphincsshake128fsimple_decoder_functions + []; extern const OSSL_DISPATCH oqs_mayo1_to_PrivateKeyInfo_der_encoder_functions[]; extern const OSSL_DISPATCH oqs_mayo1_to_PrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_mayo1_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_mayo1_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_mayo1_to_SubjectPublicKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_mayo1_to_SubjectPublicKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_mayo1_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_mayo1_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_mayo1_to_SubjectPublicKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_mayo1_to_SubjectPublicKeyInfo_pem_encoder_functions[]; extern const OSSL_DISPATCH oqs_mayo1_to_text_encoder_functions[]; extern const OSSL_DISPATCH oqs_PrivateKeyInfo_der_to_mayo1_decoder_functions[]; -extern const OSSL_DISPATCH oqs_SubjectPublicKeyInfo_der_to_mayo1_decoder_functions[];extern const OSSL_DISPATCH oqs_p256_mayo1_to_PrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p256_mayo1_to_PrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p256_mayo1_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p256_mayo1_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p256_mayo1_to_SubjectPublicKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p256_mayo1_to_SubjectPublicKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_SubjectPublicKeyInfo_der_to_mayo1_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_p256_mayo1_to_PrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_p256_mayo1_to_PrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_p256_mayo1_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_p256_mayo1_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_p256_mayo1_to_SubjectPublicKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_p256_mayo1_to_SubjectPublicKeyInfo_pem_encoder_functions[]; extern const OSSL_DISPATCH oqs_p256_mayo1_to_text_encoder_functions[]; -extern const OSSL_DISPATCH oqs_PrivateKeyInfo_der_to_p256_mayo1_decoder_functions[]; -extern const OSSL_DISPATCH oqs_SubjectPublicKeyInfo_der_to_p256_mayo1_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_PrivateKeyInfo_der_to_p256_mayo1_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_SubjectPublicKeyInfo_der_to_p256_mayo1_decoder_functions[]; extern const OSSL_DISPATCH oqs_mayo2_to_PrivateKeyInfo_der_encoder_functions[]; extern const OSSL_DISPATCH oqs_mayo2_to_PrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_mayo2_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_mayo2_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_mayo2_to_SubjectPublicKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_mayo2_to_SubjectPublicKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_mayo2_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_mayo2_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_mayo2_to_SubjectPublicKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_mayo2_to_SubjectPublicKeyInfo_pem_encoder_functions[]; extern const OSSL_DISPATCH oqs_mayo2_to_text_encoder_functions[]; extern const OSSL_DISPATCH oqs_PrivateKeyInfo_der_to_mayo2_decoder_functions[]; -extern const OSSL_DISPATCH oqs_SubjectPublicKeyInfo_der_to_mayo2_decoder_functions[];extern const OSSL_DISPATCH oqs_p256_mayo2_to_PrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p256_mayo2_to_PrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p256_mayo2_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p256_mayo2_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p256_mayo2_to_SubjectPublicKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p256_mayo2_to_SubjectPublicKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_SubjectPublicKeyInfo_der_to_mayo2_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_p256_mayo2_to_PrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_p256_mayo2_to_PrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_p256_mayo2_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_p256_mayo2_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_p256_mayo2_to_SubjectPublicKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_p256_mayo2_to_SubjectPublicKeyInfo_pem_encoder_functions[]; extern const OSSL_DISPATCH oqs_p256_mayo2_to_text_encoder_functions[]; -extern const OSSL_DISPATCH oqs_PrivateKeyInfo_der_to_p256_mayo2_decoder_functions[]; -extern const OSSL_DISPATCH oqs_SubjectPublicKeyInfo_der_to_p256_mayo2_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_PrivateKeyInfo_der_to_p256_mayo2_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_SubjectPublicKeyInfo_der_to_p256_mayo2_decoder_functions[]; extern const OSSL_DISPATCH oqs_mayo3_to_PrivateKeyInfo_der_encoder_functions[]; extern const OSSL_DISPATCH oqs_mayo3_to_PrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_mayo3_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_mayo3_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_mayo3_to_SubjectPublicKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_mayo3_to_SubjectPublicKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_mayo3_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_mayo3_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_mayo3_to_SubjectPublicKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_mayo3_to_SubjectPublicKeyInfo_pem_encoder_functions[]; extern const OSSL_DISPATCH oqs_mayo3_to_text_encoder_functions[]; extern const OSSL_DISPATCH oqs_PrivateKeyInfo_der_to_mayo3_decoder_functions[]; -extern const OSSL_DISPATCH oqs_SubjectPublicKeyInfo_der_to_mayo3_decoder_functions[];extern const OSSL_DISPATCH oqs_p384_mayo3_to_PrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p384_mayo3_to_PrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p384_mayo3_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p384_mayo3_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p384_mayo3_to_SubjectPublicKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p384_mayo3_to_SubjectPublicKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_SubjectPublicKeyInfo_der_to_mayo3_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_p384_mayo3_to_PrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_p384_mayo3_to_PrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_p384_mayo3_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_p384_mayo3_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_p384_mayo3_to_SubjectPublicKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_p384_mayo3_to_SubjectPublicKeyInfo_pem_encoder_functions[]; extern const OSSL_DISPATCH oqs_p384_mayo3_to_text_encoder_functions[]; -extern const OSSL_DISPATCH oqs_PrivateKeyInfo_der_to_p384_mayo3_decoder_functions[]; -extern const OSSL_DISPATCH oqs_SubjectPublicKeyInfo_der_to_p384_mayo3_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_PrivateKeyInfo_der_to_p384_mayo3_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_SubjectPublicKeyInfo_der_to_p384_mayo3_decoder_functions[]; extern const OSSL_DISPATCH oqs_mayo5_to_PrivateKeyInfo_der_encoder_functions[]; extern const OSSL_DISPATCH oqs_mayo5_to_PrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_mayo5_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_mayo5_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_mayo5_to_SubjectPublicKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_mayo5_to_SubjectPublicKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_mayo5_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_mayo5_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_mayo5_to_SubjectPublicKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_mayo5_to_SubjectPublicKeyInfo_pem_encoder_functions[]; extern const OSSL_DISPATCH oqs_mayo5_to_text_encoder_functions[]; extern const OSSL_DISPATCH oqs_PrivateKeyInfo_der_to_mayo5_decoder_functions[]; -extern const OSSL_DISPATCH oqs_SubjectPublicKeyInfo_der_to_mayo5_decoder_functions[];extern const OSSL_DISPATCH oqs_p521_mayo5_to_PrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p521_mayo5_to_PrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p521_mayo5_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p521_mayo5_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p521_mayo5_to_SubjectPublicKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p521_mayo5_to_SubjectPublicKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_SubjectPublicKeyInfo_der_to_mayo5_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_p521_mayo5_to_PrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_p521_mayo5_to_PrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_p521_mayo5_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_p521_mayo5_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_p521_mayo5_to_SubjectPublicKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_p521_mayo5_to_SubjectPublicKeyInfo_pem_encoder_functions[]; extern const OSSL_DISPATCH oqs_p521_mayo5_to_text_encoder_functions[]; -extern const OSSL_DISPATCH oqs_PrivateKeyInfo_der_to_p521_mayo5_decoder_functions[]; -extern const OSSL_DISPATCH oqs_SubjectPublicKeyInfo_der_to_p521_mayo5_decoder_functions[]; -extern const OSSL_DISPATCH oqs_CROSSrsdp128balanced_to_PrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_CROSSrsdp128balanced_to_PrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_CROSSrsdp128balanced_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_CROSSrsdp128balanced_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_CROSSrsdp128balanced_to_SubjectPublicKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH oqs_CROSSrsdp128balanced_to_SubjectPublicKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_PrivateKeyInfo_der_to_p521_mayo5_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_SubjectPublicKeyInfo_der_to_p521_mayo5_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_CROSSrsdp128balanced_to_PrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_CROSSrsdp128balanced_to_PrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_CROSSrsdp128balanced_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_CROSSrsdp128balanced_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_CROSSrsdp128balanced_to_SubjectPublicKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_CROSSrsdp128balanced_to_SubjectPublicKeyInfo_pem_encoder_functions[]; extern const OSSL_DISPATCH oqs_CROSSrsdp128balanced_to_text_encoder_functions[]; -extern const OSSL_DISPATCH oqs_PrivateKeyInfo_der_to_CROSSrsdp128balanced_decoder_functions[]; -extern const OSSL_DISPATCH oqs_SubjectPublicKeyInfo_der_to_CROSSrsdp128balanced_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_PrivateKeyInfo_der_to_CROSSrsdp128balanced_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_SubjectPublicKeyInfo_der_to_CROSSrsdp128balanced_decoder_functions[]; ///// OQS_TEMPLATE_FRAGMENT_ENDECODER_FUNCTIONS_END ///// OQS_TEMPLATE_FRAGMENT_ALG_FUNCTIONS_START -extern const OSSL_DISPATCH oqs_dilithium2_keymgmt_functions[];extern const OSSL_DISPATCH oqs_p256_dilithium2_keymgmt_functions[];extern const OSSL_DISPATCH oqs_rsa3072_dilithium2_keymgmt_functions[]; -extern const OSSL_DISPATCH oqs_dilithium3_keymgmt_functions[];extern const OSSL_DISPATCH oqs_p384_dilithium3_keymgmt_functions[]; -extern const OSSL_DISPATCH oqs_dilithium5_keymgmt_functions[];extern const OSSL_DISPATCH oqs_p521_dilithium5_keymgmt_functions[]; -extern const OSSL_DISPATCH oqs_mldsa44_keymgmt_functions[];extern const OSSL_DISPATCH oqs_p256_mldsa44_keymgmt_functions[];extern const OSSL_DISPATCH oqs_rsa3072_mldsa44_keymgmt_functions[];extern const OSSL_DISPATCH oqs_mldsa44_pss2048_keymgmt_functions[];extern const OSSL_DISPATCH oqs_mldsa44_rsa2048_keymgmt_functions[];extern const OSSL_DISPATCH oqs_mldsa44_ed25519_keymgmt_functions[];extern const OSSL_DISPATCH oqs_mldsa44_p256_keymgmt_functions[];extern const OSSL_DISPATCH oqs_mldsa44_bp256_keymgmt_functions[]; -extern const OSSL_DISPATCH oqs_mldsa65_keymgmt_functions[];extern const OSSL_DISPATCH oqs_p384_mldsa65_keymgmt_functions[];extern const OSSL_DISPATCH oqs_mldsa65_pss3072_keymgmt_functions[];extern const OSSL_DISPATCH oqs_mldsa65_rsa3072_keymgmt_functions[];extern const OSSL_DISPATCH oqs_mldsa65_p256_keymgmt_functions[];extern const OSSL_DISPATCH oqs_mldsa65_bp256_keymgmt_functions[];extern const OSSL_DISPATCH oqs_mldsa65_ed25519_keymgmt_functions[]; -extern const OSSL_DISPATCH oqs_mldsa87_keymgmt_functions[];extern const OSSL_DISPATCH oqs_p521_mldsa87_keymgmt_functions[];extern const OSSL_DISPATCH oqs_mldsa87_p384_keymgmt_functions[];extern const OSSL_DISPATCH oqs_mldsa87_bp384_keymgmt_functions[];extern const OSSL_DISPATCH oqs_mldsa87_ed448_keymgmt_functions[]; -extern const OSSL_DISPATCH oqs_falcon512_keymgmt_functions[];extern const OSSL_DISPATCH oqs_p256_falcon512_keymgmt_functions[];extern const OSSL_DISPATCH oqs_rsa3072_falcon512_keymgmt_functions[]; -extern const OSSL_DISPATCH oqs_falconpadded512_keymgmt_functions[];extern const OSSL_DISPATCH oqs_p256_falconpadded512_keymgmt_functions[];extern const OSSL_DISPATCH oqs_rsa3072_falconpadded512_keymgmt_functions[]; -extern const OSSL_DISPATCH oqs_falcon1024_keymgmt_functions[];extern const OSSL_DISPATCH oqs_p521_falcon1024_keymgmt_functions[]; -extern const OSSL_DISPATCH oqs_falconpadded1024_keymgmt_functions[];extern const OSSL_DISPATCH oqs_p521_falconpadded1024_keymgmt_functions[]; -extern const OSSL_DISPATCH oqs_sphincssha2128fsimple_keymgmt_functions[];extern const OSSL_DISPATCH oqs_p256_sphincssha2128fsimple_keymgmt_functions[];extern const OSSL_DISPATCH oqs_rsa3072_sphincssha2128fsimple_keymgmt_functions[]; -extern const OSSL_DISPATCH oqs_sphincssha2128ssimple_keymgmt_functions[];extern const OSSL_DISPATCH oqs_p256_sphincssha2128ssimple_keymgmt_functions[];extern const OSSL_DISPATCH oqs_rsa3072_sphincssha2128ssimple_keymgmt_functions[]; -extern const OSSL_DISPATCH oqs_sphincssha2192fsimple_keymgmt_functions[];extern const OSSL_DISPATCH oqs_p384_sphincssha2192fsimple_keymgmt_functions[]; -extern const OSSL_DISPATCH oqs_sphincsshake128fsimple_keymgmt_functions[];extern const OSSL_DISPATCH oqs_p256_sphincsshake128fsimple_keymgmt_functions[];extern const OSSL_DISPATCH oqs_rsa3072_sphincsshake128fsimple_keymgmt_functions[]; -extern const OSSL_DISPATCH oqs_mayo1_keymgmt_functions[];extern const OSSL_DISPATCH oqs_p256_mayo1_keymgmt_functions[]; -extern const OSSL_DISPATCH oqs_mayo2_keymgmt_functions[];extern const OSSL_DISPATCH oqs_p256_mayo2_keymgmt_functions[]; -extern const OSSL_DISPATCH oqs_mayo3_keymgmt_functions[];extern const OSSL_DISPATCH oqs_p384_mayo3_keymgmt_functions[]; -extern const OSSL_DISPATCH oqs_mayo5_keymgmt_functions[];extern const OSSL_DISPATCH oqs_p521_mayo5_keymgmt_functions[]; +extern const OSSL_DISPATCH oqs_dilithium2_keymgmt_functions[]; +extern const OSSL_DISPATCH oqs_p256_dilithium2_keymgmt_functions[]; +extern const OSSL_DISPATCH oqs_rsa3072_dilithium2_keymgmt_functions[]; +extern const OSSL_DISPATCH oqs_dilithium3_keymgmt_functions[]; +extern const OSSL_DISPATCH oqs_p384_dilithium3_keymgmt_functions[]; +extern const OSSL_DISPATCH oqs_dilithium5_keymgmt_functions[]; +extern const OSSL_DISPATCH oqs_p521_dilithium5_keymgmt_functions[]; +extern const OSSL_DISPATCH oqs_mldsa44_keymgmt_functions[]; +extern const OSSL_DISPATCH oqs_p256_mldsa44_keymgmt_functions[]; +extern const OSSL_DISPATCH oqs_rsa3072_mldsa44_keymgmt_functions[]; +extern const OSSL_DISPATCH oqs_mldsa44_pss2048_keymgmt_functions[]; +extern const OSSL_DISPATCH oqs_mldsa44_rsa2048_keymgmt_functions[]; +extern const OSSL_DISPATCH oqs_mldsa44_ed25519_keymgmt_functions[]; +extern const OSSL_DISPATCH oqs_mldsa44_p256_keymgmt_functions[]; +extern const OSSL_DISPATCH oqs_mldsa44_bp256_keymgmt_functions[]; +extern const OSSL_DISPATCH oqs_mldsa65_keymgmt_functions[]; +extern const OSSL_DISPATCH oqs_p384_mldsa65_keymgmt_functions[]; +extern const OSSL_DISPATCH oqs_mldsa65_pss3072_keymgmt_functions[]; +extern const OSSL_DISPATCH oqs_mldsa65_rsa3072_keymgmt_functions[]; +extern const OSSL_DISPATCH oqs_mldsa65_p256_keymgmt_functions[]; +extern const OSSL_DISPATCH oqs_mldsa65_bp256_keymgmt_functions[]; +extern const OSSL_DISPATCH oqs_mldsa65_ed25519_keymgmt_functions[]; +extern const OSSL_DISPATCH oqs_mldsa87_keymgmt_functions[]; +extern const OSSL_DISPATCH oqs_p521_mldsa87_keymgmt_functions[]; +extern const OSSL_DISPATCH oqs_mldsa87_p384_keymgmt_functions[]; +extern const OSSL_DISPATCH oqs_mldsa87_bp384_keymgmt_functions[]; +extern const OSSL_DISPATCH oqs_mldsa87_ed448_keymgmt_functions[]; +extern const OSSL_DISPATCH oqs_falcon512_keymgmt_functions[]; +extern const OSSL_DISPATCH oqs_p256_falcon512_keymgmt_functions[]; +extern const OSSL_DISPATCH oqs_rsa3072_falcon512_keymgmt_functions[]; +extern const OSSL_DISPATCH oqs_falconpadded512_keymgmt_functions[]; +extern const OSSL_DISPATCH oqs_p256_falconpadded512_keymgmt_functions[]; +extern const OSSL_DISPATCH oqs_rsa3072_falconpadded512_keymgmt_functions[]; +extern const OSSL_DISPATCH oqs_falcon1024_keymgmt_functions[]; +extern const OSSL_DISPATCH oqs_p521_falcon1024_keymgmt_functions[]; +extern const OSSL_DISPATCH oqs_falconpadded1024_keymgmt_functions[]; +extern const OSSL_DISPATCH oqs_p521_falconpadded1024_keymgmt_functions[]; +extern const OSSL_DISPATCH oqs_sphincssha2128fsimple_keymgmt_functions[]; +extern const OSSL_DISPATCH oqs_p256_sphincssha2128fsimple_keymgmt_functions[]; +extern const OSSL_DISPATCH + oqs_rsa3072_sphincssha2128fsimple_keymgmt_functions[]; +extern const OSSL_DISPATCH oqs_sphincssha2128ssimple_keymgmt_functions[]; +extern const OSSL_DISPATCH oqs_p256_sphincssha2128ssimple_keymgmt_functions[]; +extern const OSSL_DISPATCH + oqs_rsa3072_sphincssha2128ssimple_keymgmt_functions[]; +extern const OSSL_DISPATCH oqs_sphincssha2192fsimple_keymgmt_functions[]; +extern const OSSL_DISPATCH oqs_p384_sphincssha2192fsimple_keymgmt_functions[]; +extern const OSSL_DISPATCH oqs_sphincsshake128fsimple_keymgmt_functions[]; +extern const OSSL_DISPATCH oqs_p256_sphincsshake128fsimple_keymgmt_functions[]; +extern const OSSL_DISPATCH + oqs_rsa3072_sphincsshake128fsimple_keymgmt_functions[]; +extern const OSSL_DISPATCH oqs_mayo1_keymgmt_functions[]; +extern const OSSL_DISPATCH oqs_p256_mayo1_keymgmt_functions[]; +extern const OSSL_DISPATCH oqs_mayo2_keymgmt_functions[]; +extern const OSSL_DISPATCH oqs_p256_mayo2_keymgmt_functions[]; +extern const OSSL_DISPATCH oqs_mayo3_keymgmt_functions[]; +extern const OSSL_DISPATCH oqs_p384_mayo3_keymgmt_functions[]; +extern const OSSL_DISPATCH oqs_mayo5_keymgmt_functions[]; +extern const OSSL_DISPATCH oqs_p521_mayo5_keymgmt_functions[]; extern const OSSL_DISPATCH oqs_CROSSrsdp128balanced_keymgmt_functions[]; extern const OSSL_DISPATCH oqs_frodo640aes_keymgmt_functions[]; diff --git a/oqsprov/oqs_sig.c b/oqsprov/oqs_sig.c index 2e48eaa3..5edb4b86 100644 --- a/oqsprov/oqs_sig.c +++ b/oqsprov/oqs_sig.c @@ -26,24 +26,24 @@ #include // TBD: Review what we really need/want: For now go with OSSL settings: -#define OSSL_MAX_NAME_SIZE 50 -#define OSSL_MAX_PROPQUERY_SIZE 256 /* Property query strings */ +#define OSSL_MAX_NAME_SIZE 50 +#define OSSL_MAX_PROPQUERY_SIZE 256 /* Property query strings */ #define COMPOSITE_OID_PREFIX_LEN 26 #ifdef NDEBUG -# define OQS_SIG_PRINTF(a) -# define OQS_SIG_PRINTF2(a, b) -# define OQS_SIG_PRINTF3(a, b, c) +#define OQS_SIG_PRINTF(a) +#define OQS_SIG_PRINTF2(a, b) +#define OQS_SIG_PRINTF3(a, b, c) #else -# define OQS_SIG_PRINTF(a) \ - if (getenv("OQSSIG")) \ - printf(a) -# define OQS_SIG_PRINTF2(a, b) \ - if (getenv("OQSSIG")) \ - printf(a, b) -# define OQS_SIG_PRINTF3(a, b, c) \ - if (getenv("OQSSIG")) \ - printf(a, b, c) +#define OQS_SIG_PRINTF(a) \ + if (getenv("OQSSIG")) \ + printf(a) +#define OQS_SIG_PRINTF2(a, b) \ + if (getenv("OQSSIG")) \ + printf(a, b) +#define OQS_SIG_PRINTF3(a, b, c) \ + if (getenv("OQSSIG")) \ + printf(a, b, c) #endif // NDEBUG static OSSL_FUNC_signature_newctx_fn oqs_sig_newctx; @@ -73,8 +73,7 @@ static OSSL_FUNC_signature_settable_ctx_md_params_fn oqs_sig_settable_ctx_md_params; // OIDS: -static int get_aid(unsigned char **oidbuf, const char *tls_name) -{ +static int get_aid(unsigned char **oidbuf, const char *tls_name) { X509_ALGOR *algor = X509_ALGOR_new(); int aidlen = 0; @@ -87,19 +86,19 @@ static int get_aid(unsigned char **oidbuf, const char *tls_name) DECLARE_ASN1_FUNCTIONS(CompositeSignature) -ASN1_NDEF_SEQUENCE(CompositeSignature) = { - ASN1_SIMPLE(CompositeSignature, sig1, ASN1_BIT_STRING), - ASN1_SIMPLE(CompositeSignature, sig2, ASN1_BIT_STRING), +ASN1_NDEF_SEQUENCE(CompositeSignature) = + { + ASN1_SIMPLE(CompositeSignature, sig1, ASN1_BIT_STRING), + ASN1_SIMPLE(CompositeSignature, sig2, ASN1_BIT_STRING), } ASN1_NDEF_SEQUENCE_END(CompositeSignature) -IMPLEMENT_ASN1_FUNCTIONS(CompositeSignature) + IMPLEMENT_ASN1_FUNCTIONS(CompositeSignature) -/* - * What's passed as an actual key is defined by the KEYMGMT interface. - */ + /* + * What's passed as an actual key is defined by the KEYMGMT interface. + */ -typedef struct -{ + typedef struct { OSSL_LIB_CTX *libctx; char *propq; OQSX_KEY *sig; @@ -127,8 +126,7 @@ typedef struct int operation; } PROV_OQSSIG_CTX; -static void *oqs_sig_newctx(void *provctx, const char *propq) -{ +static void *oqs_sig_newctx(void *provctx, const char *propq) { PROV_OQSSIG_CTX *poqs_sigctx; OQS_SIG_PRINTF2("OQS SIG provider: newctx called with propq %s\n", propq); @@ -147,8 +145,7 @@ static void *oqs_sig_newctx(void *provctx, const char *propq) } static int oqs_sig_setup_md(PROV_OQSSIG_CTX *ctx, const char *mdname, - const char *mdprops) -{ + const char *mdprops) { OQS_SIG_PRINTF3("OQS SIG provider: setup_md called for MD %s (alg %s)\n", mdname, ctx->sig->tls_name); if (mdprops == NULL) @@ -182,8 +179,7 @@ static int oqs_sig_setup_md(PROV_OQSSIG_CTX *ctx, const char *mdname, } static int oqs_sig_signverify_init(void *vpoqs_sigctx, void *voqssig, - int operation) -{ + int operation) { PROV_OQSSIG_CTX *poqs_sigctx = (PROV_OQSSIG_CTX *)vpoqs_sigctx; OQS_SIG_PRINTF("OQS SIG provider: signverify_init called\n"); @@ -193,8 +189,8 @@ static int oqs_sig_signverify_init(void *vpoqs_sigctx, void *voqssig, poqs_sigctx->sig = voqssig; poqs_sigctx->operation = operation; poqs_sigctx->flag_allow_md = 1; /* change permitted until first use */ - if ((operation == EVP_PKEY_OP_SIGN && !poqs_sigctx->sig->privkey) - || (operation == EVP_PKEY_OP_VERIFY && !poqs_sigctx->sig->pubkey)) { + if ((operation == EVP_PKEY_OP_SIGN && !poqs_sigctx->sig->privkey) || + (operation == EVP_PKEY_OP_VERIFY && !poqs_sigctx->sig->pubkey)) { ERR_raise(ERR_LIB_USER, OQSPROV_R_INVALID_KEY); return 0; } @@ -202,15 +198,13 @@ static int oqs_sig_signverify_init(void *vpoqs_sigctx, void *voqssig, } static int oqs_sig_sign_init(void *vpoqs_sigctx, void *voqssig, - const OSSL_PARAM params[]) -{ + const OSSL_PARAM params[]) { OQS_SIG_PRINTF("OQS SIG provider: sign_init called\n"); return oqs_sig_signverify_init(vpoqs_sigctx, voqssig, EVP_PKEY_OP_SIGN); } static int oqs_sig_verify_init(void *vpoqs_sigctx, void *voqssig, - const OSSL_PARAM params[]) -{ + const OSSL_PARAM params[]) { OQS_SIG_PRINTF("OQS SIG provider: verify_init called\n"); return oqs_sig_signverify_init(vpoqs_sigctx, voqssig, EVP_PKEY_OP_VERIFY); } @@ -253,8 +247,7 @@ static const unsigned char *composite_OID_prefix[] = { }; /*put the chars on in into memory on out*/ -void composite_prefix_conversion(char *out, const unsigned char *in) -{ +void composite_prefix_conversion(char *out, const unsigned char *in) { int temp; for (int i = 0; i < COMPOSITE_OID_PREFIX_LEN / 2; i++) { temp = OPENSSL_hexchar2int(in[2 * i]); @@ -269,8 +262,8 @@ void composite_prefix_conversion(char *out, const unsigned char *in) * NULL, we have to hash in case of hybrid signatures */ static int oqs_sig_sign(void *vpoqs_sigctx, unsigned char *sig, size_t *siglen, - size_t sigsize, const unsigned char *tbs, size_t tbslen) -{ + size_t sigsize, const unsigned char *tbs, + size_t tbslen) { PROV_OQSSIG_CTX *poqs_sigctx = (PROV_OQSSIG_CTX *)vpoqs_sigctx; OQSX_KEY *oqsxkey = poqs_sigctx->sig; OQS_SIG *oqs_key = poqs_sigctx->sig->oqsx_provider_ctx.oqsx_qs_ctx.sig; @@ -317,15 +310,14 @@ static int oqs_sig_sign(void *vpoqs_sigctx, unsigned char *sig, size_t *siglen, } if (is_hybrid) { - if ((classical_ctx_sign = EVP_PKEY_CTX_new(evpkey, NULL)) == NULL - || EVP_PKEY_sign_init(classical_ctx_sign) <= 0) { + if ((classical_ctx_sign = EVP_PKEY_CTX_new(evpkey, NULL)) == NULL || + EVP_PKEY_sign_init(classical_ctx_sign) <= 0) { ERR_raise(ERR_LIB_USER, ERR_R_FATAL); goto endsign; } if (oqsxkey->evp_info->keytype == EVP_PKEY_RSA) { if (EVP_PKEY_CTX_set_rsa_padding(classical_ctx_sign, - RSA_PKCS1_PADDING) - <= 0) { + RSA_PKCS1_PADDING) <= 0) { ERR_raise(ERR_LIB_USER, ERR_R_FATAL); goto endsign; } @@ -361,11 +353,11 @@ static int oqs_sig_sign(void *vpoqs_sigctx, unsigned char *sig, size_t *siglen, SHA512(tbs, tbslen, (unsigned char *)&digest); break; } - if ((EVP_PKEY_CTX_set_signature_md(classical_ctx_sign, classical_md) - <= 0) - || (EVP_PKEY_sign(classical_ctx_sign, sig + SIZE_OF_UINT32, - &actual_classical_sig_len, digest, digest_len) - <= 0)) { + if ((EVP_PKEY_CTX_set_signature_md(classical_ctx_sign, classical_md) <= + 0) || + (EVP_PKEY_sign(classical_ctx_sign, sig + SIZE_OF_UINT32, + &actual_classical_sig_len, digest, + digest_len) <= 0)) { ERR_raise(ERR_LIB_USER, ERR_R_FATAL); goto endsign; } @@ -399,11 +391,10 @@ static int oqs_sig_sign(void *vpoqs_sigctx, unsigned char *sig, size_t *siglen, const unsigned char *oid_prefix = composite_OID_prefix[comp_idx - 1]; char *final_tbs; CompositeSignature *compsig = CompositeSignature_new(); - size_t final_tbslen - = COMPOSITE_OID_PREFIX_LEN - / 2; // COMPOSITE_OID_PREFIX_LEN stores the size of the *char, but - // the prefix will be on memory, so each 2 chars will - // translate into one byte + size_t final_tbslen = COMPOSITE_OID_PREFIX_LEN / + 2; // COMPOSITE_OID_PREFIX_LEN stores the size of + // the *char, but the prefix will be on memory, + // so each 2 chars will translate into one byte int aux = 0; unsigned char *tbs_hash; @@ -418,10 +409,10 @@ static int oqs_sig_sign(void *vpoqs_sigctx, unsigned char *sig, size_t *siglen, } upcase_name = get_oqsname_fromtls(name); - if ((upcase_name != 0) - && ((!strcmp(upcase_name, OQS_SIG_alg_ml_dsa_65)) - || (!strcmp(upcase_name, OQS_SIG_alg_ml_dsa_87))) - || (name[0] == 'e')) { + if ((upcase_name != 0) && + ((!strcmp(upcase_name, OQS_SIG_alg_ml_dsa_65)) || + (!strcmp(upcase_name, OQS_SIG_alg_ml_dsa_87))) || + (name[0] == 'e')) { aux = 1; OPENSSL_free(name); break; @@ -465,8 +456,8 @@ static int oqs_sig_sign(void *vpoqs_sigctx, unsigned char *sig, size_t *siglen, ->length_signature; buf = OPENSSL_malloc(oqs_sig_len); if (OQS_SIG_sign(oqs_key, buf, &oqs_sig_len, final_tbs, - final_tbslen, oqsxkey->comp_privkey[i]) - != OQS_SUCCESS) { + final_tbslen, + oqsxkey->comp_privkey[i]) != OQS_SUCCESS) { ERR_raise(ERR_LIB_USER, OQSPROV_R_SIGNING_FAILED); CompositeSignature_free(compsig); OPENSSL_free(final_tbs); @@ -487,11 +478,9 @@ static int oqs_sig_sign(void *vpoqs_sigctx, unsigned char *sig, size_t *siglen, if (name[0] == 'e') { // ed25519 or ed448 EVP_MD_CTX *evp_ctx = EVP_MD_CTX_new(); if ((EVP_DigestSignInit(evp_ctx, NULL, NULL, NULL, - oqs_key_classic) - <= 0) - || (EVP_DigestSign(evp_ctx, buf, &oqs_sig_len, - final_tbs, final_tbslen) - <= 0)) { + oqs_key_classic) <= 0) || + (EVP_DigestSign(evp_ctx, buf, &oqs_sig_len, final_tbs, + final_tbslen) <= 0)) { ERR_raise(ERR_LIB_USER, ERR_R_FATAL); CompositeSignature_free(compsig); OPENSSL_free(final_tbs); @@ -502,10 +491,9 @@ static int oqs_sig_sign(void *vpoqs_sigctx, unsigned char *sig, size_t *siglen, } EVP_MD_CTX_free(evp_ctx); } else { - if ((classical_ctx_sign - = EVP_PKEY_CTX_new(oqs_key_classic, NULL)) - == NULL - || (EVP_PKEY_sign_init(classical_ctx_sign) <= 0)) { + if ((classical_ctx_sign = + EVP_PKEY_CTX_new(oqs_key_classic, NULL)) == NULL || + (EVP_PKEY_sign_init(classical_ctx_sign) <= 0)) { ERR_raise(ERR_LIB_USER, ERR_R_FATAL); CompositeSignature_free(compsig); OPENSSL_free(final_tbs); @@ -533,15 +521,13 @@ static int oqs_sig_sign(void *vpoqs_sigctx, unsigned char *sig, size_t *siglen, goto endsign; } } - if ((EVP_PKEY_CTX_set_rsa_padding(classical_ctx_sign, - RSA_PKCS1_PSS_PADDING) - <= 0) - || (EVP_PKEY_CTX_set_rsa_pss_saltlen( - classical_ctx_sign, salt) - <= 0) - || (EVP_PKEY_CTX_set_rsa_mgf1_md(classical_ctx_sign, - pss_mgf1) - <= 0)) { + if ((EVP_PKEY_CTX_set_rsa_padding( + classical_ctx_sign, RSA_PKCS1_PSS_PADDING) <= + 0) || + (EVP_PKEY_CTX_set_rsa_pss_saltlen( + classical_ctx_sign, salt) <= 0) || + (EVP_PKEY_CTX_set_rsa_mgf1_md(classical_ctx_sign, + pss_mgf1) <= 0)) { ERR_raise(ERR_LIB_USER, ERR_R_FATAL); CompositeSignature_free(compsig); OPENSSL_free(final_tbs); @@ -550,11 +536,9 @@ static int oqs_sig_sign(void *vpoqs_sigctx, unsigned char *sig, size_t *siglen, goto endsign; } } else if (oqsxkey->oqsx_provider_ctx.oqsx_evp_ctx->evp_info - ->keytype - == EVP_PKEY_RSA) { - if (EVP_PKEY_CTX_set_rsa_padding(classical_ctx_sign, - RSA_PKCS1_PADDING) - <= 0) { + ->keytype == EVP_PKEY_RSA) { + if (EVP_PKEY_CTX_set_rsa_padding( + classical_ctx_sign, RSA_PKCS1_PADDING) <= 0) { ERR_raise(ERR_LIB_USER, ERR_R_FATAL); CompositeSignature_free(compsig); OPENSSL_free(final_tbs); @@ -576,11 +560,9 @@ static int oqs_sig_sign(void *vpoqs_sigctx, unsigned char *sig, size_t *siglen, } if ((EVP_PKEY_CTX_set_signature_md(classical_ctx_sign, - classical_md) - <= 0) - || (EVP_PKEY_sign(classical_ctx_sign, buf, &oqs_sig_len, - digest, digest_len) - <= 0)) { + classical_md) <= 0) || + (EVP_PKEY_sign(classical_ctx_sign, buf, &oqs_sig_len, + digest, digest_len) <= 0)) { ERR_raise(ERR_LIB_USER, ERR_R_FATAL); CompositeSignature_free(compsig); OPENSSL_free(final_tbs); @@ -605,13 +587,13 @@ static int oqs_sig_sign(void *vpoqs_sigctx, unsigned char *sig, size_t *siglen, if (i == 0) { compsig->sig1->data = OPENSSL_memdup(buf, oqs_sig_len); compsig->sig1->length = oqs_sig_len; - compsig->sig1->flags - = 8; // set as 8 to not check for unused bits + compsig->sig1->flags = + 8; // set as 8 to not check for unused bits } else { compsig->sig2->data = OPENSSL_memdup(buf, oqs_sig_len); compsig->sig2->length = oqs_sig_len; - compsig->sig2->flags - = 8; // set as 8 to not check for unused bits + compsig->sig2->flags = + 8; // set as 8 to not check for unused bits } OPENSSL_free(buf); @@ -622,8 +604,8 @@ static int oqs_sig_sign(void *vpoqs_sigctx, unsigned char *sig, size_t *siglen, CompositeSignature_free(compsig); OPENSSL_free(final_tbs); } else if (OQS_SIG_sign(oqs_key, sig + index, &oqs_sig_len, tbs, tbslen, - oqsxkey->comp_privkey[oqsxkey->numkeys - 1]) - != OQS_SUCCESS) { + oqsxkey->comp_privkey[oqsxkey->numkeys - 1]) != + OQS_SUCCESS) { ERR_raise(ERR_LIB_USER, OQSPROV_R_SIGNING_FAILED); goto endsign; } @@ -642,8 +624,7 @@ static int oqs_sig_sign(void *vpoqs_sigctx, unsigned char *sig, size_t *siglen, static int oqs_sig_verify(void *vpoqs_sigctx, const unsigned char *sig, size_t siglen, const unsigned char *tbs, - size_t tbslen) -{ + size_t tbslen) { PROV_OQSSIG_CTX *poqs_sigctx = (PROV_OQSSIG_CTX *)vpoqs_sigctx; OQSX_KEY *oqsxkey = poqs_sigctx->sig; OQS_SIG *oqs_key = poqs_sigctx->sig->oqsx_provider_ctx.oqsx_qs_ctx.sig; @@ -657,12 +638,12 @@ static int oqs_sig_verify(void *vpoqs_sigctx, const unsigned char *sig, int rv = 0; ASN1_BIT_STRING *comp_sig; - OQS_SIG_PRINTF3( - "OQS SIG provider: verify called with siglen %ld bytes and tbslen %ld\n", - siglen, tbslen); + OQS_SIG_PRINTF3("OQS SIG provider: verify called with siglen %ld bytes and " + "tbslen %ld\n", + siglen, tbslen); - if (!oqsxkey || !oqs_key || !oqsxkey->pubkey || sig == NULL - || (tbs == NULL && tbslen > 0)) { + if (!oqsxkey || !oqs_key || !oqsxkey->pubkey || sig == NULL || + (tbs == NULL && tbslen > 0)) { ERR_raise(ERR_LIB_USER, OQSPROV_R_WRONG_PARAMETERS); goto endverify; } @@ -672,20 +653,20 @@ static int oqs_sig_verify(void *vpoqs_sigctx, const unsigned char *sig, uint32_t actual_classical_sig_len = 0; int digest_len; unsigned char digest[SHA512_DIGEST_LENGTH]; /* init with max length */ - size_t max_pq_sig_len - = oqsxkey->oqsx_provider_ctx.oqsx_qs_ctx.sig->length_signature; - size_t max_classical_sig_len = oqsxkey->oqsx_provider_ctx.oqsx_evp_ctx - ->evp_info->length_signature; - - if ((ctx_verify = EVP_PKEY_CTX_new(oqsxkey->classical_pkey, NULL)) - == NULL - || EVP_PKEY_verify_init(ctx_verify) <= 0) { + size_t max_pq_sig_len = + oqsxkey->oqsx_provider_ctx.oqsx_qs_ctx.sig->length_signature; + size_t max_classical_sig_len = + oqsxkey->oqsx_provider_ctx.oqsx_evp_ctx->evp_info->length_signature; + + if ((ctx_verify = EVP_PKEY_CTX_new(oqsxkey->classical_pkey, NULL)) == + NULL || + EVP_PKEY_verify_init(ctx_verify) <= 0) { ERR_raise(ERR_LIB_USER, OQSPROV_R_VERIFY_ERROR); goto endverify; } if (oqsxkey->evp_info->keytype == EVP_PKEY_RSA) { - if (EVP_PKEY_CTX_set_rsa_padding(ctx_verify, RSA_PKCS1_PADDING) - <= 0) { + if (EVP_PKEY_CTX_set_rsa_padding(ctx_verify, RSA_PKCS1_PADDING) <= + 0) { ERR_raise(ERR_LIB_USER, OQSPROV_R_WRONG_PARAMETERS); goto endverify; } @@ -693,11 +674,11 @@ static int oqs_sig_verify(void *vpoqs_sigctx, const unsigned char *sig, if (siglen > SIZE_OF_UINT32) { size_t actual_pq_sig_len = 0; DECODE_UINT32(actual_classical_sig_len, sig); - actual_pq_sig_len - = siglen - SIZE_OF_UINT32 - actual_classical_sig_len; - if (siglen <= (SIZE_OF_UINT32 + actual_classical_sig_len) - || actual_classical_sig_len > max_classical_sig_len - || actual_pq_sig_len > max_pq_sig_len) { + actual_pq_sig_len = + siglen - SIZE_OF_UINT32 - actual_classical_sig_len; + if (siglen <= (SIZE_OF_UINT32 + actual_classical_sig_len) || + actual_classical_sig_len > max_classical_sig_len || + actual_pq_sig_len > max_pq_sig_len) { ERR_raise(ERR_LIB_USER, OQSPROV_R_INVALID_ENCODING); goto endverify; } @@ -729,10 +710,10 @@ static int oqs_sig_verify(void *vpoqs_sigctx, const unsigned char *sig, SHA512(tbs, tbslen, (unsigned char *)&digest); break; } - if ((EVP_PKEY_CTX_set_signature_md(ctx_verify, classical_md) <= 0) - || (EVP_PKEY_verify(ctx_verify, sig + SIZE_OF_UINT32, - actual_classical_sig_len, digest, digest_len) - <= 0)) { + if ((EVP_PKEY_CTX_set_signature_md(ctx_verify, classical_md) <= 0) || + (EVP_PKEY_verify(ctx_verify, sig + SIZE_OF_UINT32, + actual_classical_sig_len, digest, + digest_len) <= 0)) { ERR_raise(ERR_LIB_USER, OQSPROV_R_VERIFY_ERROR); goto endverify; } else { @@ -783,10 +764,10 @@ static int oqs_sig_verify(void *vpoqs_sigctx, const unsigned char *sig, } upcase_name = get_oqsname_fromtls(name); - if ((upcase_name != 0) - && ((!strcmp(upcase_name, OQS_SIG_alg_ml_dsa_65)) - || (!strcmp(upcase_name, OQS_SIG_alg_ml_dsa_87))) - || (name[0] == 'e')) { + if ((upcase_name != 0) && + ((!strcmp(upcase_name, OQS_SIG_alg_ml_dsa_65)) || + (!strcmp(upcase_name, OQS_SIG_alg_ml_dsa_87))) || + (name[0] == 'e')) { aux = 1; OPENSSL_free(name); break; @@ -835,8 +816,8 @@ static int oqs_sig_verify(void *vpoqs_sigctx, const unsigned char *sig, if (get_oqsname_fromtls(name)) { if (OQS_SIG_verify(oqs_key, final_tbs, final_tbslen, buf, - buf_len, oqsxkey->comp_pubkey[i]) - != OQS_SUCCESS) { + buf_len, + oqsxkey->comp_pubkey[i]) != OQS_SUCCESS) { ERR_raise(ERR_LIB_USER, OQSPROV_R_VERIFY_ERROR); OPENSSL_free(name); CompositeSignature_free(compsig); @@ -853,11 +834,9 @@ static int oqs_sig_verify(void *vpoqs_sigctx, const unsigned char *sig, if (name[0] == 'e') { // ed25519 or ed448 EVP_MD_CTX *evp_ctx = EVP_MD_CTX_new(); if ((EVP_DigestVerifyInit(evp_ctx, NULL, NULL, NULL, - oqsxkey->classical_pkey) - <= 0) - || (EVP_DigestVerify(evp_ctx, buf, buf_len, final_tbs, - final_tbslen) - <= 0)) { + oqsxkey->classical_pkey) <= 0) || + (EVP_DigestVerify(evp_ctx, buf, buf_len, final_tbs, + final_tbslen) <= 0)) { ERR_raise(ERR_LIB_USER, OQSPROV_R_VERIFY_ERROR); OPENSSL_free(name); EVP_MD_CTX_free(evp_ctx); @@ -867,10 +846,9 @@ static int oqs_sig_verify(void *vpoqs_sigctx, const unsigned char *sig, } EVP_MD_CTX_free(evp_ctx); } else { - if (((ctx_verify - = EVP_PKEY_CTX_new(oqsxkey->classical_pkey, NULL)) - == NULL) - || (EVP_PKEY_verify_init(ctx_verify) <= 0)) { + if (((ctx_verify = EVP_PKEY_CTX_new(oqsxkey->classical_pkey, + NULL)) == NULL) || + (EVP_PKEY_verify_init(ctx_verify) <= 0)) { ERR_raise(ERR_LIB_USER, OQSPROV_R_VERIFY_ERROR); OPENSSL_free(name); CompositeSignature_free(compsig); @@ -895,15 +873,12 @@ static int oqs_sig_verify(void *vpoqs_sigctx, const unsigned char *sig, goto endverify; } } - if ((EVP_PKEY_CTX_set_rsa_padding(ctx_verify, - RSA_PKCS1_PSS_PADDING) - <= 0) - || (EVP_PKEY_CTX_set_rsa_pss_saltlen(ctx_verify, - salt) - <= 0) - || (EVP_PKEY_CTX_set_rsa_mgf1_md(ctx_verify, - pss_mgf1) - <= 0)) { + if ((EVP_PKEY_CTX_set_rsa_padding( + ctx_verify, RSA_PKCS1_PSS_PADDING) <= 0) || + (EVP_PKEY_CTX_set_rsa_pss_saltlen(ctx_verify, + salt) <= 0) || + (EVP_PKEY_CTX_set_rsa_mgf1_md(ctx_verify, + pss_mgf1) <= 0)) { ERR_raise(ERR_LIB_USER, OQSPROV_R_WRONG_PARAMETERS); OPENSSL_free(name); CompositeSignature_free(compsig); @@ -911,11 +886,9 @@ static int oqs_sig_verify(void *vpoqs_sigctx, const unsigned char *sig, goto endverify; } } else if (oqsxkey->oqsx_provider_ctx.oqsx_evp_ctx->evp_info - ->keytype - == EVP_PKEY_RSA) { - if (EVP_PKEY_CTX_set_rsa_padding(ctx_verify, - RSA_PKCS1_PADDING) - <= 0) { + ->keytype == EVP_PKEY_RSA) { + if (EVP_PKEY_CTX_set_rsa_padding( + ctx_verify, RSA_PKCS1_PADDING) <= 0) { ERR_raise(ERR_LIB_USER, OQSPROV_R_WRONG_PARAMETERS); OPENSSL_free(name); CompositeSignature_free(compsig); @@ -935,11 +908,10 @@ static int oqs_sig_verify(void *vpoqs_sigctx, const unsigned char *sig, (unsigned char *)&digest); } - if ((EVP_PKEY_CTX_set_signature_md(ctx_verify, classical_md) - <= 0) - || (EVP_PKEY_verify(ctx_verify, buf, buf_len, digest, - digest_len) - <= 0)) { + if ((EVP_PKEY_CTX_set_signature_md(ctx_verify, + classical_md) <= 0) || + (EVP_PKEY_verify(ctx_verify, buf, buf_len, digest, + digest_len) <= 0)) { ERR_raise(ERR_LIB_USER, OQSPROV_R_VERIFY_ERROR); OPENSSL_free(name); CompositeSignature_free(compsig); @@ -958,10 +930,9 @@ static int oqs_sig_verify(void *vpoqs_sigctx, const unsigned char *sig, ERR_raise(ERR_LIB_USER, OQSPROV_R_WRONG_PARAMETERS); goto endverify; } - if (OQS_SIG_verify(oqs_key, tbs, tbslen, sig + index, - siglen - classical_sig_len, - oqsxkey->comp_pubkey[oqsxkey->numkeys - 1]) - != OQS_SUCCESS) { + if (OQS_SIG_verify( + oqs_key, tbs, tbslen, sig + index, siglen - classical_sig_len, + oqsxkey->comp_pubkey[oqsxkey->numkeys - 1]) != OQS_SUCCESS) { ERR_raise(ERR_LIB_USER, OQSPROV_R_VERIFY_ERROR); goto endverify; } @@ -978,8 +949,7 @@ static int oqs_sig_verify(void *vpoqs_sigctx, const unsigned char *sig, static int oqs_sig_digest_signverify_init(void *vpoqs_sigctx, const char *mdname, void *voqssig, - int operation) -{ + int operation) { PROV_OQSSIG_CTX *poqs_sigctx = (PROV_OQSSIG_CTX *)vpoqs_sigctx; OQS_SIG_PRINTF2( @@ -1014,24 +984,23 @@ static int oqs_sig_digest_signverify_init(void *vpoqs_sigctx, } static int oqs_sig_digest_sign_init(void *vpoqs_sigctx, const char *mdname, - void *voqssig, const OSSL_PARAM params[]) -{ + void *voqssig, const OSSL_PARAM params[]) { OQS_SIG_PRINTF("OQS SIG provider: digest_sign_init called\n"); return oqs_sig_digest_signverify_init(vpoqs_sigctx, mdname, voqssig, EVP_PKEY_OP_SIGN); } static int oqs_sig_digest_verify_init(void *vpoqs_sigctx, const char *mdname, - void *voqssig, const OSSL_PARAM params[]) -{ + void *voqssig, + const OSSL_PARAM params[]) { OQS_SIG_PRINTF("OQS SIG provider: sig_digest_verify called\n"); return oqs_sig_digest_signverify_init(vpoqs_sigctx, mdname, voqssig, EVP_PKEY_OP_VERIFY); } int oqs_sig_digest_signverify_update(void *vpoqs_sigctx, - const unsigned char *data, size_t datalen) -{ + const unsigned char *data, + size_t datalen) { PROV_OQSSIG_CTX *poqs_sigctx = (PROV_OQSSIG_CTX *)vpoqs_sigctx; OQS_SIG_PRINTF("OQS SIG provider: digest_signverify_update called\n"); @@ -1060,16 +1029,15 @@ int oqs_sig_digest_signverify_update(void *vpoqs_sigctx, poqs_sigctx->mdsize = datalen; memcpy(poqs_sigctx->mddata, data, poqs_sigctx->mdsize); } - OQS_SIG_PRINTF2( - "OQS SIG provider: digest_signverify_update collected %ld bytes...\n", - poqs_sigctx->mdsize); + OQS_SIG_PRINTF2("OQS SIG provider: digest_signverify_update collected " + "%ld bytes...\n", + poqs_sigctx->mdsize); } return 1; } int oqs_sig_digest_sign_final(void *vpoqs_sigctx, unsigned char *sig, - size_t *siglen, size_t sigsize) -{ + size_t *siglen, size_t sigsize) { PROV_OQSSIG_CTX *poqs_sigctx = (PROV_OQSSIG_CTX *)vpoqs_sigctx; unsigned char digest[EVP_MAX_MD_SIZE]; unsigned int dlen = 0; @@ -1104,8 +1072,7 @@ int oqs_sig_digest_sign_final(void *vpoqs_sigctx, unsigned char *sig, } int oqs_sig_digest_verify_final(void *vpoqs_sigctx, const unsigned char *sig, - size_t siglen) -{ + size_t siglen) { PROV_OQSSIG_CTX *poqs_sigctx = (PROV_OQSSIG_CTX *)vpoqs_sigctx; unsigned char digest[EVP_MAX_MD_SIZE]; unsigned int dlen = 0; @@ -1127,8 +1094,7 @@ int oqs_sig_digest_verify_final(void *vpoqs_sigctx, const unsigned char *sig, poqs_sigctx->mdsize); } -static void oqs_sig_freectx(void *vpoqs_sigctx) -{ +static void oqs_sig_freectx(void *vpoqs_sigctx) { PROV_OQSSIG_CTX *ctx = (PROV_OQSSIG_CTX *)vpoqs_sigctx; OQS_SIG_PRINTF("OQS SIG provider: freectx called\n"); @@ -1148,8 +1114,7 @@ static void oqs_sig_freectx(void *vpoqs_sigctx) OPENSSL_free(ctx); } -static void *oqs_sig_dupctx(void *vpoqs_sigctx) -{ +static void *oqs_sig_dupctx(void *vpoqs_sigctx) { PROV_OQSSIG_CTX *srcctx = (PROV_OQSSIG_CTX *)vpoqs_sigctx; PROV_OQSSIG_CTX *dstctx; @@ -1174,8 +1139,8 @@ static void *oqs_sig_dupctx(void *vpoqs_sigctx) if (srcctx->mdctx != NULL) { dstctx->mdctx = EVP_MD_CTX_new(); - if (dstctx->mdctx == NULL - || !EVP_MD_CTX_copy_ex(dstctx->mdctx, srcctx->mdctx)) + if (dstctx->mdctx == NULL || + !EVP_MD_CTX_copy_ex(dstctx->mdctx, srcctx->mdctx)) goto err; } @@ -1205,8 +1170,7 @@ static void *oqs_sig_dupctx(void *vpoqs_sigctx) return NULL; } -static int oqs_sig_get_ctx_params(void *vpoqs_sigctx, OSSL_PARAM *params) -{ +static int oqs_sig_get_ctx_params(void *vpoqs_sigctx, OSSL_PARAM *params) { PROV_OQSSIG_CTX *poqs_sigctx = (PROV_OQSSIG_CTX *)vpoqs_sigctx; OSSL_PARAM *p; @@ -1217,13 +1181,12 @@ static int oqs_sig_get_ctx_params(void *vpoqs_sigctx, OSSL_PARAM *params) p = OSSL_PARAM_locate(params, OSSL_SIGNATURE_PARAM_ALGORITHM_ID); if (poqs_sigctx->aid == NULL) { - poqs_sigctx->aid_len - = get_aid(&(poqs_sigctx->aid), poqs_sigctx->sig->tls_name); + poqs_sigctx->aid_len = + get_aid(&(poqs_sigctx->aid), poqs_sigctx->sig->tls_name); } - if (p != NULL - && !OSSL_PARAM_set_octet_string(p, poqs_sigctx->aid, - poqs_sigctx->aid_len)) + if (p != NULL && + !OSSL_PARAM_set_octet_string(p, poqs_sigctx->aid, poqs_sigctx->aid_len)) return 0; p = OSSL_PARAM_locate(params, OSSL_SIGNATURE_PARAM_DIGEST); @@ -1233,20 +1196,19 @@ static int oqs_sig_get_ctx_params(void *vpoqs_sigctx, OSSL_PARAM *params) return 1; } -static const OSSL_PARAM known_gettable_ctx_params[] - = {OSSL_PARAM_octet_string(OSSL_SIGNATURE_PARAM_ALGORITHM_ID, NULL, 0), - OSSL_PARAM_utf8_string(OSSL_SIGNATURE_PARAM_DIGEST, NULL, 0), - OSSL_PARAM_END}; +static const OSSL_PARAM known_gettable_ctx_params[] = { + OSSL_PARAM_octet_string(OSSL_SIGNATURE_PARAM_ALGORITHM_ID, NULL, 0), + OSSL_PARAM_utf8_string(OSSL_SIGNATURE_PARAM_DIGEST, NULL, 0), + OSSL_PARAM_END}; static const OSSL_PARAM * oqs_sig_gettable_ctx_params(ossl_unused void *vpoqs_sigctx, - ossl_unused void *vctx) -{ + ossl_unused void *vctx) { OQS_SIG_PRINTF("OQS SIG provider: gettable_ctx_params called\n"); return known_gettable_ctx_params; } -static int oqs_sig_set_ctx_params(void *vpoqs_sigctx, const OSSL_PARAM params[]) -{ +static int oqs_sig_set_ctx_params(void *vpoqs_sigctx, + const OSSL_PARAM params[]) { PROV_OQSSIG_CTX *poqs_sigctx = (PROV_OQSSIG_CTX *)vpoqs_sigctx; const OSSL_PARAM *p; @@ -1261,13 +1223,13 @@ static int oqs_sig_set_ctx_params(void *vpoqs_sigctx, const OSSL_PARAM params[]) if (p != NULL) { char mdname[OSSL_MAX_NAME_SIZE] = "", *pmdname = mdname; char mdprops[OSSL_MAX_PROPQUERY_SIZE] = "", *pmdprops = mdprops; - const OSSL_PARAM *propsp - = OSSL_PARAM_locate_const(params, OSSL_SIGNATURE_PARAM_PROPERTIES); + const OSSL_PARAM *propsp = + OSSL_PARAM_locate_const(params, OSSL_SIGNATURE_PARAM_PROPERTIES); if (!OSSL_PARAM_get_utf8_string(p, &pmdname, sizeof(mdname))) return 0; - if (propsp != NULL - && !OSSL_PARAM_get_utf8_string(propsp, &pmdprops, sizeof(mdprops))) + if (propsp != NULL && + !OSSL_PARAM_get_utf8_string(propsp, &pmdprops, sizeof(mdprops))) return 0; if (!oqs_sig_setup_md(poqs_sigctx, mdname, mdprops)) return 0; @@ -1277,14 +1239,14 @@ static int oqs_sig_set_ctx_params(void *vpoqs_sigctx, const OSSL_PARAM params[]) return 1; } -static const OSSL_PARAM known_settable_ctx_params[] - = {OSSL_PARAM_utf8_string(OSSL_SIGNATURE_PARAM_DIGEST, NULL, 0), - OSSL_PARAM_utf8_string(OSSL_SIGNATURE_PARAM_PROPERTIES, NULL, 0), - OSSL_PARAM_END}; +static const OSSL_PARAM known_settable_ctx_params[] = { + OSSL_PARAM_utf8_string(OSSL_SIGNATURE_PARAM_DIGEST, NULL, 0), + OSSL_PARAM_utf8_string(OSSL_SIGNATURE_PARAM_PROPERTIES, NULL, 0), + OSSL_PARAM_END}; -static const OSSL_PARAM *oqs_sig_settable_ctx_params(ossl_unused void *vpsm2ctx, - ossl_unused void *provctx) -{ +static const OSSL_PARAM * +oqs_sig_settable_ctx_params(ossl_unused void *vpsm2ctx, + ossl_unused void *provctx) { /* * TODO(3.0): Should this function return a different set of settable ctx * params if the ctx is being used for a DigestSign/DigestVerify? In that @@ -1301,8 +1263,7 @@ static const OSSL_PARAM *oqs_sig_settable_ctx_params(ossl_unused void *vpsm2ctx, return known_settable_ctx_params; } -static int oqs_sig_get_ctx_md_params(void *vpoqs_sigctx, OSSL_PARAM *params) -{ +static int oqs_sig_get_ctx_md_params(void *vpoqs_sigctx, OSSL_PARAM *params) { PROV_OQSSIG_CTX *poqs_sigctx = (PROV_OQSSIG_CTX *)vpoqs_sigctx; OQS_SIG_PRINTF("OQS SIG provider: get_ctx_md_params called\n"); @@ -1312,8 +1273,7 @@ static int oqs_sig_get_ctx_md_params(void *vpoqs_sigctx, OSSL_PARAM *params) return EVP_MD_CTX_get_params(poqs_sigctx->mdctx, params); } -static const OSSL_PARAM *oqs_sig_gettable_ctx_md_params(void *vpoqs_sigctx) -{ +static const OSSL_PARAM *oqs_sig_gettable_ctx_md_params(void *vpoqs_sigctx) { PROV_OQSSIG_CTX *poqs_sigctx = (PROV_OQSSIG_CTX *)vpoqs_sigctx; OQS_SIG_PRINTF("OQS SIG provider: gettable_ctx_md_params called\n"); @@ -1324,8 +1284,7 @@ static const OSSL_PARAM *oqs_sig_gettable_ctx_md_params(void *vpoqs_sigctx) } static int oqs_sig_set_ctx_md_params(void *vpoqs_sigctx, - const OSSL_PARAM params[]) -{ + const OSSL_PARAM params[]) { PROV_OQSSIG_CTX *poqs_sigctx = (PROV_OQSSIG_CTX *)vpoqs_sigctx; OQS_SIG_PRINTF("OQS SIG provider: set_ctx_md_params called\n"); @@ -1335,8 +1294,7 @@ static int oqs_sig_set_ctx_md_params(void *vpoqs_sigctx, return EVP_MD_CTX_set_params(poqs_sigctx->mdctx, params); } -static const OSSL_PARAM *oqs_sig_settable_ctx_md_params(void *vpoqs_sigctx) -{ +static const OSSL_PARAM *oqs_sig_settable_ctx_md_params(void *vpoqs_sigctx) { PROV_OQSSIG_CTX *poqs_sigctx = (PROV_OQSSIG_CTX *)vpoqs_sigctx; if (poqs_sigctx->md == NULL) @@ -1346,40 +1304,40 @@ static const OSSL_PARAM *oqs_sig_settable_ctx_md_params(void *vpoqs_sigctx) return EVP_MD_settable_ctx_params(poqs_sigctx->md); } -const OSSL_DISPATCH oqs_signature_functions[] - = {{OSSL_FUNC_SIGNATURE_NEWCTX, (void (*)(void))oqs_sig_newctx}, - {OSSL_FUNC_SIGNATURE_SIGN_INIT, (void (*)(void))oqs_sig_sign_init}, - {OSSL_FUNC_SIGNATURE_SIGN, (void (*)(void))oqs_sig_sign}, - {OSSL_FUNC_SIGNATURE_VERIFY_INIT, (void (*)(void))oqs_sig_verify_init}, - {OSSL_FUNC_SIGNATURE_VERIFY, (void (*)(void))oqs_sig_verify}, - {OSSL_FUNC_SIGNATURE_DIGEST_SIGN_INIT, - (void (*)(void))oqs_sig_digest_sign_init}, - {OSSL_FUNC_SIGNATURE_DIGEST_SIGN_UPDATE, - (void (*)(void))oqs_sig_digest_signverify_update}, - {OSSL_FUNC_SIGNATURE_DIGEST_SIGN_FINAL, - (void (*)(void))oqs_sig_digest_sign_final}, - {OSSL_FUNC_SIGNATURE_DIGEST_VERIFY_INIT, - (void (*)(void))oqs_sig_digest_verify_init}, - {OSSL_FUNC_SIGNATURE_DIGEST_VERIFY_UPDATE, - (void (*)(void))oqs_sig_digest_signverify_update}, - {OSSL_FUNC_SIGNATURE_DIGEST_VERIFY_FINAL, - (void (*)(void))oqs_sig_digest_verify_final}, - {OSSL_FUNC_SIGNATURE_FREECTX, (void (*)(void))oqs_sig_freectx}, - {OSSL_FUNC_SIGNATURE_DUPCTX, (void (*)(void))oqs_sig_dupctx}, - {OSSL_FUNC_SIGNATURE_GET_CTX_PARAMS, - (void (*)(void))oqs_sig_get_ctx_params}, - {OSSL_FUNC_SIGNATURE_GETTABLE_CTX_PARAMS, - (void (*)(void))oqs_sig_gettable_ctx_params}, - {OSSL_FUNC_SIGNATURE_SET_CTX_PARAMS, - (void (*)(void))oqs_sig_set_ctx_params}, - {OSSL_FUNC_SIGNATURE_SETTABLE_CTX_PARAMS, - (void (*)(void))oqs_sig_settable_ctx_params}, - {OSSL_FUNC_SIGNATURE_GET_CTX_MD_PARAMS, - (void (*)(void))oqs_sig_get_ctx_md_params}, - {OSSL_FUNC_SIGNATURE_GETTABLE_CTX_MD_PARAMS, - (void (*)(void))oqs_sig_gettable_ctx_md_params}, - {OSSL_FUNC_SIGNATURE_SET_CTX_MD_PARAMS, - (void (*)(void))oqs_sig_set_ctx_md_params}, - {OSSL_FUNC_SIGNATURE_SETTABLE_CTX_MD_PARAMS, - (void (*)(void))oqs_sig_settable_ctx_md_params}, - {0, NULL}}; +const OSSL_DISPATCH oqs_signature_functions[] = { + {OSSL_FUNC_SIGNATURE_NEWCTX, (void (*)(void))oqs_sig_newctx}, + {OSSL_FUNC_SIGNATURE_SIGN_INIT, (void (*)(void))oqs_sig_sign_init}, + {OSSL_FUNC_SIGNATURE_SIGN, (void (*)(void))oqs_sig_sign}, + {OSSL_FUNC_SIGNATURE_VERIFY_INIT, (void (*)(void))oqs_sig_verify_init}, + {OSSL_FUNC_SIGNATURE_VERIFY, (void (*)(void))oqs_sig_verify}, + {OSSL_FUNC_SIGNATURE_DIGEST_SIGN_INIT, + (void (*)(void))oqs_sig_digest_sign_init}, + {OSSL_FUNC_SIGNATURE_DIGEST_SIGN_UPDATE, + (void (*)(void))oqs_sig_digest_signverify_update}, + {OSSL_FUNC_SIGNATURE_DIGEST_SIGN_FINAL, + (void (*)(void))oqs_sig_digest_sign_final}, + {OSSL_FUNC_SIGNATURE_DIGEST_VERIFY_INIT, + (void (*)(void))oqs_sig_digest_verify_init}, + {OSSL_FUNC_SIGNATURE_DIGEST_VERIFY_UPDATE, + (void (*)(void))oqs_sig_digest_signverify_update}, + {OSSL_FUNC_SIGNATURE_DIGEST_VERIFY_FINAL, + (void (*)(void))oqs_sig_digest_verify_final}, + {OSSL_FUNC_SIGNATURE_FREECTX, (void (*)(void))oqs_sig_freectx}, + {OSSL_FUNC_SIGNATURE_DUPCTX, (void (*)(void))oqs_sig_dupctx}, + {OSSL_FUNC_SIGNATURE_GET_CTX_PARAMS, + (void (*)(void))oqs_sig_get_ctx_params}, + {OSSL_FUNC_SIGNATURE_GETTABLE_CTX_PARAMS, + (void (*)(void))oqs_sig_gettable_ctx_params}, + {OSSL_FUNC_SIGNATURE_SET_CTX_PARAMS, + (void (*)(void))oqs_sig_set_ctx_params}, + {OSSL_FUNC_SIGNATURE_SETTABLE_CTX_PARAMS, + (void (*)(void))oqs_sig_settable_ctx_params}, + {OSSL_FUNC_SIGNATURE_GET_CTX_MD_PARAMS, + (void (*)(void))oqs_sig_get_ctx_md_params}, + {OSSL_FUNC_SIGNATURE_GETTABLE_CTX_MD_PARAMS, + (void (*)(void))oqs_sig_gettable_ctx_md_params}, + {OSSL_FUNC_SIGNATURE_SET_CTX_MD_PARAMS, + (void (*)(void))oqs_sig_set_ctx_md_params}, + {OSSL_FUNC_SIGNATURE_SETTABLE_CTX_MD_PARAMS, + (void (*)(void))oqs_sig_settable_ctx_md_params}, + {0, NULL}}; diff --git a/oqsprov/oqsprov.c b/oqsprov/oqsprov.c index c3a9254e..fc25b4c3 100644 --- a/oqsprov/oqsprov.c +++ b/oqsprov/oqsprov.c @@ -20,19 +20,19 @@ #include #ifdef NDEBUG -# define OQS_PROV_PRINTF(a) -# define OQS_PROV_PRINTF2(a, b) -# define OQS_PROV_PRINTF3(a, b, c) +#define OQS_PROV_PRINTF(a) +#define OQS_PROV_PRINTF2(a, b) +#define OQS_PROV_PRINTF3(a, b, c) #else -# define OQS_PROV_PRINTF(a) \ - if (getenv("OQSPROV")) \ - printf(a) -# define OQS_PROV_PRINTF2(a, b) \ - if (getenv("OQSPROV")) \ - printf(a, b) -# define OQS_PROV_PRINTF3(a, b, c) \ - if (getenv("OQSPROV")) \ - printf(a, b, c) +#define OQS_PROV_PRINTF(a) \ + if (getenv("OQSPROV")) \ + printf(a) +#define OQS_PROV_PRINTF2(a, b) \ + if (getenv("OQSPROV")) \ + printf(a, b) +#define OQS_PROV_PRINTF3(a, b, c) \ + if (getenv("OQSPROV")) \ + printf(a, b, c) #endif // NDEBUG /* @@ -49,431 +49,779 @@ extern OSSL_FUNC_provider_get_capabilities_fn oqs_provider_get_capabilities; */ ///// OQS_TEMPLATE_FRAGMENT_ASSIGN_SIG_OIDS_START - #ifdef OQS_KEM_ENCODERS #define OQS_OID_CNT 220 #else #define OQS_OID_CNT 114 #endif -const char* oqs_oid_alg_list[OQS_OID_CNT] = -{ +const char *oqs_oid_alg_list[OQS_OID_CNT] = { #ifdef OQS_KEM_ENCODERS -"1.3.9999.99.17", "frodo640aes", -"1.3.9999.99.16", "p256_frodo640aes", -"1.3.9999.99.1", "x25519_frodo640aes", -"1.3.9999.99.19", "frodo640shake", -"1.3.9999.99.18", "p256_frodo640shake", -"1.3.9999.99.2", "x25519_frodo640shake", -"1.3.9999.99.21", "frodo976aes", -"1.3.9999.99.20", "p384_frodo976aes", -"1.3.9999.99.3", "x448_frodo976aes", -"1.3.9999.99.23", "frodo976shake", -"1.3.9999.99.22", "p384_frodo976shake", -"1.3.9999.99.4", "x448_frodo976shake", -"1.3.9999.99.25", "frodo1344aes", -"1.3.9999.99.24", "p521_frodo1344aes", -"1.3.9999.99.27", "frodo1344shake", -"1.3.9999.99.26", "p521_frodo1344shake", -"1.3.6.1.4.1.2.267.8.2.2", "kyber512", -"1.3.9999.99.28", "p256_kyber512", -"1.3.9999.99.5", "x25519_kyber512", -"1.3.6.1.4.1.2.267.8.3.3", "kyber768", -"1.3.9999.99.29", "p384_kyber768", -"1.3.9999.99.6", "x448_kyber768", -"1.3.9999.99.7", "x25519_kyber768", -"1.3.9999.99.8", "p256_kyber768", -"1.3.6.1.4.1.2.267.8.4.4", "kyber1024", -"1.3.9999.99.30", "p521_kyber1024", -"1.3.6.1.4.1.22554.5.6.1", "mlkem512", -"1.3.6.1.4.1.22554.5.7.1", "p256_mlkem512", -"1.3.6.1.4.1.22554.5.8.1", "x25519_mlkem512", -"1.3.6.1.4.1.22554.5.6.2", "mlkem768", -"1.3.9999.99.31", "p384_mlkem768", -"1.3.9999.99.9", "x448_mlkem768", -"1.3.9999.99.10", "x25519_mlkem768", -"1.3.9999.99.11", "p256_mlkem768", -"1.3.6.1.4.1.22554.5.6.3", "mlkem1024", -"1.3.9999.99.32", "p521_mlkem1024", -"1.3.6.1.4.1.42235.6", "p384_mlkem1024", -"1.3.9999.99.34", "bikel1", -"1.3.9999.99.33", "p256_bikel1", -"1.3.9999.99.12", "x25519_bikel1", -"1.3.9999.99.36", "bikel3", -"1.3.9999.99.35", "p384_bikel3", -"1.3.9999.99.13", "x448_bikel3", -"1.3.9999.99.38", "bikel5", -"1.3.9999.99.37", "p521_bikel5", -"1.3.9999.99.40", "hqc128", -"1.3.9999.99.39", "p256_hqc128", -"1.3.9999.99.14", "x25519_hqc128", -"1.3.9999.99.42", "hqc192", -"1.3.9999.99.41", "p384_hqc192", -"1.3.9999.99.15", "x448_hqc192", -"1.3.9999.99.44", "hqc256", -"1.3.9999.99.43", "p521_hqc256", + "1.3.9999.99.17", + "frodo640aes", + "1.3.9999.99.16", + "p256_frodo640aes", + "1.3.9999.99.1", + "x25519_frodo640aes", + "1.3.9999.99.19", + "frodo640shake", + "1.3.9999.99.18", + "p256_frodo640shake", + "1.3.9999.99.2", + "x25519_frodo640shake", + "1.3.9999.99.21", + "frodo976aes", + "1.3.9999.99.20", + "p384_frodo976aes", + "1.3.9999.99.3", + "x448_frodo976aes", + "1.3.9999.99.23", + "frodo976shake", + "1.3.9999.99.22", + "p384_frodo976shake", + "1.3.9999.99.4", + "x448_frodo976shake", + "1.3.9999.99.25", + "frodo1344aes", + "1.3.9999.99.24", + "p521_frodo1344aes", + "1.3.9999.99.27", + "frodo1344shake", + "1.3.9999.99.26", + "p521_frodo1344shake", + "1.3.6.1.4.1.2.267.8.2.2", + "kyber512", + "1.3.9999.99.28", + "p256_kyber512", + "1.3.9999.99.5", + "x25519_kyber512", + "1.3.6.1.4.1.2.267.8.3.3", + "kyber768", + "1.3.9999.99.29", + "p384_kyber768", + "1.3.9999.99.6", + "x448_kyber768", + "1.3.9999.99.7", + "x25519_kyber768", + "1.3.9999.99.8", + "p256_kyber768", + "1.3.6.1.4.1.2.267.8.4.4", + "kyber1024", + "1.3.9999.99.30", + "p521_kyber1024", + "1.3.6.1.4.1.22554.5.6.1", + "mlkem512", + "1.3.6.1.4.1.22554.5.7.1", + "p256_mlkem512", + "1.3.6.1.4.1.22554.5.8.1", + "x25519_mlkem512", + "1.3.6.1.4.1.22554.5.6.2", + "mlkem768", + "1.3.9999.99.31", + "p384_mlkem768", + "1.3.9999.99.9", + "x448_mlkem768", + "1.3.9999.99.10", + "x25519_mlkem768", + "1.3.9999.99.11", + "p256_mlkem768", + "1.3.6.1.4.1.22554.5.6.3", + "mlkem1024", + "1.3.9999.99.32", + "p521_mlkem1024", + "1.3.6.1.4.1.42235.6", + "p384_mlkem1024", + "1.3.9999.99.34", + "bikel1", + "1.3.9999.99.33", + "p256_bikel1", + "1.3.9999.99.12", + "x25519_bikel1", + "1.3.9999.99.36", + "bikel3", + "1.3.9999.99.35", + "p384_bikel3", + "1.3.9999.99.13", + "x448_bikel3", + "1.3.9999.99.38", + "bikel5", + "1.3.9999.99.37", + "p521_bikel5", + "1.3.9999.99.40", + "hqc128", + "1.3.9999.99.39", + "p256_hqc128", + "1.3.9999.99.14", + "x25519_hqc128", + "1.3.9999.99.42", + "hqc192", + "1.3.9999.99.41", + "p384_hqc192", + "1.3.9999.99.15", + "x448_hqc192", + "1.3.9999.99.44", + "hqc256", + "1.3.9999.99.43", + "p521_hqc256", #endif /* OQS_KEM_ENCODERS */ - -"1.3.6.1.4.1.2.267.7.4.4", "dilithium2", -"1.3.9999.2.7.1" , "p256_dilithium2", -"1.3.9999.2.7.2" , "rsa3072_dilithium2", -"1.3.6.1.4.1.2.267.7.6.5", "dilithium3", -"1.3.9999.2.7.3" , "p384_dilithium3", -"1.3.6.1.4.1.2.267.7.8.7", "dilithium5", -"1.3.9999.2.7.4" , "p521_dilithium5", -"1.3.6.1.4.1.2.267.12.4.4", "mldsa44", -"1.3.9999.7.1" , "p256_mldsa44", -"1.3.9999.7.2" , "rsa3072_mldsa44", -"2.16.840.1.114027.80.8.1.1" , "mldsa44_pss2048", -"2.16.840.1.114027.80.8.1.2" , "mldsa44_rsa2048", -"2.16.840.1.114027.80.8.1.3" , "mldsa44_ed25519", -"2.16.840.1.114027.80.8.1.4" , "mldsa44_p256", -"2.16.840.1.114027.80.8.1.5" , "mldsa44_bp256", -"1.3.6.1.4.1.2.267.12.6.5", "mldsa65", -"1.3.9999.7.3" , "p384_mldsa65", -"2.16.840.1.114027.80.8.1.6" , "mldsa65_pss3072", -"2.16.840.1.114027.80.8.1.7" , "mldsa65_rsa3072", -"2.16.840.1.114027.80.8.1.8" , "mldsa65_p256", -"2.16.840.1.114027.80.8.1.9" , "mldsa65_bp256", -"2.16.840.1.114027.80.8.1.10" , "mldsa65_ed25519", -"1.3.6.1.4.1.2.267.12.8.7", "mldsa87", -"1.3.9999.7.4" , "p521_mldsa87", -"2.16.840.1.114027.80.8.1.11" , "mldsa87_p384", -"2.16.840.1.114027.80.8.1.12" , "mldsa87_bp384", -"2.16.840.1.114027.80.8.1.13" , "mldsa87_ed448", -"1.3.9999.3.11", "falcon512", -"1.3.9999.3.12" , "p256_falcon512", -"1.3.9999.3.13" , "rsa3072_falcon512", -"1.3.9999.3.16", "falconpadded512", -"1.3.9999.3.17" , "p256_falconpadded512", -"1.3.9999.3.18" , "rsa3072_falconpadded512", -"1.3.9999.3.14", "falcon1024", -"1.3.9999.3.15" , "p521_falcon1024", -"1.3.9999.3.19", "falconpadded1024", -"1.3.9999.3.20" , "p521_falconpadded1024", -"1.3.9999.6.4.13", "sphincssha2128fsimple", -"1.3.9999.6.4.14" , "p256_sphincssha2128fsimple", -"1.3.9999.6.4.15" , "rsa3072_sphincssha2128fsimple", -"1.3.9999.6.4.16", "sphincssha2128ssimple", -"1.3.9999.6.4.17" , "p256_sphincssha2128ssimple", -"1.3.9999.6.4.18" , "rsa3072_sphincssha2128ssimple", -"1.3.9999.6.5.10", "sphincssha2192fsimple", -"1.3.9999.6.5.11" , "p384_sphincssha2192fsimple", -"1.3.9999.6.7.13", "sphincsshake128fsimple", -"1.3.9999.6.7.14" , "p256_sphincsshake128fsimple", -"1.3.9999.6.7.15" , "rsa3072_sphincsshake128fsimple", -"1.3.9999.8.1.1", "mayo1", -"1.3.9999.8.1.2" , "p256_mayo1", -"1.3.9999.8.2.1", "mayo2", -"1.3.9999.8.2.2" , "p256_mayo2", -"1.3.9999.8.3.1", "mayo3", -"1.3.9999.8.3.2" , "p384_mayo3", -"1.3.9999.8.5.1", "mayo5", -"1.3.9999.8.5.2" , "p521_mayo5", -"1.3.9999.9.1", "CROSSrsdp128balanced", -///// OQS_TEMPLATE_FRAGMENT_ASSIGN_SIG_OIDS_END + "1.3.6.1.4.1.2.267.7.4.4", + "dilithium2", + "1.3.9999.2.7.1", + "p256_dilithium2", + "1.3.9999.2.7.2", + "rsa3072_dilithium2", + "1.3.6.1.4.1.2.267.7.6.5", + "dilithium3", + "1.3.9999.2.7.3", + "p384_dilithium3", + "1.3.6.1.4.1.2.267.7.8.7", + "dilithium5", + "1.3.9999.2.7.4", + "p521_dilithium5", + "1.3.6.1.4.1.2.267.12.4.4", + "mldsa44", + "1.3.9999.7.1", + "p256_mldsa44", + "1.3.9999.7.2", + "rsa3072_mldsa44", + "2.16.840.1.114027.80.8.1.1", + "mldsa44_pss2048", + "2.16.840.1.114027.80.8.1.2", + "mldsa44_rsa2048", + "2.16.840.1.114027.80.8.1.3", + "mldsa44_ed25519", + "2.16.840.1.114027.80.8.1.4", + "mldsa44_p256", + "2.16.840.1.114027.80.8.1.5", + "mldsa44_bp256", + "1.3.6.1.4.1.2.267.12.6.5", + "mldsa65", + "1.3.9999.7.3", + "p384_mldsa65", + "2.16.840.1.114027.80.8.1.6", + "mldsa65_pss3072", + "2.16.840.1.114027.80.8.1.7", + "mldsa65_rsa3072", + "2.16.840.1.114027.80.8.1.8", + "mldsa65_p256", + "2.16.840.1.114027.80.8.1.9", + "mldsa65_bp256", + "2.16.840.1.114027.80.8.1.10", + "mldsa65_ed25519", + "1.3.6.1.4.1.2.267.12.8.7", + "mldsa87", + "1.3.9999.7.4", + "p521_mldsa87", + "2.16.840.1.114027.80.8.1.11", + "mldsa87_p384", + "2.16.840.1.114027.80.8.1.12", + "mldsa87_bp384", + "2.16.840.1.114027.80.8.1.13", + "mldsa87_ed448", + "1.3.9999.3.11", + "falcon512", + "1.3.9999.3.12", + "p256_falcon512", + "1.3.9999.3.13", + "rsa3072_falcon512", + "1.3.9999.3.16", + "falconpadded512", + "1.3.9999.3.17", + "p256_falconpadded512", + "1.3.9999.3.18", + "rsa3072_falconpadded512", + "1.3.9999.3.14", + "falcon1024", + "1.3.9999.3.15", + "p521_falcon1024", + "1.3.9999.3.19", + "falconpadded1024", + "1.3.9999.3.20", + "p521_falconpadded1024", + "1.3.9999.6.4.13", + "sphincssha2128fsimple", + "1.3.9999.6.4.14", + "p256_sphincssha2128fsimple", + "1.3.9999.6.4.15", + "rsa3072_sphincssha2128fsimple", + "1.3.9999.6.4.16", + "sphincssha2128ssimple", + "1.3.9999.6.4.17", + "p256_sphincssha2128ssimple", + "1.3.9999.6.4.18", + "rsa3072_sphincssha2128ssimple", + "1.3.9999.6.5.10", + "sphincssha2192fsimple", + "1.3.9999.6.5.11", + "p384_sphincssha2192fsimple", + "1.3.9999.6.7.13", + "sphincsshake128fsimple", + "1.3.9999.6.7.14", + "p256_sphincsshake128fsimple", + "1.3.9999.6.7.15", + "rsa3072_sphincsshake128fsimple", + "1.3.9999.8.1.1", + "mayo1", + "1.3.9999.8.1.2", + "p256_mayo1", + "1.3.9999.8.2.1", + "mayo2", + "1.3.9999.8.2.2", + "p256_mayo2", + "1.3.9999.8.3.1", + "mayo3", + "1.3.9999.8.3.2", + "p384_mayo3", + "1.3.9999.8.5.1", + "mayo5", + "1.3.9999.8.5.2", + "p521_mayo5", + "1.3.9999.9.1", + "CROSSrsdp128balanced", + ///// OQS_TEMPLATE_FRAGMENT_ASSIGN_SIG_OIDS_END }; -int oqs_patch_oids(void) -{ +int oqs_patch_oids(void) { ///// OQS_TEMPLATE_FRAGMENT_OID_PATCHING_START -{ - const char *envval = NULL; + { + const char *envval = NULL; #ifdef OQS_KEM_ENCODERS - - -if ((envval = getenv("OQS_OID_FRODO640AES"))) oqs_oid_alg_list[0] = envval; - -if ((envval = getenv("OQS_OID_P256_FRODO640AES"))) oqs_oid_alg_list[2] = envval; -if ((envval = getenv("OQS_OID_X25519_FRODO640AES"))) oqs_oid_alg_list[4] = envval; -if ((envval = getenv("OQS_OID_FRODO640SHAKE"))) oqs_oid_alg_list[6] = envval; - -if ((envval = getenv("OQS_OID_P256_FRODO640SHAKE"))) oqs_oid_alg_list[8] = envval; -if ((envval = getenv("OQS_OID_X25519_FRODO640SHAKE"))) oqs_oid_alg_list[10] = envval; -if ((envval = getenv("OQS_OID_FRODO976AES"))) oqs_oid_alg_list[12] = envval; - -if ((envval = getenv("OQS_OID_P384_FRODO976AES"))) oqs_oid_alg_list[14] = envval; -if ((envval = getenv("OQS_OID_X448_FRODO976AES"))) oqs_oid_alg_list[16] = envval; -if ((envval = getenv("OQS_OID_FRODO976SHAKE"))) oqs_oid_alg_list[18] = envval; - -if ((envval = getenv("OQS_OID_P384_FRODO976SHAKE"))) oqs_oid_alg_list[20] = envval; -if ((envval = getenv("OQS_OID_X448_FRODO976SHAKE"))) oqs_oid_alg_list[22] = envval; -if ((envval = getenv("OQS_OID_FRODO1344AES"))) oqs_oid_alg_list[24] = envval; - -if ((envval = getenv("OQS_OID_P521_FRODO1344AES"))) oqs_oid_alg_list[26] = envval; -if ((envval = getenv("OQS_OID_FRODO1344SHAKE"))) oqs_oid_alg_list[28] = envval; - -if ((envval = getenv("OQS_OID_P521_FRODO1344SHAKE"))) oqs_oid_alg_list[30] = envval; -if ((envval = getenv("OQS_OID_KYBER512"))) oqs_oid_alg_list[32] = envval; - -if ((envval = getenv("OQS_OID_P256_KYBER512"))) oqs_oid_alg_list[34] = envval; -if ((envval = getenv("OQS_OID_X25519_KYBER512"))) oqs_oid_alg_list[36] = envval; -if ((envval = getenv("OQS_OID_KYBER768"))) oqs_oid_alg_list[38] = envval; - -if ((envval = getenv("OQS_OID_P384_KYBER768"))) oqs_oid_alg_list[40] = envval; -if ((envval = getenv("OQS_OID_X448_KYBER768"))) oqs_oid_alg_list[42] = envval; -if ((envval = getenv("OQS_OID_X25519_KYBER768"))) oqs_oid_alg_list[44] = envval; -if ((envval = getenv("OQS_OID_P256_KYBER768"))) oqs_oid_alg_list[46] = envval; -if ((envval = getenv("OQS_OID_KYBER1024"))) oqs_oid_alg_list[48] = envval; - -if ((envval = getenv("OQS_OID_P521_KYBER1024"))) oqs_oid_alg_list[50] = envval; -if ((envval = getenv("OQS_OID_MLKEM512"))) oqs_oid_alg_list[52] = envval; - -if ((envval = getenv("OQS_OID_P256_MLKEM512"))) oqs_oid_alg_list[54] = envval; -if ((envval = getenv("OQS_OID_X25519_MLKEM512"))) oqs_oid_alg_list[56] = envval; -if ((envval = getenv("OQS_OID_MLKEM768"))) oqs_oid_alg_list[58] = envval; - -if ((envval = getenv("OQS_OID_P384_MLKEM768"))) oqs_oid_alg_list[60] = envval; -if ((envval = getenv("OQS_OID_X448_MLKEM768"))) oqs_oid_alg_list[62] = envval; -if ((envval = getenv("OQS_OID_X25519_MLKEM768"))) oqs_oid_alg_list[64] = envval; -if ((envval = getenv("OQS_OID_P256_MLKEM768"))) oqs_oid_alg_list[66] = envval; -if ((envval = getenv("OQS_OID_MLKEM1024"))) oqs_oid_alg_list[68] = envval; - -if ((envval = getenv("OQS_OID_P521_MLKEM1024"))) oqs_oid_alg_list[70] = envval; -if ((envval = getenv("OQS_OID_P384_MLKEM1024"))) oqs_oid_alg_list[72] = envval; -if ((envval = getenv("OQS_OID_BIKEL1"))) oqs_oid_alg_list[74] = envval; - -if ((envval = getenv("OQS_OID_P256_BIKEL1"))) oqs_oid_alg_list[76] = envval; -if ((envval = getenv("OQS_OID_X25519_BIKEL1"))) oqs_oid_alg_list[78] = envval; -if ((envval = getenv("OQS_OID_BIKEL3"))) oqs_oid_alg_list[80] = envval; - -if ((envval = getenv("OQS_OID_P384_BIKEL3"))) oqs_oid_alg_list[82] = envval; -if ((envval = getenv("OQS_OID_X448_BIKEL3"))) oqs_oid_alg_list[84] = envval; -if ((envval = getenv("OQS_OID_BIKEL5"))) oqs_oid_alg_list[86] = envval; - -if ((envval = getenv("OQS_OID_P521_BIKEL5"))) oqs_oid_alg_list[88] = envval; -if ((envval = getenv("OQS_OID_HQC128"))) oqs_oid_alg_list[90] = envval; - -if ((envval = getenv("OQS_OID_P256_HQC128"))) oqs_oid_alg_list[92] = envval; -if ((envval = getenv("OQS_OID_X25519_HQC128"))) oqs_oid_alg_list[94] = envval; -if ((envval = getenv("OQS_OID_HQC192"))) oqs_oid_alg_list[96] = envval; - -if ((envval = getenv("OQS_OID_P384_HQC192"))) oqs_oid_alg_list[98] = envval; -if ((envval = getenv("OQS_OID_X448_HQC192"))) oqs_oid_alg_list[100] = envval; -if ((envval = getenv("OQS_OID_HQC256"))) oqs_oid_alg_list[102] = envval; - -if ((envval = getenv("OQS_OID_P521_HQC256"))) oqs_oid_alg_list[104] = envval; - -#define OQS_KEMOID_CNT 104+2 + if ((envval = getenv("OQS_OID_FRODO640AES"))) + oqs_oid_alg_list[0] = envval; + + if ((envval = getenv("OQS_OID_P256_FRODO640AES"))) + oqs_oid_alg_list[2] = envval; + if ((envval = getenv("OQS_OID_X25519_FRODO640AES"))) + oqs_oid_alg_list[4] = envval; + if ((envval = getenv("OQS_OID_FRODO640SHAKE"))) + oqs_oid_alg_list[6] = envval; + + if ((envval = getenv("OQS_OID_P256_FRODO640SHAKE"))) + oqs_oid_alg_list[8] = envval; + if ((envval = getenv("OQS_OID_X25519_FRODO640SHAKE"))) + oqs_oid_alg_list[10] = envval; + if ((envval = getenv("OQS_OID_FRODO976AES"))) + oqs_oid_alg_list[12] = envval; + + if ((envval = getenv("OQS_OID_P384_FRODO976AES"))) + oqs_oid_alg_list[14] = envval; + if ((envval = getenv("OQS_OID_X448_FRODO976AES"))) + oqs_oid_alg_list[16] = envval; + if ((envval = getenv("OQS_OID_FRODO976SHAKE"))) + oqs_oid_alg_list[18] = envval; + + if ((envval = getenv("OQS_OID_P384_FRODO976SHAKE"))) + oqs_oid_alg_list[20] = envval; + if ((envval = getenv("OQS_OID_X448_FRODO976SHAKE"))) + oqs_oid_alg_list[22] = envval; + if ((envval = getenv("OQS_OID_FRODO1344AES"))) + oqs_oid_alg_list[24] = envval; + + if ((envval = getenv("OQS_OID_P521_FRODO1344AES"))) + oqs_oid_alg_list[26] = envval; + if ((envval = getenv("OQS_OID_FRODO1344SHAKE"))) + oqs_oid_alg_list[28] = envval; + + if ((envval = getenv("OQS_OID_P521_FRODO1344SHAKE"))) + oqs_oid_alg_list[30] = envval; + if ((envval = getenv("OQS_OID_KYBER512"))) + oqs_oid_alg_list[32] = envval; + + if ((envval = getenv("OQS_OID_P256_KYBER512"))) + oqs_oid_alg_list[34] = envval; + if ((envval = getenv("OQS_OID_X25519_KYBER512"))) + oqs_oid_alg_list[36] = envval; + if ((envval = getenv("OQS_OID_KYBER768"))) + oqs_oid_alg_list[38] = envval; + + if ((envval = getenv("OQS_OID_P384_KYBER768"))) + oqs_oid_alg_list[40] = envval; + if ((envval = getenv("OQS_OID_X448_KYBER768"))) + oqs_oid_alg_list[42] = envval; + if ((envval = getenv("OQS_OID_X25519_KYBER768"))) + oqs_oid_alg_list[44] = envval; + if ((envval = getenv("OQS_OID_P256_KYBER768"))) + oqs_oid_alg_list[46] = envval; + if ((envval = getenv("OQS_OID_KYBER1024"))) + oqs_oid_alg_list[48] = envval; + + if ((envval = getenv("OQS_OID_P521_KYBER1024"))) + oqs_oid_alg_list[50] = envval; + if ((envval = getenv("OQS_OID_MLKEM512"))) + oqs_oid_alg_list[52] = envval; + + if ((envval = getenv("OQS_OID_P256_MLKEM512"))) + oqs_oid_alg_list[54] = envval; + if ((envval = getenv("OQS_OID_X25519_MLKEM512"))) + oqs_oid_alg_list[56] = envval; + if ((envval = getenv("OQS_OID_MLKEM768"))) + oqs_oid_alg_list[58] = envval; + + if ((envval = getenv("OQS_OID_P384_MLKEM768"))) + oqs_oid_alg_list[60] = envval; + if ((envval = getenv("OQS_OID_X448_MLKEM768"))) + oqs_oid_alg_list[62] = envval; + if ((envval = getenv("OQS_OID_X25519_MLKEM768"))) + oqs_oid_alg_list[64] = envval; + if ((envval = getenv("OQS_OID_P256_MLKEM768"))) + oqs_oid_alg_list[66] = envval; + if ((envval = getenv("OQS_OID_MLKEM1024"))) + oqs_oid_alg_list[68] = envval; + + if ((envval = getenv("OQS_OID_P521_MLKEM1024"))) + oqs_oid_alg_list[70] = envval; + if ((envval = getenv("OQS_OID_P384_MLKEM1024"))) + oqs_oid_alg_list[72] = envval; + if ((envval = getenv("OQS_OID_BIKEL1"))) + oqs_oid_alg_list[74] = envval; + + if ((envval = getenv("OQS_OID_P256_BIKEL1"))) + oqs_oid_alg_list[76] = envval; + if ((envval = getenv("OQS_OID_X25519_BIKEL1"))) + oqs_oid_alg_list[78] = envval; + if ((envval = getenv("OQS_OID_BIKEL3"))) + oqs_oid_alg_list[80] = envval; + + if ((envval = getenv("OQS_OID_P384_BIKEL3"))) + oqs_oid_alg_list[82] = envval; + if ((envval = getenv("OQS_OID_X448_BIKEL3"))) + oqs_oid_alg_list[84] = envval; + if ((envval = getenv("OQS_OID_BIKEL5"))) + oqs_oid_alg_list[86] = envval; + + if ((envval = getenv("OQS_OID_P521_BIKEL5"))) + oqs_oid_alg_list[88] = envval; + if ((envval = getenv("OQS_OID_HQC128"))) + oqs_oid_alg_list[90] = envval; + + if ((envval = getenv("OQS_OID_P256_HQC128"))) + oqs_oid_alg_list[92] = envval; + if ((envval = getenv("OQS_OID_X25519_HQC128"))) + oqs_oid_alg_list[94] = envval; + if ((envval = getenv("OQS_OID_HQC192"))) + oqs_oid_alg_list[96] = envval; + + if ((envval = getenv("OQS_OID_P384_HQC192"))) + oqs_oid_alg_list[98] = envval; + if ((envval = getenv("OQS_OID_X448_HQC192"))) + oqs_oid_alg_list[100] = envval; + if ((envval = getenv("OQS_OID_HQC256"))) + oqs_oid_alg_list[102] = envval; + + if ((envval = getenv("OQS_OID_P521_HQC256"))) + oqs_oid_alg_list[104] = envval; + +#define OQS_KEMOID_CNT 104 + 2 #else #define OQS_KEMOID_CNT 0 #endif /* OQS_KEM_ENCODERS */ - if ((envval = getenv("OQS_OID_DILITHIUM2"))) oqs_oid_alg_list[0+OQS_KEMOID_CNT] = envval; - if ((envval = getenv("OQS_OID_P256_DILITHIUM2"))) oqs_oid_alg_list[2+OQS_KEMOID_CNT] = envval; - if ((envval = getenv("OQS_OID_RSA3072_DILITHIUM2"))) oqs_oid_alg_list[4+OQS_KEMOID_CNT] = envval; - if ((envval = getenv("OQS_OID_DILITHIUM3"))) oqs_oid_alg_list[6+OQS_KEMOID_CNT] = envval; - if ((envval = getenv("OQS_OID_P384_DILITHIUM3"))) oqs_oid_alg_list[8+OQS_KEMOID_CNT] = envval; - if ((envval = getenv("OQS_OID_DILITHIUM5"))) oqs_oid_alg_list[10+OQS_KEMOID_CNT] = envval; - if ((envval = getenv("OQS_OID_P521_DILITHIUM5"))) oqs_oid_alg_list[12+OQS_KEMOID_CNT] = envval; - if ((envval = getenv("OQS_OID_MLDSA44"))) oqs_oid_alg_list[14+OQS_KEMOID_CNT] = envval; - if ((envval = getenv("OQS_OID_P256_MLDSA44"))) oqs_oid_alg_list[16+OQS_KEMOID_CNT] = envval; - if ((envval = getenv("OQS_OID_RSA3072_MLDSA44"))) oqs_oid_alg_list[18+OQS_KEMOID_CNT] = envval; - if ((envval = getenv("OQS_OID_MLDSA44_PSS2048"))) oqs_oid_alg_list[20+OQS_KEMOID_CNT] = envval; - if ((envval = getenv("OQS_OID_MLDSA44_RSA2048"))) oqs_oid_alg_list[22+OQS_KEMOID_CNT] = envval; - if ((envval = getenv("OQS_OID_MLDSA44_ED25519"))) oqs_oid_alg_list[24+OQS_KEMOID_CNT] = envval; - if ((envval = getenv("OQS_OID_MLDSA44_P256"))) oqs_oid_alg_list[26+OQS_KEMOID_CNT] = envval; - if ((envval = getenv("OQS_OID_MLDSA44_BP256"))) oqs_oid_alg_list[28+OQS_KEMOID_CNT] = envval; - if ((envval = getenv("OQS_OID_MLDSA65"))) oqs_oid_alg_list[30+OQS_KEMOID_CNT] = envval; - if ((envval = getenv("OQS_OID_P384_MLDSA65"))) oqs_oid_alg_list[32+OQS_KEMOID_CNT] = envval; - if ((envval = getenv("OQS_OID_MLDSA65_PSS3072"))) oqs_oid_alg_list[34+OQS_KEMOID_CNT] = envval; - if ((envval = getenv("OQS_OID_MLDSA65_RSA3072"))) oqs_oid_alg_list[36+OQS_KEMOID_CNT] = envval; - if ((envval = getenv("OQS_OID_MLDSA65_P256"))) oqs_oid_alg_list[38+OQS_KEMOID_CNT] = envval; - if ((envval = getenv("OQS_OID_MLDSA65_BP256"))) oqs_oid_alg_list[40+OQS_KEMOID_CNT] = envval; - if ((envval = getenv("OQS_OID_MLDSA65_ED25519"))) oqs_oid_alg_list[42+OQS_KEMOID_CNT] = envval; - if ((envval = getenv("OQS_OID_MLDSA87"))) oqs_oid_alg_list[44+OQS_KEMOID_CNT] = envval; - if ((envval = getenv("OQS_OID_P521_MLDSA87"))) oqs_oid_alg_list[46+OQS_KEMOID_CNT] = envval; - if ((envval = getenv("OQS_OID_MLDSA87_P384"))) oqs_oid_alg_list[48+OQS_KEMOID_CNT] = envval; - if ((envval = getenv("OQS_OID_MLDSA87_BP384"))) oqs_oid_alg_list[50+OQS_KEMOID_CNT] = envval; - if ((envval = getenv("OQS_OID_MLDSA87_ED448"))) oqs_oid_alg_list[52+OQS_KEMOID_CNT] = envval; - if ((envval = getenv("OQS_OID_FALCON512"))) oqs_oid_alg_list[54+OQS_KEMOID_CNT] = envval; - if ((envval = getenv("OQS_OID_P256_FALCON512"))) oqs_oid_alg_list[56+OQS_KEMOID_CNT] = envval; - if ((envval = getenv("OQS_OID_RSA3072_FALCON512"))) oqs_oid_alg_list[58+OQS_KEMOID_CNT] = envval; - if ((envval = getenv("OQS_OID_FALCONPADDED512"))) oqs_oid_alg_list[60+OQS_KEMOID_CNT] = envval; - if ((envval = getenv("OQS_OID_P256_FALCONPADDED512"))) oqs_oid_alg_list[62+OQS_KEMOID_CNT] = envval; - if ((envval = getenv("OQS_OID_RSA3072_FALCONPADDED512"))) oqs_oid_alg_list[64+OQS_KEMOID_CNT] = envval; - if ((envval = getenv("OQS_OID_FALCON1024"))) oqs_oid_alg_list[66+OQS_KEMOID_CNT] = envval; - if ((envval = getenv("OQS_OID_P521_FALCON1024"))) oqs_oid_alg_list[68+OQS_KEMOID_CNT] = envval; - if ((envval = getenv("OQS_OID_FALCONPADDED1024"))) oqs_oid_alg_list[70+OQS_KEMOID_CNT] = envval; - if ((envval = getenv("OQS_OID_P521_FALCONPADDED1024"))) oqs_oid_alg_list[72+OQS_KEMOID_CNT] = envval; - if ((envval = getenv("OQS_OID_SPHINCSSHA2128FSIMPLE"))) oqs_oid_alg_list[74+OQS_KEMOID_CNT] = envval; - if ((envval = getenv("OQS_OID_P256_SPHINCSSHA2128FSIMPLE"))) oqs_oid_alg_list[76+OQS_KEMOID_CNT] = envval; - if ((envval = getenv("OQS_OID_RSA3072_SPHINCSSHA2128FSIMPLE"))) oqs_oid_alg_list[78+OQS_KEMOID_CNT] = envval; - if ((envval = getenv("OQS_OID_SPHINCSSHA2128SSIMPLE"))) oqs_oid_alg_list[80+OQS_KEMOID_CNT] = envval; - if ((envval = getenv("OQS_OID_P256_SPHINCSSHA2128SSIMPLE"))) oqs_oid_alg_list[82+OQS_KEMOID_CNT] = envval; - if ((envval = getenv("OQS_OID_RSA3072_SPHINCSSHA2128SSIMPLE"))) oqs_oid_alg_list[84+OQS_KEMOID_CNT] = envval; - if ((envval = getenv("OQS_OID_SPHINCSSHA2192FSIMPLE"))) oqs_oid_alg_list[86+OQS_KEMOID_CNT] = envval; - if ((envval = getenv("OQS_OID_P384_SPHINCSSHA2192FSIMPLE"))) oqs_oid_alg_list[88+OQS_KEMOID_CNT] = envval; - if ((envval = getenv("OQS_OID_SPHINCSSHAKE128FSIMPLE"))) oqs_oid_alg_list[90+OQS_KEMOID_CNT] = envval; - if ((envval = getenv("OQS_OID_P256_SPHINCSSHAKE128FSIMPLE"))) oqs_oid_alg_list[92+OQS_KEMOID_CNT] = envval; - if ((envval = getenv("OQS_OID_RSA3072_SPHINCSSHAKE128FSIMPLE"))) oqs_oid_alg_list[94+OQS_KEMOID_CNT] = envval; - if ((envval = getenv("OQS_OID_MAYO1"))) oqs_oid_alg_list[96+OQS_KEMOID_CNT] = envval; - if ((envval = getenv("OQS_OID_P256_MAYO1"))) oqs_oid_alg_list[98+OQS_KEMOID_CNT] = envval; - if ((envval = getenv("OQS_OID_MAYO2"))) oqs_oid_alg_list[100+OQS_KEMOID_CNT] = envval; - if ((envval = getenv("OQS_OID_P256_MAYO2"))) oqs_oid_alg_list[102+OQS_KEMOID_CNT] = envval; - if ((envval = getenv("OQS_OID_MAYO3"))) oqs_oid_alg_list[104+OQS_KEMOID_CNT] = envval; - if ((envval = getenv("OQS_OID_P384_MAYO3"))) oqs_oid_alg_list[106+OQS_KEMOID_CNT] = envval; - if ((envval = getenv("OQS_OID_MAYO5"))) oqs_oid_alg_list[108+OQS_KEMOID_CNT] = envval; - if ((envval = getenv("OQS_OID_P521_MAYO5"))) oqs_oid_alg_list[110+OQS_KEMOID_CNT] = envval; - if ((envval = getenv("OQS_OID_CROSSRSDP128BALANCED"))) oqs_oid_alg_list[112+OQS_KEMOID_CNT] = envval; -}///// OQS_TEMPLATE_FRAGMENT_OID_PATCHING_END + if ((envval = getenv("OQS_OID_DILITHIUM2"))) + oqs_oid_alg_list[0 + OQS_KEMOID_CNT] = envval; + if ((envval = getenv("OQS_OID_P256_DILITHIUM2"))) + oqs_oid_alg_list[2 + OQS_KEMOID_CNT] = envval; + if ((envval = getenv("OQS_OID_RSA3072_DILITHIUM2"))) + oqs_oid_alg_list[4 + OQS_KEMOID_CNT] = envval; + if ((envval = getenv("OQS_OID_DILITHIUM3"))) + oqs_oid_alg_list[6 + OQS_KEMOID_CNT] = envval; + if ((envval = getenv("OQS_OID_P384_DILITHIUM3"))) + oqs_oid_alg_list[8 + OQS_KEMOID_CNT] = envval; + if ((envval = getenv("OQS_OID_DILITHIUM5"))) + oqs_oid_alg_list[10 + OQS_KEMOID_CNT] = envval; + if ((envval = getenv("OQS_OID_P521_DILITHIUM5"))) + oqs_oid_alg_list[12 + OQS_KEMOID_CNT] = envval; + if ((envval = getenv("OQS_OID_MLDSA44"))) + oqs_oid_alg_list[14 + OQS_KEMOID_CNT] = envval; + if ((envval = getenv("OQS_OID_P256_MLDSA44"))) + oqs_oid_alg_list[16 + OQS_KEMOID_CNT] = envval; + if ((envval = getenv("OQS_OID_RSA3072_MLDSA44"))) + oqs_oid_alg_list[18 + OQS_KEMOID_CNT] = envval; + if ((envval = getenv("OQS_OID_MLDSA44_PSS2048"))) + oqs_oid_alg_list[20 + OQS_KEMOID_CNT] = envval; + if ((envval = getenv("OQS_OID_MLDSA44_RSA2048"))) + oqs_oid_alg_list[22 + OQS_KEMOID_CNT] = envval; + if ((envval = getenv("OQS_OID_MLDSA44_ED25519"))) + oqs_oid_alg_list[24 + OQS_KEMOID_CNT] = envval; + if ((envval = getenv("OQS_OID_MLDSA44_P256"))) + oqs_oid_alg_list[26 + OQS_KEMOID_CNT] = envval; + if ((envval = getenv("OQS_OID_MLDSA44_BP256"))) + oqs_oid_alg_list[28 + OQS_KEMOID_CNT] = envval; + if ((envval = getenv("OQS_OID_MLDSA65"))) + oqs_oid_alg_list[30 + OQS_KEMOID_CNT] = envval; + if ((envval = getenv("OQS_OID_P384_MLDSA65"))) + oqs_oid_alg_list[32 + OQS_KEMOID_CNT] = envval; + if ((envval = getenv("OQS_OID_MLDSA65_PSS3072"))) + oqs_oid_alg_list[34 + OQS_KEMOID_CNT] = envval; + if ((envval = getenv("OQS_OID_MLDSA65_RSA3072"))) + oqs_oid_alg_list[36 + OQS_KEMOID_CNT] = envval; + if ((envval = getenv("OQS_OID_MLDSA65_P256"))) + oqs_oid_alg_list[38 + OQS_KEMOID_CNT] = envval; + if ((envval = getenv("OQS_OID_MLDSA65_BP256"))) + oqs_oid_alg_list[40 + OQS_KEMOID_CNT] = envval; + if ((envval = getenv("OQS_OID_MLDSA65_ED25519"))) + oqs_oid_alg_list[42 + OQS_KEMOID_CNT] = envval; + if ((envval = getenv("OQS_OID_MLDSA87"))) + oqs_oid_alg_list[44 + OQS_KEMOID_CNT] = envval; + if ((envval = getenv("OQS_OID_P521_MLDSA87"))) + oqs_oid_alg_list[46 + OQS_KEMOID_CNT] = envval; + if ((envval = getenv("OQS_OID_MLDSA87_P384"))) + oqs_oid_alg_list[48 + OQS_KEMOID_CNT] = envval; + if ((envval = getenv("OQS_OID_MLDSA87_BP384"))) + oqs_oid_alg_list[50 + OQS_KEMOID_CNT] = envval; + if ((envval = getenv("OQS_OID_MLDSA87_ED448"))) + oqs_oid_alg_list[52 + OQS_KEMOID_CNT] = envval; + if ((envval = getenv("OQS_OID_FALCON512"))) + oqs_oid_alg_list[54 + OQS_KEMOID_CNT] = envval; + if ((envval = getenv("OQS_OID_P256_FALCON512"))) + oqs_oid_alg_list[56 + OQS_KEMOID_CNT] = envval; + if ((envval = getenv("OQS_OID_RSA3072_FALCON512"))) + oqs_oid_alg_list[58 + OQS_KEMOID_CNT] = envval; + if ((envval = getenv("OQS_OID_FALCONPADDED512"))) + oqs_oid_alg_list[60 + OQS_KEMOID_CNT] = envval; + if ((envval = getenv("OQS_OID_P256_FALCONPADDED512"))) + oqs_oid_alg_list[62 + OQS_KEMOID_CNT] = envval; + if ((envval = getenv("OQS_OID_RSA3072_FALCONPADDED512"))) + oqs_oid_alg_list[64 + OQS_KEMOID_CNT] = envval; + if ((envval = getenv("OQS_OID_FALCON1024"))) + oqs_oid_alg_list[66 + OQS_KEMOID_CNT] = envval; + if ((envval = getenv("OQS_OID_P521_FALCON1024"))) + oqs_oid_alg_list[68 + OQS_KEMOID_CNT] = envval; + if ((envval = getenv("OQS_OID_FALCONPADDED1024"))) + oqs_oid_alg_list[70 + OQS_KEMOID_CNT] = envval; + if ((envval = getenv("OQS_OID_P521_FALCONPADDED1024"))) + oqs_oid_alg_list[72 + OQS_KEMOID_CNT] = envval; + if ((envval = getenv("OQS_OID_SPHINCSSHA2128FSIMPLE"))) + oqs_oid_alg_list[74 + OQS_KEMOID_CNT] = envval; + if ((envval = getenv("OQS_OID_P256_SPHINCSSHA2128FSIMPLE"))) + oqs_oid_alg_list[76 + OQS_KEMOID_CNT] = envval; + if ((envval = getenv("OQS_OID_RSA3072_SPHINCSSHA2128FSIMPLE"))) + oqs_oid_alg_list[78 + OQS_KEMOID_CNT] = envval; + if ((envval = getenv("OQS_OID_SPHINCSSHA2128SSIMPLE"))) + oqs_oid_alg_list[80 + OQS_KEMOID_CNT] = envval; + if ((envval = getenv("OQS_OID_P256_SPHINCSSHA2128SSIMPLE"))) + oqs_oid_alg_list[82 + OQS_KEMOID_CNT] = envval; + if ((envval = getenv("OQS_OID_RSA3072_SPHINCSSHA2128SSIMPLE"))) + oqs_oid_alg_list[84 + OQS_KEMOID_CNT] = envval; + if ((envval = getenv("OQS_OID_SPHINCSSHA2192FSIMPLE"))) + oqs_oid_alg_list[86 + OQS_KEMOID_CNT] = envval; + if ((envval = getenv("OQS_OID_P384_SPHINCSSHA2192FSIMPLE"))) + oqs_oid_alg_list[88 + OQS_KEMOID_CNT] = envval; + if ((envval = getenv("OQS_OID_SPHINCSSHAKE128FSIMPLE"))) + oqs_oid_alg_list[90 + OQS_KEMOID_CNT] = envval; + if ((envval = getenv("OQS_OID_P256_SPHINCSSHAKE128FSIMPLE"))) + oqs_oid_alg_list[92 + OQS_KEMOID_CNT] = envval; + if ((envval = getenv("OQS_OID_RSA3072_SPHINCSSHAKE128FSIMPLE"))) + oqs_oid_alg_list[94 + OQS_KEMOID_CNT] = envval; + if ((envval = getenv("OQS_OID_MAYO1"))) + oqs_oid_alg_list[96 + OQS_KEMOID_CNT] = envval; + if ((envval = getenv("OQS_OID_P256_MAYO1"))) + oqs_oid_alg_list[98 + OQS_KEMOID_CNT] = envval; + if ((envval = getenv("OQS_OID_MAYO2"))) + oqs_oid_alg_list[100 + OQS_KEMOID_CNT] = envval; + if ((envval = getenv("OQS_OID_P256_MAYO2"))) + oqs_oid_alg_list[102 + OQS_KEMOID_CNT] = envval; + if ((envval = getenv("OQS_OID_MAYO3"))) + oqs_oid_alg_list[104 + OQS_KEMOID_CNT] = envval; + if ((envval = getenv("OQS_OID_P384_MAYO3"))) + oqs_oid_alg_list[106 + OQS_KEMOID_CNT] = envval; + if ((envval = getenv("OQS_OID_MAYO5"))) + oqs_oid_alg_list[108 + OQS_KEMOID_CNT] = envval; + if ((envval = getenv("OQS_OID_P521_MAYO5"))) + oqs_oid_alg_list[110 + OQS_KEMOID_CNT] = envval; + if ((envval = getenv("OQS_OID_CROSSRSDP128BALANCED"))) + oqs_oid_alg_list[112 + OQS_KEMOID_CNT] = envval; + } ///// OQS_TEMPLATE_FRAGMENT_OID_PATCHING_END return 1; } #ifdef USE_ENCODING_LIB const char *oqs_alg_encoding_list[OQS_OID_CNT] = {0}; -int oqs_patch_encodings(void) -{ +int oqs_patch_encodings(void) { ///// OQS_TEMPLATE_FRAGMENT_ENCODING_PATCHING_START -{ const char* envval = NULL; - if ((envval = getenv("OQS_ENCODING_DILITHIUM2"))) oqs_alg_encoding_list[0] = envval; - if ((envval = getenv("OQS_ENCODING_DILITHIUM2_ALGNAME"))) oqs_alg_encoding_list[1] = envval; - if ((envval = getenv("OQS_ENCODING_P256_DILITHIUM2"))) oqs_alg_encoding_list[2] = envval; - if ((envval = getenv("OQS_ENCODING_P256_DILITHIUM2_ALGNAME"))) oqs_alg_encoding_list[3] = envval; - if ((envval = getenv("OQS_ENCODING_RSA3072_DILITHIUM2"))) oqs_alg_encoding_list[4] = envval; - if ((envval = getenv("OQS_ENCODING_RSA3072_DILITHIUM2_ALGNAME"))) oqs_alg_encoding_list[5] = envval; - if ((envval = getenv("OQS_ENCODING_DILITHIUM3"))) oqs_alg_encoding_list[6] = envval; - if ((envval = getenv("OQS_ENCODING_DILITHIUM3_ALGNAME"))) oqs_alg_encoding_list[7] = envval; - if ((envval = getenv("OQS_ENCODING_P384_DILITHIUM3"))) oqs_alg_encoding_list[8] = envval; - if ((envval = getenv("OQS_ENCODING_P384_DILITHIUM3_ALGNAME"))) oqs_alg_encoding_list[9] = envval; - if ((envval = getenv("OQS_ENCODING_DILITHIUM5"))) oqs_alg_encoding_list[10] = envval; - if ((envval = getenv("OQS_ENCODING_DILITHIUM5_ALGNAME"))) oqs_alg_encoding_list[11] = envval; - if ((envval = getenv("OQS_ENCODING_P521_DILITHIUM5"))) oqs_alg_encoding_list[12] = envval; - if ((envval = getenv("OQS_ENCODING_P521_DILITHIUM5_ALGNAME"))) oqs_alg_encoding_list[13] = envval; - if ((envval = getenv("OQS_ENCODING_MLDSA44"))) oqs_alg_encoding_list[14] = envval; - if ((envval = getenv("OQS_ENCODING_MLDSA44_ALGNAME"))) oqs_alg_encoding_list[15] = envval; - if ((envval = getenv("OQS_ENCODING_P256_MLDSA44"))) oqs_alg_encoding_list[16] = envval; - if ((envval = getenv("OQS_ENCODING_P256_MLDSA44_ALGNAME"))) oqs_alg_encoding_list[17] = envval; - if ((envval = getenv("OQS_ENCODING_RSA3072_MLDSA44"))) oqs_alg_encoding_list[18] = envval; - if ((envval = getenv("OQS_ENCODING_RSA3072_MLDSA44_ALGNAME"))) oqs_alg_encoding_list[19] = envval; - if (getenv("OQS_ENCODING_MLDSA44_PSS2048")) oqs_alg_encoding_list[20] = getenv("OQS_ENCODING_MLDSA44_PSS2048"); - if (getenv("OQS_ENCODING_MLDSA44_PSS2048_ALGNAME")) oqs_alg_encoding_list[21] = getenv("OQS_ENCODING_MLDSA44_PSS2048_ALGNAME"); - if (getenv("OQS_ENCODING_MLDSA44_RSA2048")) oqs_alg_encoding_list[22] = getenv("OQS_ENCODING_MLDSA44_RSA2048"); - if (getenv("OQS_ENCODING_MLDSA44_RSA2048_ALGNAME")) oqs_alg_encoding_list[23] = getenv("OQS_ENCODING_MLDSA44_RSA2048_ALGNAME"); - if (getenv("OQS_ENCODING_MLDSA44_ED25519")) oqs_alg_encoding_list[24] = getenv("OQS_ENCODING_MLDSA44_ED25519"); - if (getenv("OQS_ENCODING_MLDSA44_ED25519_ALGNAME")) oqs_alg_encoding_list[25] = getenv("OQS_ENCODING_MLDSA44_ED25519_ALGNAME"); - if (getenv("OQS_ENCODING_MLDSA44_P256")) oqs_alg_encoding_list[26] = getenv("OQS_ENCODING_MLDSA44_P256"); - if (getenv("OQS_ENCODING_MLDSA44_P256_ALGNAME")) oqs_alg_encoding_list[27] = getenv("OQS_ENCODING_MLDSA44_P256_ALGNAME"); - if (getenv("OQS_ENCODING_MLDSA44_BP256")) oqs_alg_encoding_list[28] = getenv("OQS_ENCODING_MLDSA44_BP256"); - if (getenv("OQS_ENCODING_MLDSA44_BP256_ALGNAME")) oqs_alg_encoding_list[29] = getenv("OQS_ENCODING_MLDSA44_BP256_ALGNAME"); - if ((envval = getenv("OQS_ENCODING_MLDSA65"))) oqs_alg_encoding_list[30] = envval; - if ((envval = getenv("OQS_ENCODING_MLDSA65_ALGNAME"))) oqs_alg_encoding_list[31] = envval; - if ((envval = getenv("OQS_ENCODING_P384_MLDSA65"))) oqs_alg_encoding_list[32] = envval; - if ((envval = getenv("OQS_ENCODING_P384_MLDSA65_ALGNAME"))) oqs_alg_encoding_list[33] = envval; - if (getenv("OQS_ENCODING_MLDSA65_PSS3072")) oqs_alg_encoding_list[34] = getenv("OQS_ENCODING_MLDSA65_PSS3072"); - if (getenv("OQS_ENCODING_MLDSA65_PSS3072_ALGNAME")) oqs_alg_encoding_list[35] = getenv("OQS_ENCODING_MLDSA65_PSS3072_ALGNAME"); - if (getenv("OQS_ENCODING_MLDSA65_RSA3072")) oqs_alg_encoding_list[36] = getenv("OQS_ENCODING_MLDSA65_RSA3072"); - if (getenv("OQS_ENCODING_MLDSA65_RSA3072_ALGNAME")) oqs_alg_encoding_list[37] = getenv("OQS_ENCODING_MLDSA65_RSA3072_ALGNAME"); - if (getenv("OQS_ENCODING_MLDSA65_P256")) oqs_alg_encoding_list[38] = getenv("OQS_ENCODING_MLDSA65_P256"); - if (getenv("OQS_ENCODING_MLDSA65_P256_ALGNAME")) oqs_alg_encoding_list[39] = getenv("OQS_ENCODING_MLDSA65_P256_ALGNAME"); - if (getenv("OQS_ENCODING_MLDSA65_BP256")) oqs_alg_encoding_list[40] = getenv("OQS_ENCODING_MLDSA65_BP256"); - if (getenv("OQS_ENCODING_MLDSA65_BP256_ALGNAME")) oqs_alg_encoding_list[41] = getenv("OQS_ENCODING_MLDSA65_BP256_ALGNAME"); - if (getenv("OQS_ENCODING_MLDSA65_ED25519")) oqs_alg_encoding_list[42] = getenv("OQS_ENCODING_MLDSA65_ED25519"); - if (getenv("OQS_ENCODING_MLDSA65_ED25519_ALGNAME")) oqs_alg_encoding_list[43] = getenv("OQS_ENCODING_MLDSA65_ED25519_ALGNAME"); - if ((envval = getenv("OQS_ENCODING_MLDSA87"))) oqs_alg_encoding_list[44] = envval; - if ((envval = getenv("OQS_ENCODING_MLDSA87_ALGNAME"))) oqs_alg_encoding_list[45] = envval; - if ((envval = getenv("OQS_ENCODING_P521_MLDSA87"))) oqs_alg_encoding_list[46] = envval; - if ((envval = getenv("OQS_ENCODING_P521_MLDSA87_ALGNAME"))) oqs_alg_encoding_list[47] = envval; - if (getenv("OQS_ENCODING_MLDSA87_P384")) oqs_alg_encoding_list[48] = getenv("OQS_ENCODING_MLDSA87_P384"); - if (getenv("OQS_ENCODING_MLDSA87_P384_ALGNAME")) oqs_alg_encoding_list[49] = getenv("OQS_ENCODING_MLDSA87_P384_ALGNAME"); - if (getenv("OQS_ENCODING_MLDSA87_BP384")) oqs_alg_encoding_list[50] = getenv("OQS_ENCODING_MLDSA87_BP384"); - if (getenv("OQS_ENCODING_MLDSA87_BP384_ALGNAME")) oqs_alg_encoding_list[51] = getenv("OQS_ENCODING_MLDSA87_BP384_ALGNAME"); - if (getenv("OQS_ENCODING_MLDSA87_ED448")) oqs_alg_encoding_list[52] = getenv("OQS_ENCODING_MLDSA87_ED448"); - if (getenv("OQS_ENCODING_MLDSA87_ED448_ALGNAME")) oqs_alg_encoding_list[53] = getenv("OQS_ENCODING_MLDSA87_ED448_ALGNAME"); - if ((envval = getenv("OQS_ENCODING_FALCON512"))) oqs_alg_encoding_list[54] = envval; - if ((envval = getenv("OQS_ENCODING_FALCON512_ALGNAME"))) oqs_alg_encoding_list[55] = envval; - if ((envval = getenv("OQS_ENCODING_P256_FALCON512"))) oqs_alg_encoding_list[56] = envval; - if ((envval = getenv("OQS_ENCODING_P256_FALCON512_ALGNAME"))) oqs_alg_encoding_list[57] = envval; - if ((envval = getenv("OQS_ENCODING_RSA3072_FALCON512"))) oqs_alg_encoding_list[58] = envval; - if ((envval = getenv("OQS_ENCODING_RSA3072_FALCON512_ALGNAME"))) oqs_alg_encoding_list[59] = envval; - if ((envval = getenv("OQS_ENCODING_FALCONPADDED512"))) oqs_alg_encoding_list[60] = envval; - if ((envval = getenv("OQS_ENCODING_FALCONPADDED512_ALGNAME"))) oqs_alg_encoding_list[61] = envval; - if ((envval = getenv("OQS_ENCODING_P256_FALCONPADDED512"))) oqs_alg_encoding_list[62] = envval; - if ((envval = getenv("OQS_ENCODING_P256_FALCONPADDED512_ALGNAME"))) oqs_alg_encoding_list[63] = envval; - if ((envval = getenv("OQS_ENCODING_RSA3072_FALCONPADDED512"))) oqs_alg_encoding_list[64] = envval; - if ((envval = getenv("OQS_ENCODING_RSA3072_FALCONPADDED512_ALGNAME"))) oqs_alg_encoding_list[65] = envval; - if ((envval = getenv("OQS_ENCODING_FALCON1024"))) oqs_alg_encoding_list[66] = envval; - if ((envval = getenv("OQS_ENCODING_FALCON1024_ALGNAME"))) oqs_alg_encoding_list[67] = envval; - if ((envval = getenv("OQS_ENCODING_P521_FALCON1024"))) oqs_alg_encoding_list[68] = envval; - if ((envval = getenv("OQS_ENCODING_P521_FALCON1024_ALGNAME"))) oqs_alg_encoding_list[69] = envval; - if ((envval = getenv("OQS_ENCODING_FALCONPADDED1024"))) oqs_alg_encoding_list[70] = envval; - if ((envval = getenv("OQS_ENCODING_FALCONPADDED1024_ALGNAME"))) oqs_alg_encoding_list[71] = envval; - if ((envval = getenv("OQS_ENCODING_P521_FALCONPADDED1024"))) oqs_alg_encoding_list[72] = envval; - if ((envval = getenv("OQS_ENCODING_P521_FALCONPADDED1024_ALGNAME"))) oqs_alg_encoding_list[73] = envval; - if ((envval = getenv("OQS_ENCODING_SPHINCSSHA2128FSIMPLE"))) oqs_alg_encoding_list[74] = envval; - if ((envval = getenv("OQS_ENCODING_SPHINCSSHA2128FSIMPLE_ALGNAME"))) oqs_alg_encoding_list[75] = envval; - if ((envval = getenv("OQS_ENCODING_P256_SPHINCSSHA2128FSIMPLE"))) oqs_alg_encoding_list[76] = envval; - if ((envval = getenv("OQS_ENCODING_P256_SPHINCSSHA2128FSIMPLE_ALGNAME"))) oqs_alg_encoding_list[77] = envval; - if ((envval = getenv("OQS_ENCODING_RSA3072_SPHINCSSHA2128FSIMPLE"))) oqs_alg_encoding_list[78] = envval; - if ((envval = getenv("OQS_ENCODING_RSA3072_SPHINCSSHA2128FSIMPLE_ALGNAME"))) oqs_alg_encoding_list[79] = envval; - if ((envval = getenv("OQS_ENCODING_SPHINCSSHA2128SSIMPLE"))) oqs_alg_encoding_list[80] = envval; - if ((envval = getenv("OQS_ENCODING_SPHINCSSHA2128SSIMPLE_ALGNAME"))) oqs_alg_encoding_list[81] = envval; - if ((envval = getenv("OQS_ENCODING_P256_SPHINCSSHA2128SSIMPLE"))) oqs_alg_encoding_list[82] = envval; - if ((envval = getenv("OQS_ENCODING_P256_SPHINCSSHA2128SSIMPLE_ALGNAME"))) oqs_alg_encoding_list[83] = envval; - if ((envval = getenv("OQS_ENCODING_RSA3072_SPHINCSSHA2128SSIMPLE"))) oqs_alg_encoding_list[84] = envval; - if ((envval = getenv("OQS_ENCODING_RSA3072_SPHINCSSHA2128SSIMPLE_ALGNAME"))) oqs_alg_encoding_list[85] = envval; - if ((envval = getenv("OQS_ENCODING_SPHINCSSHA2192FSIMPLE"))) oqs_alg_encoding_list[86] = envval; - if ((envval = getenv("OQS_ENCODING_SPHINCSSHA2192FSIMPLE_ALGNAME"))) oqs_alg_encoding_list[87] = envval; - if ((envval = getenv("OQS_ENCODING_P384_SPHINCSSHA2192FSIMPLE"))) oqs_alg_encoding_list[88] = envval; - if ((envval = getenv("OQS_ENCODING_P384_SPHINCSSHA2192FSIMPLE_ALGNAME"))) oqs_alg_encoding_list[89] = envval; - if ((envval = getenv("OQS_ENCODING_SPHINCSSHAKE128FSIMPLE"))) oqs_alg_encoding_list[90] = envval; - if ((envval = getenv("OQS_ENCODING_SPHINCSSHAKE128FSIMPLE_ALGNAME"))) oqs_alg_encoding_list[91] = envval; - if ((envval = getenv("OQS_ENCODING_P256_SPHINCSSHAKE128FSIMPLE"))) oqs_alg_encoding_list[92] = envval; - if ((envval = getenv("OQS_ENCODING_P256_SPHINCSSHAKE128FSIMPLE_ALGNAME"))) oqs_alg_encoding_list[93] = envval; - if ((envval = getenv("OQS_ENCODING_RSA3072_SPHINCSSHAKE128FSIMPLE"))) oqs_alg_encoding_list[94] = envval; - if ((envval = getenv("OQS_ENCODING_RSA3072_SPHINCSSHAKE128FSIMPLE_ALGNAME"))) oqs_alg_encoding_list[95] = envval; - if ((envval = getenv("OQS_ENCODING_MAYO1"))) oqs_alg_encoding_list[96] = envval; - if ((envval = getenv("OQS_ENCODING_MAYO1_ALGNAME"))) oqs_alg_encoding_list[97] = envval; - if ((envval = getenv("OQS_ENCODING_P256_MAYO1"))) oqs_alg_encoding_list[98] = envval; - if ((envval = getenv("OQS_ENCODING_P256_MAYO1_ALGNAME"))) oqs_alg_encoding_list[99] = envval; - if ((envval = getenv("OQS_ENCODING_MAYO2"))) oqs_alg_encoding_list[100] = envval; - if ((envval = getenv("OQS_ENCODING_MAYO2_ALGNAME"))) oqs_alg_encoding_list[101] = envval; - if ((envval = getenv("OQS_ENCODING_P256_MAYO2"))) oqs_alg_encoding_list[102] = envval; - if ((envval = getenv("OQS_ENCODING_P256_MAYO2_ALGNAME"))) oqs_alg_encoding_list[103] = envval; - if ((envval = getenv("OQS_ENCODING_MAYO3"))) oqs_alg_encoding_list[104] = envval; - if ((envval = getenv("OQS_ENCODING_MAYO3_ALGNAME"))) oqs_alg_encoding_list[105] = envval; - if ((envval = getenv("OQS_ENCODING_P384_MAYO3"))) oqs_alg_encoding_list[106] = envval; - if ((envval = getenv("OQS_ENCODING_P384_MAYO3_ALGNAME"))) oqs_alg_encoding_list[107] = envval; - if ((envval = getenv("OQS_ENCODING_MAYO5"))) oqs_alg_encoding_list[108] = envval; - if ((envval = getenv("OQS_ENCODING_MAYO5_ALGNAME"))) oqs_alg_encoding_list[109] = envval; - if ((envval = getenv("OQS_ENCODING_P521_MAYO5"))) oqs_alg_encoding_list[110] = envval; - if ((envval = getenv("OQS_ENCODING_P521_MAYO5_ALGNAME"))) oqs_alg_encoding_list[111] = envval; - if ((envval = getenv("OQS_ENCODING_CROSSRSDP128BALANCED"))) oqs_alg_encoding_list[112] = envval; - if ((envval = getenv("OQS_ENCODING_CROSSRSDP128BALANCED_ALGNAME"))) oqs_alg_encoding_list[113] = envval; -} -///// OQS_TEMPLATE_FRAGMENT_ENCODING_PATCHING_END + { + const char *envval = NULL; + if ((envval = getenv("OQS_ENCODING_DILITHIUM2"))) + oqs_alg_encoding_list[0] = envval; + if ((envval = getenv("OQS_ENCODING_DILITHIUM2_ALGNAME"))) + oqs_alg_encoding_list[1] = envval; + if ((envval = getenv("OQS_ENCODING_P256_DILITHIUM2"))) + oqs_alg_encoding_list[2] = envval; + if ((envval = getenv("OQS_ENCODING_P256_DILITHIUM2_ALGNAME"))) + oqs_alg_encoding_list[3] = envval; + if ((envval = getenv("OQS_ENCODING_RSA3072_DILITHIUM2"))) + oqs_alg_encoding_list[4] = envval; + if ((envval = getenv("OQS_ENCODING_RSA3072_DILITHIUM2_ALGNAME"))) + oqs_alg_encoding_list[5] = envval; + if ((envval = getenv("OQS_ENCODING_DILITHIUM3"))) + oqs_alg_encoding_list[6] = envval; + if ((envval = getenv("OQS_ENCODING_DILITHIUM3_ALGNAME"))) + oqs_alg_encoding_list[7] = envval; + if ((envval = getenv("OQS_ENCODING_P384_DILITHIUM3"))) + oqs_alg_encoding_list[8] = envval; + if ((envval = getenv("OQS_ENCODING_P384_DILITHIUM3_ALGNAME"))) + oqs_alg_encoding_list[9] = envval; + if ((envval = getenv("OQS_ENCODING_DILITHIUM5"))) + oqs_alg_encoding_list[10] = envval; + if ((envval = getenv("OQS_ENCODING_DILITHIUM5_ALGNAME"))) + oqs_alg_encoding_list[11] = envval; + if ((envval = getenv("OQS_ENCODING_P521_DILITHIUM5"))) + oqs_alg_encoding_list[12] = envval; + if ((envval = getenv("OQS_ENCODING_P521_DILITHIUM5_ALGNAME"))) + oqs_alg_encoding_list[13] = envval; + if ((envval = getenv("OQS_ENCODING_MLDSA44"))) + oqs_alg_encoding_list[14] = envval; + if ((envval = getenv("OQS_ENCODING_MLDSA44_ALGNAME"))) + oqs_alg_encoding_list[15] = envval; + if ((envval = getenv("OQS_ENCODING_P256_MLDSA44"))) + oqs_alg_encoding_list[16] = envval; + if ((envval = getenv("OQS_ENCODING_P256_MLDSA44_ALGNAME"))) + oqs_alg_encoding_list[17] = envval; + if ((envval = getenv("OQS_ENCODING_RSA3072_MLDSA44"))) + oqs_alg_encoding_list[18] = envval; + if ((envval = getenv("OQS_ENCODING_RSA3072_MLDSA44_ALGNAME"))) + oqs_alg_encoding_list[19] = envval; + if (getenv("OQS_ENCODING_MLDSA44_PSS2048")) + oqs_alg_encoding_list[20] = getenv("OQS_ENCODING_MLDSA44_PSS2048"); + if (getenv("OQS_ENCODING_MLDSA44_PSS2048_ALGNAME")) + oqs_alg_encoding_list[21] = + getenv("OQS_ENCODING_MLDSA44_PSS2048_ALGNAME"); + if (getenv("OQS_ENCODING_MLDSA44_RSA2048")) + oqs_alg_encoding_list[22] = getenv("OQS_ENCODING_MLDSA44_RSA2048"); + if (getenv("OQS_ENCODING_MLDSA44_RSA2048_ALGNAME")) + oqs_alg_encoding_list[23] = + getenv("OQS_ENCODING_MLDSA44_RSA2048_ALGNAME"); + if (getenv("OQS_ENCODING_MLDSA44_ED25519")) + oqs_alg_encoding_list[24] = getenv("OQS_ENCODING_MLDSA44_ED25519"); + if (getenv("OQS_ENCODING_MLDSA44_ED25519_ALGNAME")) + oqs_alg_encoding_list[25] = + getenv("OQS_ENCODING_MLDSA44_ED25519_ALGNAME"); + if (getenv("OQS_ENCODING_MLDSA44_P256")) + oqs_alg_encoding_list[26] = getenv("OQS_ENCODING_MLDSA44_P256"); + if (getenv("OQS_ENCODING_MLDSA44_P256_ALGNAME")) + oqs_alg_encoding_list[27] = + getenv("OQS_ENCODING_MLDSA44_P256_ALGNAME"); + if (getenv("OQS_ENCODING_MLDSA44_BP256")) + oqs_alg_encoding_list[28] = getenv("OQS_ENCODING_MLDSA44_BP256"); + if (getenv("OQS_ENCODING_MLDSA44_BP256_ALGNAME")) + oqs_alg_encoding_list[29] = + getenv("OQS_ENCODING_MLDSA44_BP256_ALGNAME"); + if ((envval = getenv("OQS_ENCODING_MLDSA65"))) + oqs_alg_encoding_list[30] = envval; + if ((envval = getenv("OQS_ENCODING_MLDSA65_ALGNAME"))) + oqs_alg_encoding_list[31] = envval; + if ((envval = getenv("OQS_ENCODING_P384_MLDSA65"))) + oqs_alg_encoding_list[32] = envval; + if ((envval = getenv("OQS_ENCODING_P384_MLDSA65_ALGNAME"))) + oqs_alg_encoding_list[33] = envval; + if (getenv("OQS_ENCODING_MLDSA65_PSS3072")) + oqs_alg_encoding_list[34] = getenv("OQS_ENCODING_MLDSA65_PSS3072"); + if (getenv("OQS_ENCODING_MLDSA65_PSS3072_ALGNAME")) + oqs_alg_encoding_list[35] = + getenv("OQS_ENCODING_MLDSA65_PSS3072_ALGNAME"); + if (getenv("OQS_ENCODING_MLDSA65_RSA3072")) + oqs_alg_encoding_list[36] = getenv("OQS_ENCODING_MLDSA65_RSA3072"); + if (getenv("OQS_ENCODING_MLDSA65_RSA3072_ALGNAME")) + oqs_alg_encoding_list[37] = + getenv("OQS_ENCODING_MLDSA65_RSA3072_ALGNAME"); + if (getenv("OQS_ENCODING_MLDSA65_P256")) + oqs_alg_encoding_list[38] = getenv("OQS_ENCODING_MLDSA65_P256"); + if (getenv("OQS_ENCODING_MLDSA65_P256_ALGNAME")) + oqs_alg_encoding_list[39] = + getenv("OQS_ENCODING_MLDSA65_P256_ALGNAME"); + if (getenv("OQS_ENCODING_MLDSA65_BP256")) + oqs_alg_encoding_list[40] = getenv("OQS_ENCODING_MLDSA65_BP256"); + if (getenv("OQS_ENCODING_MLDSA65_BP256_ALGNAME")) + oqs_alg_encoding_list[41] = + getenv("OQS_ENCODING_MLDSA65_BP256_ALGNAME"); + if (getenv("OQS_ENCODING_MLDSA65_ED25519")) + oqs_alg_encoding_list[42] = getenv("OQS_ENCODING_MLDSA65_ED25519"); + if (getenv("OQS_ENCODING_MLDSA65_ED25519_ALGNAME")) + oqs_alg_encoding_list[43] = + getenv("OQS_ENCODING_MLDSA65_ED25519_ALGNAME"); + if ((envval = getenv("OQS_ENCODING_MLDSA87"))) + oqs_alg_encoding_list[44] = envval; + if ((envval = getenv("OQS_ENCODING_MLDSA87_ALGNAME"))) + oqs_alg_encoding_list[45] = envval; + if ((envval = getenv("OQS_ENCODING_P521_MLDSA87"))) + oqs_alg_encoding_list[46] = envval; + if ((envval = getenv("OQS_ENCODING_P521_MLDSA87_ALGNAME"))) + oqs_alg_encoding_list[47] = envval; + if (getenv("OQS_ENCODING_MLDSA87_P384")) + oqs_alg_encoding_list[48] = getenv("OQS_ENCODING_MLDSA87_P384"); + if (getenv("OQS_ENCODING_MLDSA87_P384_ALGNAME")) + oqs_alg_encoding_list[49] = + getenv("OQS_ENCODING_MLDSA87_P384_ALGNAME"); + if (getenv("OQS_ENCODING_MLDSA87_BP384")) + oqs_alg_encoding_list[50] = getenv("OQS_ENCODING_MLDSA87_BP384"); + if (getenv("OQS_ENCODING_MLDSA87_BP384_ALGNAME")) + oqs_alg_encoding_list[51] = + getenv("OQS_ENCODING_MLDSA87_BP384_ALGNAME"); + if (getenv("OQS_ENCODING_MLDSA87_ED448")) + oqs_alg_encoding_list[52] = getenv("OQS_ENCODING_MLDSA87_ED448"); + if (getenv("OQS_ENCODING_MLDSA87_ED448_ALGNAME")) + oqs_alg_encoding_list[53] = + getenv("OQS_ENCODING_MLDSA87_ED448_ALGNAME"); + if ((envval = getenv("OQS_ENCODING_FALCON512"))) + oqs_alg_encoding_list[54] = envval; + if ((envval = getenv("OQS_ENCODING_FALCON512_ALGNAME"))) + oqs_alg_encoding_list[55] = envval; + if ((envval = getenv("OQS_ENCODING_P256_FALCON512"))) + oqs_alg_encoding_list[56] = envval; + if ((envval = getenv("OQS_ENCODING_P256_FALCON512_ALGNAME"))) + oqs_alg_encoding_list[57] = envval; + if ((envval = getenv("OQS_ENCODING_RSA3072_FALCON512"))) + oqs_alg_encoding_list[58] = envval; + if ((envval = getenv("OQS_ENCODING_RSA3072_FALCON512_ALGNAME"))) + oqs_alg_encoding_list[59] = envval; + if ((envval = getenv("OQS_ENCODING_FALCONPADDED512"))) + oqs_alg_encoding_list[60] = envval; + if ((envval = getenv("OQS_ENCODING_FALCONPADDED512_ALGNAME"))) + oqs_alg_encoding_list[61] = envval; + if ((envval = getenv("OQS_ENCODING_P256_FALCONPADDED512"))) + oqs_alg_encoding_list[62] = envval; + if ((envval = getenv("OQS_ENCODING_P256_FALCONPADDED512_ALGNAME"))) + oqs_alg_encoding_list[63] = envval; + if ((envval = getenv("OQS_ENCODING_RSA3072_FALCONPADDED512"))) + oqs_alg_encoding_list[64] = envval; + if ((envval = getenv("OQS_ENCODING_RSA3072_FALCONPADDED512_ALGNAME"))) + oqs_alg_encoding_list[65] = envval; + if ((envval = getenv("OQS_ENCODING_FALCON1024"))) + oqs_alg_encoding_list[66] = envval; + if ((envval = getenv("OQS_ENCODING_FALCON1024_ALGNAME"))) + oqs_alg_encoding_list[67] = envval; + if ((envval = getenv("OQS_ENCODING_P521_FALCON1024"))) + oqs_alg_encoding_list[68] = envval; + if ((envval = getenv("OQS_ENCODING_P521_FALCON1024_ALGNAME"))) + oqs_alg_encoding_list[69] = envval; + if ((envval = getenv("OQS_ENCODING_FALCONPADDED1024"))) + oqs_alg_encoding_list[70] = envval; + if ((envval = getenv("OQS_ENCODING_FALCONPADDED1024_ALGNAME"))) + oqs_alg_encoding_list[71] = envval; + if ((envval = getenv("OQS_ENCODING_P521_FALCONPADDED1024"))) + oqs_alg_encoding_list[72] = envval; + if ((envval = getenv("OQS_ENCODING_P521_FALCONPADDED1024_ALGNAME"))) + oqs_alg_encoding_list[73] = envval; + if ((envval = getenv("OQS_ENCODING_SPHINCSSHA2128FSIMPLE"))) + oqs_alg_encoding_list[74] = envval; + if ((envval = getenv("OQS_ENCODING_SPHINCSSHA2128FSIMPLE_ALGNAME"))) + oqs_alg_encoding_list[75] = envval; + if ((envval = getenv("OQS_ENCODING_P256_SPHINCSSHA2128FSIMPLE"))) + oqs_alg_encoding_list[76] = envval; + if ((envval = + getenv("OQS_ENCODING_P256_SPHINCSSHA2128FSIMPLE_ALGNAME"))) + oqs_alg_encoding_list[77] = envval; + if ((envval = getenv("OQS_ENCODING_RSA3072_SPHINCSSHA2128FSIMPLE"))) + oqs_alg_encoding_list[78] = envval; + if ((envval = + getenv("OQS_ENCODING_RSA3072_SPHINCSSHA2128FSIMPLE_ALGNAME"))) + oqs_alg_encoding_list[79] = envval; + if ((envval = getenv("OQS_ENCODING_SPHINCSSHA2128SSIMPLE"))) + oqs_alg_encoding_list[80] = envval; + if ((envval = getenv("OQS_ENCODING_SPHINCSSHA2128SSIMPLE_ALGNAME"))) + oqs_alg_encoding_list[81] = envval; + if ((envval = getenv("OQS_ENCODING_P256_SPHINCSSHA2128SSIMPLE"))) + oqs_alg_encoding_list[82] = envval; + if ((envval = + getenv("OQS_ENCODING_P256_SPHINCSSHA2128SSIMPLE_ALGNAME"))) + oqs_alg_encoding_list[83] = envval; + if ((envval = getenv("OQS_ENCODING_RSA3072_SPHINCSSHA2128SSIMPLE"))) + oqs_alg_encoding_list[84] = envval; + if ((envval = + getenv("OQS_ENCODING_RSA3072_SPHINCSSHA2128SSIMPLE_ALGNAME"))) + oqs_alg_encoding_list[85] = envval; + if ((envval = getenv("OQS_ENCODING_SPHINCSSHA2192FSIMPLE"))) + oqs_alg_encoding_list[86] = envval; + if ((envval = getenv("OQS_ENCODING_SPHINCSSHA2192FSIMPLE_ALGNAME"))) + oqs_alg_encoding_list[87] = envval; + if ((envval = getenv("OQS_ENCODING_P384_SPHINCSSHA2192FSIMPLE"))) + oqs_alg_encoding_list[88] = envval; + if ((envval = + getenv("OQS_ENCODING_P384_SPHINCSSHA2192FSIMPLE_ALGNAME"))) + oqs_alg_encoding_list[89] = envval; + if ((envval = getenv("OQS_ENCODING_SPHINCSSHAKE128FSIMPLE"))) + oqs_alg_encoding_list[90] = envval; + if ((envval = getenv("OQS_ENCODING_SPHINCSSHAKE128FSIMPLE_ALGNAME"))) + oqs_alg_encoding_list[91] = envval; + if ((envval = getenv("OQS_ENCODING_P256_SPHINCSSHAKE128FSIMPLE"))) + oqs_alg_encoding_list[92] = envval; + if ((envval = + getenv("OQS_ENCODING_P256_SPHINCSSHAKE128FSIMPLE_ALGNAME"))) + oqs_alg_encoding_list[93] = envval; + if ((envval = getenv("OQS_ENCODING_RSA3072_SPHINCSSHAKE128FSIMPLE"))) + oqs_alg_encoding_list[94] = envval; + if ((envval = + getenv("OQS_ENCODING_RSA3072_SPHINCSSHAKE128FSIMPLE_ALGNAME"))) + oqs_alg_encoding_list[95] = envval; + if ((envval = getenv("OQS_ENCODING_MAYO1"))) + oqs_alg_encoding_list[96] = envval; + if ((envval = getenv("OQS_ENCODING_MAYO1_ALGNAME"))) + oqs_alg_encoding_list[97] = envval; + if ((envval = getenv("OQS_ENCODING_P256_MAYO1"))) + oqs_alg_encoding_list[98] = envval; + if ((envval = getenv("OQS_ENCODING_P256_MAYO1_ALGNAME"))) + oqs_alg_encoding_list[99] = envval; + if ((envval = getenv("OQS_ENCODING_MAYO2"))) + oqs_alg_encoding_list[100] = envval; + if ((envval = getenv("OQS_ENCODING_MAYO2_ALGNAME"))) + oqs_alg_encoding_list[101] = envval; + if ((envval = getenv("OQS_ENCODING_P256_MAYO2"))) + oqs_alg_encoding_list[102] = envval; + if ((envval = getenv("OQS_ENCODING_P256_MAYO2_ALGNAME"))) + oqs_alg_encoding_list[103] = envval; + if ((envval = getenv("OQS_ENCODING_MAYO3"))) + oqs_alg_encoding_list[104] = envval; + if ((envval = getenv("OQS_ENCODING_MAYO3_ALGNAME"))) + oqs_alg_encoding_list[105] = envval; + if ((envval = getenv("OQS_ENCODING_P384_MAYO3"))) + oqs_alg_encoding_list[106] = envval; + if ((envval = getenv("OQS_ENCODING_P384_MAYO3_ALGNAME"))) + oqs_alg_encoding_list[107] = envval; + if ((envval = getenv("OQS_ENCODING_MAYO5"))) + oqs_alg_encoding_list[108] = envval; + if ((envval = getenv("OQS_ENCODING_MAYO5_ALGNAME"))) + oqs_alg_encoding_list[109] = envval; + if ((envval = getenv("OQS_ENCODING_P521_MAYO5"))) + oqs_alg_encoding_list[110] = envval; + if ((envval = getenv("OQS_ENCODING_P521_MAYO5_ALGNAME"))) + oqs_alg_encoding_list[111] = envval; + if ((envval = getenv("OQS_ENCODING_CROSSRSDP128BALANCED"))) + oqs_alg_encoding_list[112] = envval; + if ((envval = getenv("OQS_ENCODING_CROSSRSDP128BALANCED_ALGNAME"))) + oqs_alg_encoding_list[113] = envval; + } + ///// OQS_TEMPLATE_FRAGMENT_ENCODING_PATCHING_END return 1; } #endif -#define SIGALG(NAMES, SECBITS, FUNC) \ - { \ - NAMES, "provider=oqsprovider,oqsprovider.security_bits=" #SECBITS "", \ - FUNC \ +#define SIGALG(NAMES, SECBITS, FUNC) \ + { \ + NAMES, "provider=oqsprovider,oqsprovider.security_bits=" #SECBITS "", \ + FUNC \ } -#define KEMBASEALG(NAMES, SECBITS) \ - {"" #NAMES "", \ - "provider=oqsprovider,oqsprovider.security_bits=" #SECBITS "", \ +#define KEMBASEALG(NAMES, SECBITS) \ + {"" #NAMES "", \ + "provider=oqsprovider,oqsprovider.security_bits=" #SECBITS "", \ oqs_generic_kem_functions}, -#define KEMHYBALG(NAMES, SECBITS) \ - {"" #NAMES "", \ - "provider=oqsprovider,oqsprovider.security_bits=" #SECBITS "", \ +#define KEMHYBALG(NAMES, SECBITS) \ + {"" #NAMES "", \ + "provider=oqsprovider,oqsprovider.security_bits=" #SECBITS "", \ oqs_hybrid_kem_functions}, -#define KEMKMALG(NAMES, SECBITS) \ - {"" #NAMES "", \ - "provider=oqsprovider,oqsprovider.security_bits=" #SECBITS "", \ +#define KEMKMALG(NAMES, SECBITS) \ + {"" #NAMES "", \ + "provider=oqsprovider,oqsprovider.security_bits=" #SECBITS "", \ oqs_##NAMES##_keymgmt_functions}, -#define KEMKMHYBALG(NAMES, SECBITS, HYBTYPE) \ - {"" #NAMES "", \ - "provider=oqsprovider,oqsprovider.security_bits=" #SECBITS "", \ +#define KEMKMHYBALG(NAMES, SECBITS, HYBTYPE) \ + {"" #NAMES "", \ + "provider=oqsprovider,oqsprovider.security_bits=" #SECBITS "", \ oqs_##HYBTYPE##_##NAMES##_keymgmt_functions}, /* Functions provided by the core */ @@ -481,12 +829,12 @@ static OSSL_FUNC_core_gettable_params_fn *c_gettable_params = NULL; static OSSL_FUNC_core_get_params_fn *c_get_params = NULL; /* Parameters we provide to the core */ -static const OSSL_PARAM oqsprovider_param_types[] - = {OSSL_PARAM_DEFN(OSSL_PROV_PARAM_NAME, OSSL_PARAM_UTF8_PTR, NULL, 0), - OSSL_PARAM_DEFN(OSSL_PROV_PARAM_VERSION, OSSL_PARAM_UTF8_PTR, NULL, 0), - OSSL_PARAM_DEFN(OSSL_PROV_PARAM_BUILDINFO, OSSL_PARAM_UTF8_PTR, NULL, 0), - OSSL_PARAM_DEFN(OSSL_PROV_PARAM_STATUS, OSSL_PARAM_INTEGER, NULL, 0), - OSSL_PARAM_END}; +static const OSSL_PARAM oqsprovider_param_types[] = { + OSSL_PARAM_DEFN(OSSL_PROV_PARAM_NAME, OSSL_PARAM_UTF8_PTR, NULL, 0), + OSSL_PARAM_DEFN(OSSL_PROV_PARAM_VERSION, OSSL_PARAM_UTF8_PTR, NULL, 0), + OSSL_PARAM_DEFN(OSSL_PROV_PARAM_BUILDINFO, OSSL_PARAM_UTF8_PTR, NULL, 0), + OSSL_PARAM_DEFN(OSSL_PROV_PARAM_STATUS, OSSL_PARAM_INTEGER, NULL, 0), + OSSL_PARAM_END}; static const OSSL_ALGORITHM oqsprovider_signatures[] = { ///// OQS_TEMPLATE_FRAGMENT_SIG_FUNCTIONS_START @@ -585,7 +933,7 @@ static const OSSL_ALGORITHM oqsprovider_signatures[] = { #ifdef OQS_ENABLE_SIG_cross_rsdp_128_balanced SIGALG("CROSSrsdp128balanced", 128, oqs_signature_functions), #endif -///// OQS_TEMPLATE_FRAGMENT_SIG_FUNCTIONS_END + ///// OQS_TEMPLATE_FRAGMENT_SIG_FUNCTIONS_END {NULL, NULL, NULL}}; static const OSSL_ALGORITHM oqsprovider_asym_kems[] = { @@ -680,12 +1028,11 @@ static const OSSL_ALGORITHM oqsprovider_asym_kems[] = { KEMBASEALG(hqc256, 256) KEMHYBALG(p521_hqc256, 256) #endif -// clang-format on -///// OQS_TEMPLATE_FRAGMENT_KEM_FUNCTIONS_END + // clang-format on + ///// OQS_TEMPLATE_FRAGMENT_KEM_FUNCTIONS_END {NULL, NULL, NULL}}; -static const OSSL_ALGORITHM oqsprovider_keymgmt[] - = { +static const OSSL_ALGORITHM oqsprovider_keymgmt[] = { ///// OQS_TEMPLATE_FRAGMENT_KEYMGMT_FUNCTIONS_START // clang-format off @@ -892,9 +1239,9 @@ static const OSSL_ALGORITHM oqsprovider_keymgmt[] KEMKMHYBALG(p521_hqc256, 256, ecp) #endif -// clang-format on -///// OQS_TEMPLATE_FRAGMENT_KEYMGMT_FUNCTIONS_END - {NULL, NULL, NULL}}; + // clang-format on + ///// OQS_TEMPLATE_FRAGMENT_KEYMGMT_FUNCTIONS_END + {NULL, NULL, NULL}}; static const OSSL_ALGORITHM oqsprovider_encoder[] = { #define ENCODER_PROVIDER "oqsprovider" @@ -911,8 +1258,7 @@ static const OSSL_ALGORITHM oqsprovider_decoder[] = { }; // get the last number on the composite OID -int get_composite_idx(int idx) -{ +int get_composite_idx(int idx) { char *s; int i, len, ret = -1, count = 0; @@ -936,25 +1282,23 @@ int get_composite_idx(int idx) return ret; } -static const OSSL_PARAM *oqsprovider_gettable_params(void *provctx) -{ +static const OSSL_PARAM *oqsprovider_gettable_params(void *provctx) { return oqsprovider_param_types; } -#define OQS_PROVIDER_BASE_BUILD_INFO_STR \ - "OQS Provider v." OQS_PROVIDER_VERSION_STR OQS_PROVIDER_COMMIT \ +#define OQS_PROVIDER_BASE_BUILD_INFO_STR \ + "OQS Provider v." OQS_PROVIDER_VERSION_STR OQS_PROVIDER_COMMIT \ " based on liboqs v." OQS_VERSION_TEXT #ifdef QSC_ENCODING_VERSION_STRING -# define OQS_PROVIDER_BUILD_INFO_STR \ - OQS_PROVIDER_BASE_BUILD_INFO_STR \ - " using qsc-key-encoder v." QSC_ENCODING_VERSION_STRING +#define OQS_PROVIDER_BUILD_INFO_STR \ + OQS_PROVIDER_BASE_BUILD_INFO_STR \ + " using qsc-key-encoder v." QSC_ENCODING_VERSION_STRING #else -# define OQS_PROVIDER_BUILD_INFO_STR OQS_PROVIDER_BASE_BUILD_INFO_STR +#define OQS_PROVIDER_BUILD_INFO_STR OQS_PROVIDER_BASE_BUILD_INFO_STR #endif -static int oqsprovider_get_params(void *provctx, OSSL_PARAM params[]) -{ +static int oqsprovider_get_params(void *provctx, OSSL_PARAM params[]) { OSSL_PARAM *p; p = OSSL_PARAM_locate(params, OSSL_PROV_PARAM_NAME); @@ -974,8 +1318,7 @@ static int oqsprovider_get_params(void *provctx, OSSL_PARAM params[]) } static const OSSL_ALGORITHM *oqsprovider_query(void *provctx, int operation_id, - int *no_cache) -{ + int *no_cache) { *no_cache = 0; switch (operation_id) { @@ -997,33 +1340,31 @@ static const OSSL_ALGORITHM *oqsprovider_query(void *provctx, int operation_id, return NULL; } -static void oqsprovider_teardown(void *provctx) -{ +static void oqsprovider_teardown(void *provctx) { oqsx_freeprovctx((PROV_OQS_CTX *)provctx); OQS_destroy(); } /* Functions we provide to the core */ -static const OSSL_DISPATCH oqsprovider_dispatch_table[] - = {{OSSL_FUNC_PROVIDER_TEARDOWN, (void (*)(void))oqsprovider_teardown}, - {OSSL_FUNC_PROVIDER_GETTABLE_PARAMS, - (void (*)(void))oqsprovider_gettable_params}, - {OSSL_FUNC_PROVIDER_GET_PARAMS, (void (*)(void))oqsprovider_get_params}, - {OSSL_FUNC_PROVIDER_QUERY_OPERATION, (void (*)(void))oqsprovider_query}, - {OSSL_FUNC_PROVIDER_GET_CAPABILITIES, - (void (*)(void))oqs_provider_get_capabilities}, - {0, NULL}}; +static const OSSL_DISPATCH oqsprovider_dispatch_table[] = { + {OSSL_FUNC_PROVIDER_TEARDOWN, (void (*)(void))oqsprovider_teardown}, + {OSSL_FUNC_PROVIDER_GETTABLE_PARAMS, + (void (*)(void))oqsprovider_gettable_params}, + {OSSL_FUNC_PROVIDER_GET_PARAMS, (void (*)(void))oqsprovider_get_params}, + {OSSL_FUNC_PROVIDER_QUERY_OPERATION, (void (*)(void))oqsprovider_query}, + {OSSL_FUNC_PROVIDER_GET_CAPABILITIES, + (void (*)(void))oqs_provider_get_capabilities}, + {0, NULL}}; #ifdef OQS_PROVIDER_STATIC -# define OQS_PROVIDER_ENTRYPOINT_NAME oqs_provider_init +#define OQS_PROVIDER_ENTRYPOINT_NAME oqs_provider_init #else -# define OQS_PROVIDER_ENTRYPOINT_NAME OSSL_provider_init +#define OQS_PROVIDER_ENTRYPOINT_NAME OSSL_provider_init #endif // ifdef OQS_PROVIDER_STATIC int OQS_PROVIDER_ENTRYPOINT_NAME(const OSSL_CORE_HANDLE *handle, const OSSL_DISPATCH *in, - const OSSL_DISPATCH **out, void **provctx) -{ + const OSSL_DISPATCH **out, void **provctx) { const OSSL_DISPATCH *orig_in = in; OSSL_FUNC_core_obj_create_fn *c_obj_create = NULL; @@ -1133,10 +1474,9 @@ int OQS_PROVIDER_ENTRYPOINT_NAME(const OSSL_CORE_HANDLE *handle, } // if libctx not yet existing, create a new one - if (((corebiometh = oqs_bio_prov_init_bio_method()) == NULL) - || ((libctx = OSSL_LIB_CTX_new_child(handle, orig_in)) == NULL) - || ((*provctx = oqsx_newprovctx(libctx, handle, corebiometh)) - == NULL)) { + if (((corebiometh = oqs_bio_prov_init_bio_method()) == NULL) || + ((libctx = OSSL_LIB_CTX_new_child(handle, orig_in)) == NULL) || + ((*provctx = oqsx_newprovctx(libctx, handle, corebiometh)) == NULL)) { OQS_PROV_PRINTF("OQS PROV: error creating new provider context\n"); ERR_raise(ERR_LIB_USER, OQSPROV_R_LIB_CREATE_ERR); goto end_init; @@ -1145,10 +1485,10 @@ int OQS_PROVIDER_ENTRYPOINT_NAME(const OSSL_CORE_HANDLE *handle, *out = oqsprovider_dispatch_table; // finally, warn if neither default nor fips provider are present: - if (!OSSL_PROVIDER_available(libctx, "default") - && !OSSL_PROVIDER_available(libctx, "fips")) { - OQS_PROV_PRINTF( - "OQS PROV: Default and FIPS provider not available. Errors may result.\n"); + if (!OSSL_PROVIDER_available(libctx, "default") && + !OSSL_PROVIDER_available(libctx, "fips")) { + OQS_PROV_PRINTF("OQS PROV: Default and FIPS provider not available. " + "Errors may result.\n"); } else { OQS_PROV_PRINTF("OQS PROV: Default or FIPS provider available.\n"); } diff --git a/oqsprov/oqsprov_bio.c b/oqsprov/oqsprov_bio.c index c40d0461..4123d6a5 100644 --- a/oqsprov/oqsprov_bio.c +++ b/oqsprov/oqsprov_bio.c @@ -17,8 +17,7 @@ static OSSL_FUNC_BIO_up_ref_fn *c_bio_up_ref = NULL; static OSSL_FUNC_BIO_free_fn *c_bio_free = NULL; static OSSL_FUNC_BIO_vprintf_fn *c_bio_vprintf = NULL; -int oqs_prov_bio_from_dispatch(const OSSL_DISPATCH *fns) -{ +int oqs_prov_bio_from_dispatch(const OSSL_DISPATCH *fns) { for (; fns->function_id != 0; fns++) { switch (fns->function_id) { case OSSL_FUNC_BIO_NEW_FILE: @@ -67,80 +66,69 @@ int oqs_prov_bio_from_dispatch(const OSSL_DISPATCH *fns) return 1; } -OSSL_CORE_BIO *oqs_prov_bio_new_file(const char *filename, const char *mode) -{ +OSSL_CORE_BIO *oqs_prov_bio_new_file(const char *filename, const char *mode) { if (c_bio_new_file == NULL) return NULL; return c_bio_new_file(filename, mode); } -OSSL_CORE_BIO *oqs_prov_bio_new_membuf(const char *filename, int len) -{ +OSSL_CORE_BIO *oqs_prov_bio_new_membuf(const char *filename, int len) { if (c_bio_new_membuf == NULL) return NULL; return c_bio_new_membuf(filename, len); } int oqs_prov_bio_read_ex(OSSL_CORE_BIO *bio, void *data, size_t data_len, - size_t *bytes_read) -{ + size_t *bytes_read) { if (c_bio_read_ex == NULL) return 0; return c_bio_read_ex(bio, data, data_len, bytes_read); } int oqs_prov_bio_write_ex(OSSL_CORE_BIO *bio, const void *data, size_t data_len, - size_t *written) -{ + size_t *written) { if (c_bio_write_ex == NULL) return 0; return c_bio_write_ex(bio, data, data_len, written); } -int oqs_prov_bio_gets(OSSL_CORE_BIO *bio, char *buf, int size) -{ +int oqs_prov_bio_gets(OSSL_CORE_BIO *bio, char *buf, int size) { if (c_bio_gets == NULL) return -1; return c_bio_gets(bio, buf, size); } -int oqs_prov_bio_puts(OSSL_CORE_BIO *bio, const char *str) -{ +int oqs_prov_bio_puts(OSSL_CORE_BIO *bio, const char *str) { if (c_bio_puts == NULL) return -1; return c_bio_puts(bio, str); } -int oqs_prov_bio_ctrl(OSSL_CORE_BIO *bio, int cmd, long num, void *ptr) -{ +int oqs_prov_bio_ctrl(OSSL_CORE_BIO *bio, int cmd, long num, void *ptr) { if (c_bio_ctrl == NULL) return -1; return c_bio_ctrl(bio, cmd, num, ptr); } -int oqs_prov_bio_up_ref(OSSL_CORE_BIO *bio) -{ +int oqs_prov_bio_up_ref(OSSL_CORE_BIO *bio) { if (c_bio_up_ref == NULL) return 0; return c_bio_up_ref(bio); } -int oqs_prov_bio_free(OSSL_CORE_BIO *bio) -{ +int oqs_prov_bio_free(OSSL_CORE_BIO *bio) { if (c_bio_free == NULL) return 0; return c_bio_free(bio); } -int oqs_prov_bio_vprintf(OSSL_CORE_BIO *bio, const char *format, va_list ap) -{ +int oqs_prov_bio_vprintf(OSSL_CORE_BIO *bio, const char *format, va_list ap) { if (c_bio_vprintf == NULL) return -1; return c_bio_vprintf(bio, format, ap); } -int oqs_prov_bio_printf(OSSL_CORE_BIO *bio, const char *format, ...) -{ +int oqs_prov_bio_printf(OSSL_CORE_BIO *bio, const char *format, ...) { va_list ap; int ret; @@ -156,60 +144,52 @@ int oqs_prov_bio_printf(OSSL_CORE_BIO *bio, const char *format, ...) /* No direct BIO support in the FIPS module */ static int bio_core_read_ex(BIO *bio, char *data, size_t data_len, - size_t *bytes_read) -{ + size_t *bytes_read) { return oqs_prov_bio_read_ex(BIO_get_data(bio), data, data_len, bytes_read); } static int bio_core_write_ex(BIO *bio, const char *data, size_t data_len, - size_t *written) -{ + size_t *written) { return oqs_prov_bio_write_ex(BIO_get_data(bio), data, data_len, written); } -static long bio_core_ctrl(BIO *bio, int cmd, long num, void *ptr) -{ +static long bio_core_ctrl(BIO *bio, int cmd, long num, void *ptr) { return oqs_prov_bio_ctrl(BIO_get_data(bio), cmd, num, ptr); } -static int bio_core_gets(BIO *bio, char *buf, int size) -{ +static int bio_core_gets(BIO *bio, char *buf, int size) { return oqs_prov_bio_gets(BIO_get_data(bio), buf, size); } -static int bio_core_puts(BIO *bio, const char *str) -{ +static int bio_core_puts(BIO *bio, const char *str) { return oqs_prov_bio_puts(BIO_get_data(bio), str); } -static int bio_core_new(BIO *bio) -{ +static int bio_core_new(BIO *bio) { BIO_set_init(bio, 1); return 1; } -static int bio_core_free(BIO *bio) -{ +static int bio_core_free(BIO *bio) { BIO_set_init(bio, 0); oqs_prov_bio_free(BIO_get_data(bio)); return 1; } -BIO_METHOD *oqs_bio_prov_init_bio_method(void) -{ +BIO_METHOD *oqs_bio_prov_init_bio_method(void) { BIO_METHOD *corebiometh = NULL; corebiometh = BIO_meth_new(BIO_TYPE_CORE_TO_PROV, "BIO to Core filter"); - if (corebiometh == NULL - || !BIO_meth_set_write_ex(corebiometh, bio_core_write_ex) - || !BIO_meth_set_read_ex(corebiometh, bio_core_read_ex) - || !BIO_meth_set_puts(corebiometh, bio_core_puts) - || !BIO_meth_set_gets(corebiometh, bio_core_gets) - || !BIO_meth_set_ctrl(corebiometh, bio_core_ctrl) - || !BIO_meth_set_create(corebiometh, bio_core_new) - || !BIO_meth_set_destroy(corebiometh, bio_core_free)) { + if (corebiometh == NULL || + !BIO_meth_set_write_ex(corebiometh, bio_core_write_ex) || + !BIO_meth_set_read_ex(corebiometh, bio_core_read_ex) || + !BIO_meth_set_puts(corebiometh, bio_core_puts) || + !BIO_meth_set_gets(corebiometh, bio_core_gets) || + !BIO_meth_set_ctrl(corebiometh, bio_core_ctrl) || + !BIO_meth_set_create(corebiometh, bio_core_new) || + !BIO_meth_set_destroy(corebiometh, bio_core_free)) { BIO_meth_free(corebiometh); return NULL; } @@ -217,8 +197,7 @@ BIO_METHOD *oqs_bio_prov_init_bio_method(void) return corebiometh; } -BIO *oqs_bio_new_from_core_bio(PROV_OQS_CTX *provctx, OSSL_CORE_BIO *corebio) -{ +BIO *oqs_bio_new_from_core_bio(PROV_OQS_CTX *provctx, OSSL_CORE_BIO *corebio) { BIO *outbio; BIO_METHOD *corebiometh = provctx->corebiometh; diff --git a/oqsprov/oqsprov_capabilities.c b/oqsprov/oqsprov_capabilities.c index 59667d3a..f650f7c8 100644 --- a/oqsprov/oqsprov_capabilities.c +++ b/oqsprov/oqsprov_capabilities.c @@ -35,104 +35,104 @@ typedef struct oqs_group_constants_st { static OQS_GROUP_CONSTANTS oqs_group_list[] = { // ad-hoc assignments - take from OQS generate data structures ///// OQS_TEMPLATE_FRAGMENT_GROUP_ASSIGNMENTS_START - { 0x0200, 128, TLS1_3_VERSION, 0, -1, -1, 1 }, + {0x0200, 128, TLS1_3_VERSION, 0, -1, -1, 1}, - { 0x2F00, 128, TLS1_3_VERSION, 0, -1, -1, 1 }, - { 0x2F80, 128, TLS1_3_VERSION, 0, -1, -1, 1 }, - { 0x0201, 128, TLS1_3_VERSION, 0, -1, -1, 1 }, + {0x2F00, 128, TLS1_3_VERSION, 0, -1, -1, 1}, + {0x2F80, 128, TLS1_3_VERSION, 0, -1, -1, 1}, + {0x0201, 128, TLS1_3_VERSION, 0, -1, -1, 1}, - { 0x2F01, 128, TLS1_3_VERSION, 0, -1, -1, 1 }, - { 0x2F81, 128, TLS1_3_VERSION, 0, -1, -1, 1 }, - { 0x0202, 192, TLS1_3_VERSION, 0, -1, -1, 1 }, + {0x2F01, 128, TLS1_3_VERSION, 0, -1, -1, 1}, + {0x2F81, 128, TLS1_3_VERSION, 0, -1, -1, 1}, + {0x0202, 192, TLS1_3_VERSION, 0, -1, -1, 1}, - { 0x2F02, 192, TLS1_3_VERSION, 0, -1, -1, 1 }, - { 0x2F82, 192, TLS1_3_VERSION, 0, -1, -1, 1 }, - { 0x0203, 192, TLS1_3_VERSION, 0, -1, -1, 1 }, + {0x2F02, 192, TLS1_3_VERSION, 0, -1, -1, 1}, + {0x2F82, 192, TLS1_3_VERSION, 0, -1, -1, 1}, + {0x0203, 192, TLS1_3_VERSION, 0, -1, -1, 1}, - { 0x2F03, 192, TLS1_3_VERSION, 0, -1, -1, 1 }, - { 0x2F83, 192, TLS1_3_VERSION, 0, -1, -1, 1 }, - { 0x0204, 256, TLS1_3_VERSION, 0, -1, -1, 1 }, + {0x2F03, 192, TLS1_3_VERSION, 0, -1, -1, 1}, + {0x2F83, 192, TLS1_3_VERSION, 0, -1, -1, 1}, + {0x0204, 256, TLS1_3_VERSION, 0, -1, -1, 1}, - { 0x2F04, 256, TLS1_3_VERSION, 0, -1, -1, 1 }, - { 0x0205, 256, TLS1_3_VERSION, 0, -1, -1, 1 }, + {0x2F04, 256, TLS1_3_VERSION, 0, -1, -1, 1}, + {0x0205, 256, TLS1_3_VERSION, 0, -1, -1, 1}, - { 0x2F05, 256, TLS1_3_VERSION, 0, -1, -1, 1 }, - { 0x023A, 128, TLS1_3_VERSION, 0, -1, -1, 1 }, + {0x2F05, 256, TLS1_3_VERSION, 0, -1, -1, 1}, + {0x023A, 128, TLS1_3_VERSION, 0, -1, -1, 1}, - { 0x2F3A, 128, TLS1_3_VERSION, 0, -1, -1, 1 }, - { 0x2F39, 128, TLS1_3_VERSION, 0, -1, -1, 1 }, - { 0x023C, 192, TLS1_3_VERSION, 0, -1, -1, 1 }, + {0x2F3A, 128, TLS1_3_VERSION, 0, -1, -1, 1}, + {0x2F39, 128, TLS1_3_VERSION, 0, -1, -1, 1}, + {0x023C, 192, TLS1_3_VERSION, 0, -1, -1, 1}, - { 0x2F3C, 192, TLS1_3_VERSION, 0, -1, -1, 1 }, - { 0x2F90, 192, TLS1_3_VERSION, 0, -1, -1, 1 }, - { 0x6399, 192, TLS1_3_VERSION, 0, -1, -1, 1 }, - { 0x639A, 192, TLS1_3_VERSION, 0, -1, -1, 1 }, - { 0x023D, 256, TLS1_3_VERSION, 0, -1, -1, 1 }, + {0x2F3C, 192, TLS1_3_VERSION, 0, -1, -1, 1}, + {0x2F90, 192, TLS1_3_VERSION, 0, -1, -1, 1}, + {0x6399, 192, TLS1_3_VERSION, 0, -1, -1, 1}, + {0x639A, 192, TLS1_3_VERSION, 0, -1, -1, 1}, + {0x023D, 256, TLS1_3_VERSION, 0, -1, -1, 1}, - { 0x2F3D, 256, TLS1_3_VERSION, 0, -1, -1, 1 }, - { 0x0247, 128, TLS1_3_VERSION, 0, -1, -1, 1 }, + {0x2F3D, 256, TLS1_3_VERSION, 0, -1, -1, 1}, + {0x0247, 128, TLS1_3_VERSION, 0, -1, -1, 1}, - { 0x2F47, 128, TLS1_3_VERSION, 0, -1, -1, 1 }, - { 0x2FB2, 128, TLS1_3_VERSION, 0, -1, -1, 1 }, - { 0x0248, 192, TLS1_3_VERSION, 0, -1, -1, 1 }, + {0x2F47, 128, TLS1_3_VERSION, 0, -1, -1, 1}, + {0x2FB2, 128, TLS1_3_VERSION, 0, -1, -1, 1}, + {0x0248, 192, TLS1_3_VERSION, 0, -1, -1, 1}, - { 0x2F48, 192, TLS1_3_VERSION, 0, -1, -1, 1 }, - { 0x2FB3, 192, TLS1_3_VERSION, 0, -1, -1, 1 }, - { 0x2FB4, 192, TLS1_3_VERSION, 0, -1, -1, 1 }, - { 0x2FB5, 192, TLS1_3_VERSION, 0, -1, -1, 1 }, - { 0x0249, 256, TLS1_3_VERSION, 0, -1, -1, 1 }, + {0x2F48, 192, TLS1_3_VERSION, 0, -1, -1, 1}, + {0x2FB3, 192, TLS1_3_VERSION, 0, -1, -1, 1}, + {0x2FB4, 192, TLS1_3_VERSION, 0, -1, -1, 1}, + {0x2FB5, 192, TLS1_3_VERSION, 0, -1, -1, 1}, + {0x0249, 256, TLS1_3_VERSION, 0, -1, -1, 1}, - { 0x2F49, 256, TLS1_3_VERSION, 0, -1, -1, 1 }, - { 0x2F4A, 256, TLS1_3_VERSION, 0, -1, -1, 1 }, - { 0x0241, 128, TLS1_3_VERSION, 0, -1, -1, 1 }, + {0x2F49, 256, TLS1_3_VERSION, 0, -1, -1, 1}, + {0x2F4A, 256, TLS1_3_VERSION, 0, -1, -1, 1}, + {0x0241, 128, TLS1_3_VERSION, 0, -1, -1, 1}, - { 0x2F41, 128, TLS1_3_VERSION, 0, -1, -1, 1 }, - { 0x2FAE, 128, TLS1_3_VERSION, 0, -1, -1, 1 }, - { 0x0242, 192, TLS1_3_VERSION, 0, -1, -1, 1 }, + {0x2F41, 128, TLS1_3_VERSION, 0, -1, -1, 1}, + {0x2FAE, 128, TLS1_3_VERSION, 0, -1, -1, 1}, + {0x0242, 192, TLS1_3_VERSION, 0, -1, -1, 1}, - { 0x2F42, 192, TLS1_3_VERSION, 0, -1, -1, 1 }, - { 0x2FAF, 192, TLS1_3_VERSION, 0, -1, -1, 1 }, - { 0x0243, 256, TLS1_3_VERSION, 0, -1, -1, 1 }, + {0x2F42, 192, TLS1_3_VERSION, 0, -1, -1, 1}, + {0x2FAF, 192, TLS1_3_VERSION, 0, -1, -1, 1}, + {0x0243, 256, TLS1_3_VERSION, 0, -1, -1, 1}, - { 0x2F43, 256, TLS1_3_VERSION, 0, -1, -1, 1 }, - { 0x0244, 128, TLS1_3_VERSION, 0, -1, -1, 1 }, + {0x2F43, 256, TLS1_3_VERSION, 0, -1, -1, 1}, + {0x0244, 128, TLS1_3_VERSION, 0, -1, -1, 1}, - { 0x2F44, 128, TLS1_3_VERSION, 0, -1, -1, 1 }, - { 0x2FB0, 128, TLS1_3_VERSION, 0, -1, -1, 1 }, - { 0x0245, 192, TLS1_3_VERSION, 0, -1, -1, 1 }, + {0x2F44, 128, TLS1_3_VERSION, 0, -1, -1, 1}, + {0x2FB0, 128, TLS1_3_VERSION, 0, -1, -1, 1}, + {0x0245, 192, TLS1_3_VERSION, 0, -1, -1, 1}, - { 0x2F45, 192, TLS1_3_VERSION, 0, -1, -1, 1 }, - { 0x2FB1, 192, TLS1_3_VERSION, 0, -1, -1, 1 }, - { 0x0246, 256, TLS1_3_VERSION, 0, -1, -1, 1 }, + {0x2F45, 192, TLS1_3_VERSION, 0, -1, -1, 1}, + {0x2FB1, 192, TLS1_3_VERSION, 0, -1, -1, 1}, + {0x0246, 256, TLS1_3_VERSION, 0, -1, -1, 1}, - { 0x2F46, 256, TLS1_3_VERSION, 0, -1, -1, 1 }, -///// OQS_TEMPLATE_FRAGMENT_GROUP_ASSIGNMENTS_END + {0x2F46, 256, TLS1_3_VERSION, 0, -1, -1, 1}, + ///// OQS_TEMPLATE_FRAGMENT_GROUP_ASSIGNMENTS_END }; // Adds entries for tlsname, `ecx`_tlsname and `ecp`_tlsname -#define OQS_GROUP_ENTRY(tlsname, realname, algorithm, idx) \ - { \ - OSSL_PARAM_utf8_string(OSSL_CAPABILITY_TLS_GROUP_NAME, #tlsname, \ - sizeof(#tlsname)), \ - OSSL_PARAM_utf8_string(OSSL_CAPABILITY_TLS_GROUP_NAME_INTERNAL, \ - #realname, sizeof(#realname)), \ - OSSL_PARAM_utf8_string(OSSL_CAPABILITY_TLS_GROUP_ALG, #algorithm, \ - sizeof(#algorithm)), \ - OSSL_PARAM_uint(OSSL_CAPABILITY_TLS_GROUP_ID, \ - (unsigned int *)&oqs_group_list[idx].group_id), \ - OSSL_PARAM_uint(OSSL_CAPABILITY_TLS_GROUP_SECURITY_BITS, \ - (unsigned int *)&oqs_group_list[idx].secbits), \ - OSSL_PARAM_int(OSSL_CAPABILITY_TLS_GROUP_MIN_TLS, \ - (unsigned int *)&oqs_group_list[idx].mintls), \ - OSSL_PARAM_int(OSSL_CAPABILITY_TLS_GROUP_MAX_TLS, \ - (unsigned int *)&oqs_group_list[idx].maxtls), \ - OSSL_PARAM_int(OSSL_CAPABILITY_TLS_GROUP_MIN_DTLS, \ - (unsigned int *)&oqs_group_list[idx].mindtls), \ - OSSL_PARAM_int(OSSL_CAPABILITY_TLS_GROUP_MAX_DTLS, \ - (unsigned int *)&oqs_group_list[idx].maxdtls), \ - OSSL_PARAM_int(OSSL_CAPABILITY_TLS_GROUP_IS_KEM, \ - (unsigned int *)&oqs_group_list[idx].is_kem), \ - OSSL_PARAM_END \ +#define OQS_GROUP_ENTRY(tlsname, realname, algorithm, idx) \ + { \ + OSSL_PARAM_utf8_string(OSSL_CAPABILITY_TLS_GROUP_NAME, #tlsname, \ + sizeof(#tlsname)), \ + OSSL_PARAM_utf8_string(OSSL_CAPABILITY_TLS_GROUP_NAME_INTERNAL, \ + #realname, sizeof(#realname)), \ + OSSL_PARAM_utf8_string(OSSL_CAPABILITY_TLS_GROUP_ALG, #algorithm, \ + sizeof(#algorithm)), \ + OSSL_PARAM_uint(OSSL_CAPABILITY_TLS_GROUP_ID, \ + (unsigned int *)&oqs_group_list[idx].group_id), \ + OSSL_PARAM_uint(OSSL_CAPABILITY_TLS_GROUP_SECURITY_BITS, \ + (unsigned int *)&oqs_group_list[idx].secbits), \ + OSSL_PARAM_int(OSSL_CAPABILITY_TLS_GROUP_MIN_TLS, \ + (unsigned int *)&oqs_group_list[idx].mintls), \ + OSSL_PARAM_int(OSSL_CAPABILITY_TLS_GROUP_MAX_TLS, \ + (unsigned int *)&oqs_group_list[idx].maxtls), \ + OSSL_PARAM_int(OSSL_CAPABILITY_TLS_GROUP_MIN_DTLS, \ + (unsigned int *)&oqs_group_list[idx].mindtls), \ + OSSL_PARAM_int(OSSL_CAPABILITY_TLS_GROUP_MAX_DTLS, \ + (unsigned int *)&oqs_group_list[idx].maxdtls), \ + OSSL_PARAM_int(OSSL_CAPABILITY_TLS_GROUP_IS_KEM, \ + (unsigned int *)&oqs_group_list[idx].is_kem), \ + OSSL_PARAM_END \ } static const OSSL_PARAM oqs_param_group_list[][11] = { @@ -142,13 +142,16 @@ static const OSSL_PARAM oqs_param_group_list[][11] = { OQS_GROUP_ENTRY(frodo640aes, frodo640aes, frodo640aes, 0), OQS_GROUP_ENTRY(p256_frodo640aes, p256_frodo640aes, p256_frodo640aes, 1), - OQS_GROUP_ENTRY(x25519_frodo640aes, x25519_frodo640aes, x25519_frodo640aes, 2), + OQS_GROUP_ENTRY(x25519_frodo640aes, x25519_frodo640aes, x25519_frodo640aes, + 2), #endif #ifdef OQS_ENABLE_KEM_frodokem_640_shake OQS_GROUP_ENTRY(frodo640shake, frodo640shake, frodo640shake, 3), - OQS_GROUP_ENTRY(p256_frodo640shake, p256_frodo640shake, p256_frodo640shake, 4), - OQS_GROUP_ENTRY(x25519_frodo640shake, x25519_frodo640shake, x25519_frodo640shake, 5), + OQS_GROUP_ENTRY(p256_frodo640shake, p256_frodo640shake, p256_frodo640shake, + 4), + OQS_GROUP_ENTRY(x25519_frodo640shake, x25519_frodo640shake, + x25519_frodo640shake, 5), #endif #ifdef OQS_ENABLE_KEM_frodokem_976_aes OQS_GROUP_ENTRY(frodo976aes, frodo976aes, frodo976aes, 6), @@ -159,18 +162,22 @@ static const OSSL_PARAM oqs_param_group_list[][11] = { #ifdef OQS_ENABLE_KEM_frodokem_976_shake OQS_GROUP_ENTRY(frodo976shake, frodo976shake, frodo976shake, 9), - OQS_GROUP_ENTRY(p384_frodo976shake, p384_frodo976shake, p384_frodo976shake, 10), - OQS_GROUP_ENTRY(x448_frodo976shake, x448_frodo976shake, x448_frodo976shake, 11), + OQS_GROUP_ENTRY(p384_frodo976shake, p384_frodo976shake, p384_frodo976shake, + 10), + OQS_GROUP_ENTRY(x448_frodo976shake, x448_frodo976shake, x448_frodo976shake, + 11), #endif #ifdef OQS_ENABLE_KEM_frodokem_1344_aes OQS_GROUP_ENTRY(frodo1344aes, frodo1344aes, frodo1344aes, 12), - OQS_GROUP_ENTRY(p521_frodo1344aes, p521_frodo1344aes, p521_frodo1344aes, 13), + OQS_GROUP_ENTRY(p521_frodo1344aes, p521_frodo1344aes, p521_frodo1344aes, + 13), #endif #ifdef OQS_ENABLE_KEM_frodokem_1344_shake OQS_GROUP_ENTRY(frodo1344shake, frodo1344shake, frodo1344shake, 14), - OQS_GROUP_ENTRY(p521_frodo1344shake, p521_frodo1344shake, p521_frodo1344shake, 15), + OQS_GROUP_ENTRY(p521_frodo1344shake, p521_frodo1344shake, + p521_frodo1344shake, 15), #endif #ifdef OQS_ENABLE_KEM_kyber_512 OQS_GROUP_ENTRY(kyber512, kyber512, kyber512, 16), @@ -245,7 +252,7 @@ static const OSSL_PARAM oqs_param_group_list[][11] = { OQS_GROUP_ENTRY(p521_hqc256, p521_hqc256, p521_hqc256, 52), #endif -///// OQS_TEMPLATE_FRAGMENT_GROUP_NAMES_END + ///// OQS_TEMPLATE_FRAGMENT_GROUP_NAMES_END }; typedef struct oqs_sigalg_constants_st { @@ -258,187 +265,348 @@ typedef struct oqs_sigalg_constants_st { static OQS_SIGALG_CONSTANTS oqs_sigalg_list[] = { // ad-hoc assignments - take from OQS generate data structures ///// OQS_TEMPLATE_FRAGMENT_SIGALG_ASSIGNMENTS_START - { 0xfea0, 128, TLS1_3_VERSION, 0 }, - { 0xfea1, 128, TLS1_3_VERSION, 0 }, - { 0xfea2, 128, TLS1_3_VERSION, 0 }, - { 0xfea3, 192, TLS1_3_VERSION, 0 }, - { 0xfea4, 192, TLS1_3_VERSION, 0 }, - { 0xfea5, 256, TLS1_3_VERSION, 0 }, - { 0xfea6, 256, TLS1_3_VERSION, 0 }, - { 0xfed0, 128, TLS1_3_VERSION, 0 }, - { 0xfed3, 128, TLS1_3_VERSION, 0 }, - { 0xfed4, 128, TLS1_3_VERSION, 0 }, - { 0xfee1, 128, TLS1_3_VERSION, 0 }, - { 0xfee2, 128, TLS1_3_VERSION, 0 }, - { 0xfee3, 128, TLS1_3_VERSION, 0 }, - { 0xfee4, 128, TLS1_3_VERSION, 0 }, - { 0xfee5, 128, TLS1_3_VERSION, 0 }, - { 0xfed1, 192, TLS1_3_VERSION, 0 }, - { 0xfed5, 192, TLS1_3_VERSION, 0 }, - { 0xfee6, 192, TLS1_3_VERSION, 0 }, - { 0xfee7, 192, TLS1_3_VERSION, 0 }, - { 0xfee8, 192, TLS1_3_VERSION, 0 }, - { 0xfee9, 192, TLS1_3_VERSION, 0 }, - { 0xfeea, 192, TLS1_3_VERSION, 0 }, - { 0xfed2, 256, TLS1_3_VERSION, 0 }, - { 0xfed6, 256, TLS1_3_VERSION, 0 }, - { 0xfeeb, 256, TLS1_3_VERSION, 0 }, - { 0xfeec, 256, TLS1_3_VERSION, 0 }, - { 0xfeed, 256, TLS1_3_VERSION, 0 }, - { 0xfed7, 128, TLS1_3_VERSION, 0 }, - { 0xfed8, 128, TLS1_3_VERSION, 0 }, - { 0xfed9, 128, TLS1_3_VERSION, 0 }, - { 0xfedc, 128, TLS1_3_VERSION, 0 }, - { 0xfedd, 128, TLS1_3_VERSION, 0 }, - { 0xfede, 128, TLS1_3_VERSION, 0 }, - { 0xfeda, 256, TLS1_3_VERSION, 0 }, - { 0xfedb, 256, TLS1_3_VERSION, 0 }, - { 0xfedf, 256, TLS1_3_VERSION, 0 }, - { 0xfee0, 256, TLS1_3_VERSION, 0 }, - { 0xfeb3, 128, TLS1_3_VERSION, 0 }, - { 0xfeb4, 128, TLS1_3_VERSION, 0 }, - { 0xfeb5, 128, TLS1_3_VERSION, 0 }, - { 0xfeb6, 128, TLS1_3_VERSION, 0 }, - { 0xfeb7, 128, TLS1_3_VERSION, 0 }, - { 0xfeb8, 128, TLS1_3_VERSION, 0 }, - { 0xfeb9, 192, TLS1_3_VERSION, 0 }, - { 0xfeba, 192, TLS1_3_VERSION, 0 }, - { 0xfec2, 128, TLS1_3_VERSION, 0 }, - { 0xfec3, 128, TLS1_3_VERSION, 0 }, - { 0xfec4, 128, TLS1_3_VERSION, 0 }, - { 0xfeee, 128, TLS1_3_VERSION, 0 }, - { 0xfef2, 128, TLS1_3_VERSION, 0 }, - { 0xfeef, 128, TLS1_3_VERSION, 0 }, - { 0xfef3, 128, TLS1_3_VERSION, 0 }, - { 0xfef0, 192, TLS1_3_VERSION, 0 }, - { 0xfef4, 192, TLS1_3_VERSION, 0 }, - { 0xfef1, 256, TLS1_3_VERSION, 0 }, - { 0xfef5, 256, TLS1_3_VERSION, 0 }, - { 0xfef6, 128, TLS1_3_VERSION, 0 }, -///// OQS_TEMPLATE_FRAGMENT_SIGALG_ASSIGNMENTS_END + {0xfea0, 128, TLS1_3_VERSION, 0}, {0xfea1, 128, TLS1_3_VERSION, 0}, + {0xfea2, 128, TLS1_3_VERSION, 0}, {0xfea3, 192, TLS1_3_VERSION, 0}, + {0xfea4, 192, TLS1_3_VERSION, 0}, {0xfea5, 256, TLS1_3_VERSION, 0}, + {0xfea6, 256, TLS1_3_VERSION, 0}, {0xfed0, 128, TLS1_3_VERSION, 0}, + {0xfed3, 128, TLS1_3_VERSION, 0}, {0xfed4, 128, TLS1_3_VERSION, 0}, + {0xfee1, 128, TLS1_3_VERSION, 0}, {0xfee2, 128, TLS1_3_VERSION, 0}, + {0xfee3, 128, TLS1_3_VERSION, 0}, {0xfee4, 128, TLS1_3_VERSION, 0}, + {0xfee5, 128, TLS1_3_VERSION, 0}, {0xfed1, 192, TLS1_3_VERSION, 0}, + {0xfed5, 192, TLS1_3_VERSION, 0}, {0xfee6, 192, TLS1_3_VERSION, 0}, + {0xfee7, 192, TLS1_3_VERSION, 0}, {0xfee8, 192, TLS1_3_VERSION, 0}, + {0xfee9, 192, TLS1_3_VERSION, 0}, {0xfeea, 192, TLS1_3_VERSION, 0}, + {0xfed2, 256, TLS1_3_VERSION, 0}, {0xfed6, 256, TLS1_3_VERSION, 0}, + {0xfeeb, 256, TLS1_3_VERSION, 0}, {0xfeec, 256, TLS1_3_VERSION, 0}, + {0xfeed, 256, TLS1_3_VERSION, 0}, {0xfed7, 128, TLS1_3_VERSION, 0}, + {0xfed8, 128, TLS1_3_VERSION, 0}, {0xfed9, 128, TLS1_3_VERSION, 0}, + {0xfedc, 128, TLS1_3_VERSION, 0}, {0xfedd, 128, TLS1_3_VERSION, 0}, + {0xfede, 128, TLS1_3_VERSION, 0}, {0xfeda, 256, TLS1_3_VERSION, 0}, + {0xfedb, 256, TLS1_3_VERSION, 0}, {0xfedf, 256, TLS1_3_VERSION, 0}, + {0xfee0, 256, TLS1_3_VERSION, 0}, {0xfeb3, 128, TLS1_3_VERSION, 0}, + {0xfeb4, 128, TLS1_3_VERSION, 0}, {0xfeb5, 128, TLS1_3_VERSION, 0}, + {0xfeb6, 128, TLS1_3_VERSION, 0}, {0xfeb7, 128, TLS1_3_VERSION, 0}, + {0xfeb8, 128, TLS1_3_VERSION, 0}, {0xfeb9, 192, TLS1_3_VERSION, 0}, + {0xfeba, 192, TLS1_3_VERSION, 0}, {0xfec2, 128, TLS1_3_VERSION, 0}, + {0xfec3, 128, TLS1_3_VERSION, 0}, {0xfec4, 128, TLS1_3_VERSION, 0}, + {0xfeee, 128, TLS1_3_VERSION, 0}, {0xfef2, 128, TLS1_3_VERSION, 0}, + {0xfeef, 128, TLS1_3_VERSION, 0}, {0xfef3, 128, TLS1_3_VERSION, 0}, + {0xfef0, 192, TLS1_3_VERSION, 0}, {0xfef4, 192, TLS1_3_VERSION, 0}, + {0xfef1, 256, TLS1_3_VERSION, 0}, {0xfef5, 256, TLS1_3_VERSION, 0}, + {0xfef6, 128, TLS1_3_VERSION, 0}, + ///// OQS_TEMPLATE_FRAGMENT_SIGALG_ASSIGNMENTS_END }; -int oqs_patch_codepoints() -{ +int oqs_patch_codepoints() { ///// OQS_TEMPLATE_FRAGMENT_CODEPOINT_PATCHING_START - if (getenv("OQS_CODEPOINT_FRODO640AES")) oqs_group_list[0].group_id = atoi(getenv("OQS_CODEPOINT_FRODO640AES")); - if (getenv("OQS_CODEPOINT_P256_FRODO640AES")) oqs_group_list[1].group_id = atoi(getenv("OQS_CODEPOINT_P256_FRODO640AES")); - if (getenv("OQS_CODEPOINT_X25519_FRODO640AES")) oqs_group_list[2].group_id = atoi(getenv("OQS_CODEPOINT_X25519_FRODO640AES")); - if (getenv("OQS_CODEPOINT_FRODO640SHAKE")) oqs_group_list[3].group_id = atoi(getenv("OQS_CODEPOINT_FRODO640SHAKE")); - if (getenv("OQS_CODEPOINT_P256_FRODO640SHAKE")) oqs_group_list[4].group_id = atoi(getenv("OQS_CODEPOINT_P256_FRODO640SHAKE")); - if (getenv("OQS_CODEPOINT_X25519_FRODO640SHAKE")) oqs_group_list[5].group_id = atoi(getenv("OQS_CODEPOINT_X25519_FRODO640SHAKE")); - if (getenv("OQS_CODEPOINT_FRODO976AES")) oqs_group_list[6].group_id = atoi(getenv("OQS_CODEPOINT_FRODO976AES")); - if (getenv("OQS_CODEPOINT_P384_FRODO976AES")) oqs_group_list[7].group_id = atoi(getenv("OQS_CODEPOINT_P384_FRODO976AES")); - if (getenv("OQS_CODEPOINT_X448_FRODO976AES")) oqs_group_list[8].group_id = atoi(getenv("OQS_CODEPOINT_X448_FRODO976AES")); - if (getenv("OQS_CODEPOINT_FRODO976SHAKE")) oqs_group_list[9].group_id = atoi(getenv("OQS_CODEPOINT_FRODO976SHAKE")); - if (getenv("OQS_CODEPOINT_P384_FRODO976SHAKE")) oqs_group_list[10].group_id = atoi(getenv("OQS_CODEPOINT_P384_FRODO976SHAKE")); - if (getenv("OQS_CODEPOINT_X448_FRODO976SHAKE")) oqs_group_list[11].group_id = atoi(getenv("OQS_CODEPOINT_X448_FRODO976SHAKE")); - if (getenv("OQS_CODEPOINT_FRODO1344AES")) oqs_group_list[12].group_id = atoi(getenv("OQS_CODEPOINT_FRODO1344AES")); - if (getenv("OQS_CODEPOINT_P521_FRODO1344AES")) oqs_group_list[13].group_id = atoi(getenv("OQS_CODEPOINT_P521_FRODO1344AES")); - if (getenv("OQS_CODEPOINT_FRODO1344SHAKE")) oqs_group_list[14].group_id = atoi(getenv("OQS_CODEPOINT_FRODO1344SHAKE")); - if (getenv("OQS_CODEPOINT_P521_FRODO1344SHAKE")) oqs_group_list[15].group_id = atoi(getenv("OQS_CODEPOINT_P521_FRODO1344SHAKE")); - if (getenv("OQS_CODEPOINT_KYBER512")) oqs_group_list[16].group_id = atoi(getenv("OQS_CODEPOINT_KYBER512")); - if (getenv("OQS_CODEPOINT_P256_KYBER512")) oqs_group_list[17].group_id = atoi(getenv("OQS_CODEPOINT_P256_KYBER512")); - if (getenv("OQS_CODEPOINT_X25519_KYBER512")) oqs_group_list[18].group_id = atoi(getenv("OQS_CODEPOINT_X25519_KYBER512")); - if (getenv("OQS_CODEPOINT_KYBER768")) oqs_group_list[19].group_id = atoi(getenv("OQS_CODEPOINT_KYBER768")); - if (getenv("OQS_CODEPOINT_P384_KYBER768")) oqs_group_list[20].group_id = atoi(getenv("OQS_CODEPOINT_P384_KYBER768")); - if (getenv("OQS_CODEPOINT_X448_KYBER768")) oqs_group_list[21].group_id = atoi(getenv("OQS_CODEPOINT_X448_KYBER768")); - if (getenv("OQS_CODEPOINT_X25519_KYBER768")) oqs_group_list[22].group_id = atoi(getenv("OQS_CODEPOINT_X25519_KYBER768")); - if (getenv("OQS_CODEPOINT_P256_KYBER768")) oqs_group_list[23].group_id = atoi(getenv("OQS_CODEPOINT_P256_KYBER768")); - if (getenv("OQS_CODEPOINT_KYBER1024")) oqs_group_list[24].group_id = atoi(getenv("OQS_CODEPOINT_KYBER1024")); - if (getenv("OQS_CODEPOINT_P521_KYBER1024")) oqs_group_list[25].group_id = atoi(getenv("OQS_CODEPOINT_P521_KYBER1024")); - if (getenv("OQS_CODEPOINT_MLKEM512")) oqs_group_list[26].group_id = atoi(getenv("OQS_CODEPOINT_MLKEM512")); - if (getenv("OQS_CODEPOINT_P256_MLKEM512")) oqs_group_list[27].group_id = atoi(getenv("OQS_CODEPOINT_P256_MLKEM512")); - if (getenv("OQS_CODEPOINT_X25519_MLKEM512")) oqs_group_list[28].group_id = atoi(getenv("OQS_CODEPOINT_X25519_MLKEM512")); - if (getenv("OQS_CODEPOINT_MLKEM768")) oqs_group_list[29].group_id = atoi(getenv("OQS_CODEPOINT_MLKEM768")); - if (getenv("OQS_CODEPOINT_P384_MLKEM768")) oqs_group_list[30].group_id = atoi(getenv("OQS_CODEPOINT_P384_MLKEM768")); - if (getenv("OQS_CODEPOINT_X448_MLKEM768")) oqs_group_list[31].group_id = atoi(getenv("OQS_CODEPOINT_X448_MLKEM768")); - if (getenv("OQS_CODEPOINT_X25519_MLKEM768")) oqs_group_list[32].group_id = atoi(getenv("OQS_CODEPOINT_X25519_MLKEM768")); - if (getenv("OQS_CODEPOINT_P256_MLKEM768")) oqs_group_list[33].group_id = atoi(getenv("OQS_CODEPOINT_P256_MLKEM768")); - if (getenv("OQS_CODEPOINT_MLKEM1024")) oqs_group_list[34].group_id = atoi(getenv("OQS_CODEPOINT_MLKEM1024")); - if (getenv("OQS_CODEPOINT_P521_MLKEM1024")) oqs_group_list[35].group_id = atoi(getenv("OQS_CODEPOINT_P521_MLKEM1024")); - if (getenv("OQS_CODEPOINT_P384_MLKEM1024")) oqs_group_list[36].group_id = atoi(getenv("OQS_CODEPOINT_P384_MLKEM1024")); - if (getenv("OQS_CODEPOINT_BIKEL1")) oqs_group_list[37].group_id = atoi(getenv("OQS_CODEPOINT_BIKEL1")); - if (getenv("OQS_CODEPOINT_P256_BIKEL1")) oqs_group_list[38].group_id = atoi(getenv("OQS_CODEPOINT_P256_BIKEL1")); - if (getenv("OQS_CODEPOINT_X25519_BIKEL1")) oqs_group_list[39].group_id = atoi(getenv("OQS_CODEPOINT_X25519_BIKEL1")); - if (getenv("OQS_CODEPOINT_BIKEL3")) oqs_group_list[40].group_id = atoi(getenv("OQS_CODEPOINT_BIKEL3")); - if (getenv("OQS_CODEPOINT_P384_BIKEL3")) oqs_group_list[41].group_id = atoi(getenv("OQS_CODEPOINT_P384_BIKEL3")); - if (getenv("OQS_CODEPOINT_X448_BIKEL3")) oqs_group_list[42].group_id = atoi(getenv("OQS_CODEPOINT_X448_BIKEL3")); - if (getenv("OQS_CODEPOINT_BIKEL5")) oqs_group_list[43].group_id = atoi(getenv("OQS_CODEPOINT_BIKEL5")); - if (getenv("OQS_CODEPOINT_P521_BIKEL5")) oqs_group_list[44].group_id = atoi(getenv("OQS_CODEPOINT_P521_BIKEL5")); - if (getenv("OQS_CODEPOINT_HQC128")) oqs_group_list[45].group_id = atoi(getenv("OQS_CODEPOINT_HQC128")); - if (getenv("OQS_CODEPOINT_P256_HQC128")) oqs_group_list[46].group_id = atoi(getenv("OQS_CODEPOINT_P256_HQC128")); - if (getenv("OQS_CODEPOINT_X25519_HQC128")) oqs_group_list[47].group_id = atoi(getenv("OQS_CODEPOINT_X25519_HQC128")); - if (getenv("OQS_CODEPOINT_HQC192")) oqs_group_list[48].group_id = atoi(getenv("OQS_CODEPOINT_HQC192")); - if (getenv("OQS_CODEPOINT_P384_HQC192")) oqs_group_list[49].group_id = atoi(getenv("OQS_CODEPOINT_P384_HQC192")); - if (getenv("OQS_CODEPOINT_X448_HQC192")) oqs_group_list[50].group_id = atoi(getenv("OQS_CODEPOINT_X448_HQC192")); - if (getenv("OQS_CODEPOINT_HQC256")) oqs_group_list[51].group_id = atoi(getenv("OQS_CODEPOINT_HQC256")); - if (getenv("OQS_CODEPOINT_P521_HQC256")) oqs_group_list[52].group_id = atoi(getenv("OQS_CODEPOINT_P521_HQC256")); - - if (getenv("OQS_CODEPOINT_DILITHIUM2")) oqs_sigalg_list[0].code_point = atoi(getenv("OQS_CODEPOINT_DILITHIUM2")); - if (getenv("OQS_CODEPOINT_P256_DILITHIUM2")) oqs_sigalg_list[1].code_point = atoi(getenv("OQS_CODEPOINT_P256_DILITHIUM2")); - if (getenv("OQS_CODEPOINT_RSA3072_DILITHIUM2")) oqs_sigalg_list[2].code_point = atoi(getenv("OQS_CODEPOINT_RSA3072_DILITHIUM2")); - if (getenv("OQS_CODEPOINT_DILITHIUM3")) oqs_sigalg_list[3].code_point = atoi(getenv("OQS_CODEPOINT_DILITHIUM3")); - if (getenv("OQS_CODEPOINT_P384_DILITHIUM3")) oqs_sigalg_list[4].code_point = atoi(getenv("OQS_CODEPOINT_P384_DILITHIUM3")); - if (getenv("OQS_CODEPOINT_DILITHIUM5")) oqs_sigalg_list[5].code_point = atoi(getenv("OQS_CODEPOINT_DILITHIUM5")); - if (getenv("OQS_CODEPOINT_P521_DILITHIUM5")) oqs_sigalg_list[6].code_point = atoi(getenv("OQS_CODEPOINT_P521_DILITHIUM5")); - if (getenv("OQS_CODEPOINT_MLDSA44")) oqs_sigalg_list[7].code_point = atoi(getenv("OQS_CODEPOINT_MLDSA44")); - if (getenv("OQS_CODEPOINT_P256_MLDSA44")) oqs_sigalg_list[8].code_point = atoi(getenv("OQS_CODEPOINT_P256_MLDSA44")); - if (getenv("OQS_CODEPOINT_RSA3072_MLDSA44")) oqs_sigalg_list[9].code_point = atoi(getenv("OQS_CODEPOINT_RSA3072_MLDSA44")); - if (getenv("OQS_CODEPOINT_MLDSA44_PSS2048")) oqs_sigalg_list[10].code_point = atoi(getenv("OQS_CODEPOINT_MLDSA44_PSS2048")); - if (getenv("OQS_CODEPOINT_MLDSA44_RSA2048")) oqs_sigalg_list[11].code_point = atoi(getenv("OQS_CODEPOINT_MLDSA44_RSA2048")); - if (getenv("OQS_CODEPOINT_MLDSA44_ED25519")) oqs_sigalg_list[12].code_point = atoi(getenv("OQS_CODEPOINT_MLDSA44_ED25519")); - if (getenv("OQS_CODEPOINT_MLDSA44_P256")) oqs_sigalg_list[13].code_point = atoi(getenv("OQS_CODEPOINT_MLDSA44_P256")); - if (getenv("OQS_CODEPOINT_MLDSA44_BP256")) oqs_sigalg_list[14].code_point = atoi(getenv("OQS_CODEPOINT_MLDSA44_BP256")); - if (getenv("OQS_CODEPOINT_MLDSA65")) oqs_sigalg_list[15].code_point = atoi(getenv("OQS_CODEPOINT_MLDSA65")); - if (getenv("OQS_CODEPOINT_P384_MLDSA65")) oqs_sigalg_list[16].code_point = atoi(getenv("OQS_CODEPOINT_P384_MLDSA65")); - if (getenv("OQS_CODEPOINT_MLDSA65_PSS3072")) oqs_sigalg_list[17].code_point = atoi(getenv("OQS_CODEPOINT_MLDSA65_PSS3072")); - if (getenv("OQS_CODEPOINT_MLDSA65_RSA3072")) oqs_sigalg_list[18].code_point = atoi(getenv("OQS_CODEPOINT_MLDSA65_RSA3072")); - if (getenv("OQS_CODEPOINT_MLDSA65_P256")) oqs_sigalg_list[19].code_point = atoi(getenv("OQS_CODEPOINT_MLDSA65_P256")); - if (getenv("OQS_CODEPOINT_MLDSA65_BP256")) oqs_sigalg_list[20].code_point = atoi(getenv("OQS_CODEPOINT_MLDSA65_BP256")); - if (getenv("OQS_CODEPOINT_MLDSA65_ED25519")) oqs_sigalg_list[21].code_point = atoi(getenv("OQS_CODEPOINT_MLDSA65_ED25519")); - if (getenv("OQS_CODEPOINT_MLDSA87")) oqs_sigalg_list[22].code_point = atoi(getenv("OQS_CODEPOINT_MLDSA87")); - if (getenv("OQS_CODEPOINT_P521_MLDSA87")) oqs_sigalg_list[23].code_point = atoi(getenv("OQS_CODEPOINT_P521_MLDSA87")); - if (getenv("OQS_CODEPOINT_MLDSA87_P384")) oqs_sigalg_list[24].code_point = atoi(getenv("OQS_CODEPOINT_MLDSA87_P384")); - if (getenv("OQS_CODEPOINT_MLDSA87_BP384")) oqs_sigalg_list[25].code_point = atoi(getenv("OQS_CODEPOINT_MLDSA87_BP384")); - if (getenv("OQS_CODEPOINT_MLDSA87_ED448")) oqs_sigalg_list[26].code_point = atoi(getenv("OQS_CODEPOINT_MLDSA87_ED448")); - if (getenv("OQS_CODEPOINT_FALCON512")) oqs_sigalg_list[27].code_point = atoi(getenv("OQS_CODEPOINT_FALCON512")); - if (getenv("OQS_CODEPOINT_P256_FALCON512")) oqs_sigalg_list[28].code_point = atoi(getenv("OQS_CODEPOINT_P256_FALCON512")); - if (getenv("OQS_CODEPOINT_RSA3072_FALCON512")) oqs_sigalg_list[29].code_point = atoi(getenv("OQS_CODEPOINT_RSA3072_FALCON512")); - if (getenv("OQS_CODEPOINT_FALCONPADDED512")) oqs_sigalg_list[30].code_point = atoi(getenv("OQS_CODEPOINT_FALCONPADDED512")); - if (getenv("OQS_CODEPOINT_P256_FALCONPADDED512")) oqs_sigalg_list[31].code_point = atoi(getenv("OQS_CODEPOINT_P256_FALCONPADDED512")); - if (getenv("OQS_CODEPOINT_RSA3072_FALCONPADDED512")) oqs_sigalg_list[32].code_point = atoi(getenv("OQS_CODEPOINT_RSA3072_FALCONPADDED512")); - if (getenv("OQS_CODEPOINT_FALCON1024")) oqs_sigalg_list[33].code_point = atoi(getenv("OQS_CODEPOINT_FALCON1024")); - if (getenv("OQS_CODEPOINT_P521_FALCON1024")) oqs_sigalg_list[34].code_point = atoi(getenv("OQS_CODEPOINT_P521_FALCON1024")); - if (getenv("OQS_CODEPOINT_FALCONPADDED1024")) oqs_sigalg_list[35].code_point = atoi(getenv("OQS_CODEPOINT_FALCONPADDED1024")); - if (getenv("OQS_CODEPOINT_P521_FALCONPADDED1024")) oqs_sigalg_list[36].code_point = atoi(getenv("OQS_CODEPOINT_P521_FALCONPADDED1024")); - if (getenv("OQS_CODEPOINT_SPHINCSSHA2128FSIMPLE")) oqs_sigalg_list[37].code_point = atoi(getenv("OQS_CODEPOINT_SPHINCSSHA2128FSIMPLE")); - if (getenv("OQS_CODEPOINT_P256_SPHINCSSHA2128FSIMPLE")) oqs_sigalg_list[38].code_point = atoi(getenv("OQS_CODEPOINT_P256_SPHINCSSHA2128FSIMPLE")); - if (getenv("OQS_CODEPOINT_RSA3072_SPHINCSSHA2128FSIMPLE")) oqs_sigalg_list[39].code_point = atoi(getenv("OQS_CODEPOINT_RSA3072_SPHINCSSHA2128FSIMPLE")); - if (getenv("OQS_CODEPOINT_SPHINCSSHA2128SSIMPLE")) oqs_sigalg_list[40].code_point = atoi(getenv("OQS_CODEPOINT_SPHINCSSHA2128SSIMPLE")); - if (getenv("OQS_CODEPOINT_P256_SPHINCSSHA2128SSIMPLE")) oqs_sigalg_list[41].code_point = atoi(getenv("OQS_CODEPOINT_P256_SPHINCSSHA2128SSIMPLE")); - if (getenv("OQS_CODEPOINT_RSA3072_SPHINCSSHA2128SSIMPLE")) oqs_sigalg_list[42].code_point = atoi(getenv("OQS_CODEPOINT_RSA3072_SPHINCSSHA2128SSIMPLE")); - if (getenv("OQS_CODEPOINT_SPHINCSSHA2192FSIMPLE")) oqs_sigalg_list[43].code_point = atoi(getenv("OQS_CODEPOINT_SPHINCSSHA2192FSIMPLE")); - if (getenv("OQS_CODEPOINT_P384_SPHINCSSHA2192FSIMPLE")) oqs_sigalg_list[44].code_point = atoi(getenv("OQS_CODEPOINT_P384_SPHINCSSHA2192FSIMPLE")); - if (getenv("OQS_CODEPOINT_SPHINCSSHAKE128FSIMPLE")) oqs_sigalg_list[45].code_point = atoi(getenv("OQS_CODEPOINT_SPHINCSSHAKE128FSIMPLE")); - if (getenv("OQS_CODEPOINT_P256_SPHINCSSHAKE128FSIMPLE")) oqs_sigalg_list[46].code_point = atoi(getenv("OQS_CODEPOINT_P256_SPHINCSSHAKE128FSIMPLE")); - if (getenv("OQS_CODEPOINT_RSA3072_SPHINCSSHAKE128FSIMPLE")) oqs_sigalg_list[47].code_point = atoi(getenv("OQS_CODEPOINT_RSA3072_SPHINCSSHAKE128FSIMPLE")); - if (getenv("OQS_CODEPOINT_MAYO1")) oqs_sigalg_list[48].code_point = atoi(getenv("OQS_CODEPOINT_MAYO1")); - if (getenv("OQS_CODEPOINT_P256_MAYO1")) oqs_sigalg_list[49].code_point = atoi(getenv("OQS_CODEPOINT_P256_MAYO1")); - if (getenv("OQS_CODEPOINT_MAYO2")) oqs_sigalg_list[50].code_point = atoi(getenv("OQS_CODEPOINT_MAYO2")); - if (getenv("OQS_CODEPOINT_P256_MAYO2")) oqs_sigalg_list[51].code_point = atoi(getenv("OQS_CODEPOINT_P256_MAYO2")); - if (getenv("OQS_CODEPOINT_MAYO3")) oqs_sigalg_list[52].code_point = atoi(getenv("OQS_CODEPOINT_MAYO3")); - if (getenv("OQS_CODEPOINT_P384_MAYO3")) oqs_sigalg_list[53].code_point = atoi(getenv("OQS_CODEPOINT_P384_MAYO3")); - if (getenv("OQS_CODEPOINT_MAYO5")) oqs_sigalg_list[54].code_point = atoi(getenv("OQS_CODEPOINT_MAYO5")); - if (getenv("OQS_CODEPOINT_P521_MAYO5")) oqs_sigalg_list[55].code_point = atoi(getenv("OQS_CODEPOINT_P521_MAYO5")); - if (getenv("OQS_CODEPOINT_CROSSRSDP128BALANCED")) oqs_sigalg_list[56].code_point = atoi(getenv("OQS_CODEPOINT_CROSSRSDP128BALANCED")); -///// OQS_TEMPLATE_FRAGMENT_CODEPOINT_PATCHING_END + if (getenv("OQS_CODEPOINT_FRODO640AES")) + oqs_group_list[0].group_id = atoi(getenv("OQS_CODEPOINT_FRODO640AES")); + if (getenv("OQS_CODEPOINT_P256_FRODO640AES")) + oqs_group_list[1].group_id = + atoi(getenv("OQS_CODEPOINT_P256_FRODO640AES")); + if (getenv("OQS_CODEPOINT_X25519_FRODO640AES")) + oqs_group_list[2].group_id = + atoi(getenv("OQS_CODEPOINT_X25519_FRODO640AES")); + if (getenv("OQS_CODEPOINT_FRODO640SHAKE")) + oqs_group_list[3].group_id = + atoi(getenv("OQS_CODEPOINT_FRODO640SHAKE")); + if (getenv("OQS_CODEPOINT_P256_FRODO640SHAKE")) + oqs_group_list[4].group_id = + atoi(getenv("OQS_CODEPOINT_P256_FRODO640SHAKE")); + if (getenv("OQS_CODEPOINT_X25519_FRODO640SHAKE")) + oqs_group_list[5].group_id = + atoi(getenv("OQS_CODEPOINT_X25519_FRODO640SHAKE")); + if (getenv("OQS_CODEPOINT_FRODO976AES")) + oqs_group_list[6].group_id = atoi(getenv("OQS_CODEPOINT_FRODO976AES")); + if (getenv("OQS_CODEPOINT_P384_FRODO976AES")) + oqs_group_list[7].group_id = + atoi(getenv("OQS_CODEPOINT_P384_FRODO976AES")); + if (getenv("OQS_CODEPOINT_X448_FRODO976AES")) + oqs_group_list[8].group_id = + atoi(getenv("OQS_CODEPOINT_X448_FRODO976AES")); + if (getenv("OQS_CODEPOINT_FRODO976SHAKE")) + oqs_group_list[9].group_id = + atoi(getenv("OQS_CODEPOINT_FRODO976SHAKE")); + if (getenv("OQS_CODEPOINT_P384_FRODO976SHAKE")) + oqs_group_list[10].group_id = + atoi(getenv("OQS_CODEPOINT_P384_FRODO976SHAKE")); + if (getenv("OQS_CODEPOINT_X448_FRODO976SHAKE")) + oqs_group_list[11].group_id = + atoi(getenv("OQS_CODEPOINT_X448_FRODO976SHAKE")); + if (getenv("OQS_CODEPOINT_FRODO1344AES")) + oqs_group_list[12].group_id = + atoi(getenv("OQS_CODEPOINT_FRODO1344AES")); + if (getenv("OQS_CODEPOINT_P521_FRODO1344AES")) + oqs_group_list[13].group_id = + atoi(getenv("OQS_CODEPOINT_P521_FRODO1344AES")); + if (getenv("OQS_CODEPOINT_FRODO1344SHAKE")) + oqs_group_list[14].group_id = + atoi(getenv("OQS_CODEPOINT_FRODO1344SHAKE")); + if (getenv("OQS_CODEPOINT_P521_FRODO1344SHAKE")) + oqs_group_list[15].group_id = + atoi(getenv("OQS_CODEPOINT_P521_FRODO1344SHAKE")); + if (getenv("OQS_CODEPOINT_KYBER512")) + oqs_group_list[16].group_id = atoi(getenv("OQS_CODEPOINT_KYBER512")); + if (getenv("OQS_CODEPOINT_P256_KYBER512")) + oqs_group_list[17].group_id = + atoi(getenv("OQS_CODEPOINT_P256_KYBER512")); + if (getenv("OQS_CODEPOINT_X25519_KYBER512")) + oqs_group_list[18].group_id = + atoi(getenv("OQS_CODEPOINT_X25519_KYBER512")); + if (getenv("OQS_CODEPOINT_KYBER768")) + oqs_group_list[19].group_id = atoi(getenv("OQS_CODEPOINT_KYBER768")); + if (getenv("OQS_CODEPOINT_P384_KYBER768")) + oqs_group_list[20].group_id = + atoi(getenv("OQS_CODEPOINT_P384_KYBER768")); + if (getenv("OQS_CODEPOINT_X448_KYBER768")) + oqs_group_list[21].group_id = + atoi(getenv("OQS_CODEPOINT_X448_KYBER768")); + if (getenv("OQS_CODEPOINT_X25519_KYBER768")) + oqs_group_list[22].group_id = + atoi(getenv("OQS_CODEPOINT_X25519_KYBER768")); + if (getenv("OQS_CODEPOINT_P256_KYBER768")) + oqs_group_list[23].group_id = + atoi(getenv("OQS_CODEPOINT_P256_KYBER768")); + if (getenv("OQS_CODEPOINT_KYBER1024")) + oqs_group_list[24].group_id = atoi(getenv("OQS_CODEPOINT_KYBER1024")); + if (getenv("OQS_CODEPOINT_P521_KYBER1024")) + oqs_group_list[25].group_id = + atoi(getenv("OQS_CODEPOINT_P521_KYBER1024")); + if (getenv("OQS_CODEPOINT_MLKEM512")) + oqs_group_list[26].group_id = atoi(getenv("OQS_CODEPOINT_MLKEM512")); + if (getenv("OQS_CODEPOINT_P256_MLKEM512")) + oqs_group_list[27].group_id = + atoi(getenv("OQS_CODEPOINT_P256_MLKEM512")); + if (getenv("OQS_CODEPOINT_X25519_MLKEM512")) + oqs_group_list[28].group_id = + atoi(getenv("OQS_CODEPOINT_X25519_MLKEM512")); + if (getenv("OQS_CODEPOINT_MLKEM768")) + oqs_group_list[29].group_id = atoi(getenv("OQS_CODEPOINT_MLKEM768")); + if (getenv("OQS_CODEPOINT_P384_MLKEM768")) + oqs_group_list[30].group_id = + atoi(getenv("OQS_CODEPOINT_P384_MLKEM768")); + if (getenv("OQS_CODEPOINT_X448_MLKEM768")) + oqs_group_list[31].group_id = + atoi(getenv("OQS_CODEPOINT_X448_MLKEM768")); + if (getenv("OQS_CODEPOINT_X25519_MLKEM768")) + oqs_group_list[32].group_id = + atoi(getenv("OQS_CODEPOINT_X25519_MLKEM768")); + if (getenv("OQS_CODEPOINT_P256_MLKEM768")) + oqs_group_list[33].group_id = + atoi(getenv("OQS_CODEPOINT_P256_MLKEM768")); + if (getenv("OQS_CODEPOINT_MLKEM1024")) + oqs_group_list[34].group_id = atoi(getenv("OQS_CODEPOINT_MLKEM1024")); + if (getenv("OQS_CODEPOINT_P521_MLKEM1024")) + oqs_group_list[35].group_id = + atoi(getenv("OQS_CODEPOINT_P521_MLKEM1024")); + if (getenv("OQS_CODEPOINT_P384_MLKEM1024")) + oqs_group_list[36].group_id = + atoi(getenv("OQS_CODEPOINT_P384_MLKEM1024")); + if (getenv("OQS_CODEPOINT_BIKEL1")) + oqs_group_list[37].group_id = atoi(getenv("OQS_CODEPOINT_BIKEL1")); + if (getenv("OQS_CODEPOINT_P256_BIKEL1")) + oqs_group_list[38].group_id = atoi(getenv("OQS_CODEPOINT_P256_BIKEL1")); + if (getenv("OQS_CODEPOINT_X25519_BIKEL1")) + oqs_group_list[39].group_id = + atoi(getenv("OQS_CODEPOINT_X25519_BIKEL1")); + if (getenv("OQS_CODEPOINT_BIKEL3")) + oqs_group_list[40].group_id = atoi(getenv("OQS_CODEPOINT_BIKEL3")); + if (getenv("OQS_CODEPOINT_P384_BIKEL3")) + oqs_group_list[41].group_id = atoi(getenv("OQS_CODEPOINT_P384_BIKEL3")); + if (getenv("OQS_CODEPOINT_X448_BIKEL3")) + oqs_group_list[42].group_id = atoi(getenv("OQS_CODEPOINT_X448_BIKEL3")); + if (getenv("OQS_CODEPOINT_BIKEL5")) + oqs_group_list[43].group_id = atoi(getenv("OQS_CODEPOINT_BIKEL5")); + if (getenv("OQS_CODEPOINT_P521_BIKEL5")) + oqs_group_list[44].group_id = atoi(getenv("OQS_CODEPOINT_P521_BIKEL5")); + if (getenv("OQS_CODEPOINT_HQC128")) + oqs_group_list[45].group_id = atoi(getenv("OQS_CODEPOINT_HQC128")); + if (getenv("OQS_CODEPOINT_P256_HQC128")) + oqs_group_list[46].group_id = atoi(getenv("OQS_CODEPOINT_P256_HQC128")); + if (getenv("OQS_CODEPOINT_X25519_HQC128")) + oqs_group_list[47].group_id = + atoi(getenv("OQS_CODEPOINT_X25519_HQC128")); + if (getenv("OQS_CODEPOINT_HQC192")) + oqs_group_list[48].group_id = atoi(getenv("OQS_CODEPOINT_HQC192")); + if (getenv("OQS_CODEPOINT_P384_HQC192")) + oqs_group_list[49].group_id = atoi(getenv("OQS_CODEPOINT_P384_HQC192")); + if (getenv("OQS_CODEPOINT_X448_HQC192")) + oqs_group_list[50].group_id = atoi(getenv("OQS_CODEPOINT_X448_HQC192")); + if (getenv("OQS_CODEPOINT_HQC256")) + oqs_group_list[51].group_id = atoi(getenv("OQS_CODEPOINT_HQC256")); + if (getenv("OQS_CODEPOINT_P521_HQC256")) + oqs_group_list[52].group_id = atoi(getenv("OQS_CODEPOINT_P521_HQC256")); + + if (getenv("OQS_CODEPOINT_DILITHIUM2")) + oqs_sigalg_list[0].code_point = + atoi(getenv("OQS_CODEPOINT_DILITHIUM2")); + if (getenv("OQS_CODEPOINT_P256_DILITHIUM2")) + oqs_sigalg_list[1].code_point = + atoi(getenv("OQS_CODEPOINT_P256_DILITHIUM2")); + if (getenv("OQS_CODEPOINT_RSA3072_DILITHIUM2")) + oqs_sigalg_list[2].code_point = + atoi(getenv("OQS_CODEPOINT_RSA3072_DILITHIUM2")); + if (getenv("OQS_CODEPOINT_DILITHIUM3")) + oqs_sigalg_list[3].code_point = + atoi(getenv("OQS_CODEPOINT_DILITHIUM3")); + if (getenv("OQS_CODEPOINT_P384_DILITHIUM3")) + oqs_sigalg_list[4].code_point = + atoi(getenv("OQS_CODEPOINT_P384_DILITHIUM3")); + if (getenv("OQS_CODEPOINT_DILITHIUM5")) + oqs_sigalg_list[5].code_point = + atoi(getenv("OQS_CODEPOINT_DILITHIUM5")); + if (getenv("OQS_CODEPOINT_P521_DILITHIUM5")) + oqs_sigalg_list[6].code_point = + atoi(getenv("OQS_CODEPOINT_P521_DILITHIUM5")); + if (getenv("OQS_CODEPOINT_MLDSA44")) + oqs_sigalg_list[7].code_point = atoi(getenv("OQS_CODEPOINT_MLDSA44")); + if (getenv("OQS_CODEPOINT_P256_MLDSA44")) + oqs_sigalg_list[8].code_point = + atoi(getenv("OQS_CODEPOINT_P256_MLDSA44")); + if (getenv("OQS_CODEPOINT_RSA3072_MLDSA44")) + oqs_sigalg_list[9].code_point = + atoi(getenv("OQS_CODEPOINT_RSA3072_MLDSA44")); + if (getenv("OQS_CODEPOINT_MLDSA44_PSS2048")) + oqs_sigalg_list[10].code_point = + atoi(getenv("OQS_CODEPOINT_MLDSA44_PSS2048")); + if (getenv("OQS_CODEPOINT_MLDSA44_RSA2048")) + oqs_sigalg_list[11].code_point = + atoi(getenv("OQS_CODEPOINT_MLDSA44_RSA2048")); + if (getenv("OQS_CODEPOINT_MLDSA44_ED25519")) + oqs_sigalg_list[12].code_point = + atoi(getenv("OQS_CODEPOINT_MLDSA44_ED25519")); + if (getenv("OQS_CODEPOINT_MLDSA44_P256")) + oqs_sigalg_list[13].code_point = + atoi(getenv("OQS_CODEPOINT_MLDSA44_P256")); + if (getenv("OQS_CODEPOINT_MLDSA44_BP256")) + oqs_sigalg_list[14].code_point = + atoi(getenv("OQS_CODEPOINT_MLDSA44_BP256")); + if (getenv("OQS_CODEPOINT_MLDSA65")) + oqs_sigalg_list[15].code_point = atoi(getenv("OQS_CODEPOINT_MLDSA65")); + if (getenv("OQS_CODEPOINT_P384_MLDSA65")) + oqs_sigalg_list[16].code_point = + atoi(getenv("OQS_CODEPOINT_P384_MLDSA65")); + if (getenv("OQS_CODEPOINT_MLDSA65_PSS3072")) + oqs_sigalg_list[17].code_point = + atoi(getenv("OQS_CODEPOINT_MLDSA65_PSS3072")); + if (getenv("OQS_CODEPOINT_MLDSA65_RSA3072")) + oqs_sigalg_list[18].code_point = + atoi(getenv("OQS_CODEPOINT_MLDSA65_RSA3072")); + if (getenv("OQS_CODEPOINT_MLDSA65_P256")) + oqs_sigalg_list[19].code_point = + atoi(getenv("OQS_CODEPOINT_MLDSA65_P256")); + if (getenv("OQS_CODEPOINT_MLDSA65_BP256")) + oqs_sigalg_list[20].code_point = + atoi(getenv("OQS_CODEPOINT_MLDSA65_BP256")); + if (getenv("OQS_CODEPOINT_MLDSA65_ED25519")) + oqs_sigalg_list[21].code_point = + atoi(getenv("OQS_CODEPOINT_MLDSA65_ED25519")); + if (getenv("OQS_CODEPOINT_MLDSA87")) + oqs_sigalg_list[22].code_point = atoi(getenv("OQS_CODEPOINT_MLDSA87")); + if (getenv("OQS_CODEPOINT_P521_MLDSA87")) + oqs_sigalg_list[23].code_point = + atoi(getenv("OQS_CODEPOINT_P521_MLDSA87")); + if (getenv("OQS_CODEPOINT_MLDSA87_P384")) + oqs_sigalg_list[24].code_point = + atoi(getenv("OQS_CODEPOINT_MLDSA87_P384")); + if (getenv("OQS_CODEPOINT_MLDSA87_BP384")) + oqs_sigalg_list[25].code_point = + atoi(getenv("OQS_CODEPOINT_MLDSA87_BP384")); + if (getenv("OQS_CODEPOINT_MLDSA87_ED448")) + oqs_sigalg_list[26].code_point = + atoi(getenv("OQS_CODEPOINT_MLDSA87_ED448")); + if (getenv("OQS_CODEPOINT_FALCON512")) + oqs_sigalg_list[27].code_point = + atoi(getenv("OQS_CODEPOINT_FALCON512")); + if (getenv("OQS_CODEPOINT_P256_FALCON512")) + oqs_sigalg_list[28].code_point = + atoi(getenv("OQS_CODEPOINT_P256_FALCON512")); + if (getenv("OQS_CODEPOINT_RSA3072_FALCON512")) + oqs_sigalg_list[29].code_point = + atoi(getenv("OQS_CODEPOINT_RSA3072_FALCON512")); + if (getenv("OQS_CODEPOINT_FALCONPADDED512")) + oqs_sigalg_list[30].code_point = + atoi(getenv("OQS_CODEPOINT_FALCONPADDED512")); + if (getenv("OQS_CODEPOINT_P256_FALCONPADDED512")) + oqs_sigalg_list[31].code_point = + atoi(getenv("OQS_CODEPOINT_P256_FALCONPADDED512")); + if (getenv("OQS_CODEPOINT_RSA3072_FALCONPADDED512")) + oqs_sigalg_list[32].code_point = + atoi(getenv("OQS_CODEPOINT_RSA3072_FALCONPADDED512")); + if (getenv("OQS_CODEPOINT_FALCON1024")) + oqs_sigalg_list[33].code_point = + atoi(getenv("OQS_CODEPOINT_FALCON1024")); + if (getenv("OQS_CODEPOINT_P521_FALCON1024")) + oqs_sigalg_list[34].code_point = + atoi(getenv("OQS_CODEPOINT_P521_FALCON1024")); + if (getenv("OQS_CODEPOINT_FALCONPADDED1024")) + oqs_sigalg_list[35].code_point = + atoi(getenv("OQS_CODEPOINT_FALCONPADDED1024")); + if (getenv("OQS_CODEPOINT_P521_FALCONPADDED1024")) + oqs_sigalg_list[36].code_point = + atoi(getenv("OQS_CODEPOINT_P521_FALCONPADDED1024")); + if (getenv("OQS_CODEPOINT_SPHINCSSHA2128FSIMPLE")) + oqs_sigalg_list[37].code_point = + atoi(getenv("OQS_CODEPOINT_SPHINCSSHA2128FSIMPLE")); + if (getenv("OQS_CODEPOINT_P256_SPHINCSSHA2128FSIMPLE")) + oqs_sigalg_list[38].code_point = + atoi(getenv("OQS_CODEPOINT_P256_SPHINCSSHA2128FSIMPLE")); + if (getenv("OQS_CODEPOINT_RSA3072_SPHINCSSHA2128FSIMPLE")) + oqs_sigalg_list[39].code_point = + atoi(getenv("OQS_CODEPOINT_RSA3072_SPHINCSSHA2128FSIMPLE")); + if (getenv("OQS_CODEPOINT_SPHINCSSHA2128SSIMPLE")) + oqs_sigalg_list[40].code_point = + atoi(getenv("OQS_CODEPOINT_SPHINCSSHA2128SSIMPLE")); + if (getenv("OQS_CODEPOINT_P256_SPHINCSSHA2128SSIMPLE")) + oqs_sigalg_list[41].code_point = + atoi(getenv("OQS_CODEPOINT_P256_SPHINCSSHA2128SSIMPLE")); + if (getenv("OQS_CODEPOINT_RSA3072_SPHINCSSHA2128SSIMPLE")) + oqs_sigalg_list[42].code_point = + atoi(getenv("OQS_CODEPOINT_RSA3072_SPHINCSSHA2128SSIMPLE")); + if (getenv("OQS_CODEPOINT_SPHINCSSHA2192FSIMPLE")) + oqs_sigalg_list[43].code_point = + atoi(getenv("OQS_CODEPOINT_SPHINCSSHA2192FSIMPLE")); + if (getenv("OQS_CODEPOINT_P384_SPHINCSSHA2192FSIMPLE")) + oqs_sigalg_list[44].code_point = + atoi(getenv("OQS_CODEPOINT_P384_SPHINCSSHA2192FSIMPLE")); + if (getenv("OQS_CODEPOINT_SPHINCSSHAKE128FSIMPLE")) + oqs_sigalg_list[45].code_point = + atoi(getenv("OQS_CODEPOINT_SPHINCSSHAKE128FSIMPLE")); + if (getenv("OQS_CODEPOINT_P256_SPHINCSSHAKE128FSIMPLE")) + oqs_sigalg_list[46].code_point = + atoi(getenv("OQS_CODEPOINT_P256_SPHINCSSHAKE128FSIMPLE")); + if (getenv("OQS_CODEPOINT_RSA3072_SPHINCSSHAKE128FSIMPLE")) + oqs_sigalg_list[47].code_point = + atoi(getenv("OQS_CODEPOINT_RSA3072_SPHINCSSHAKE128FSIMPLE")); + if (getenv("OQS_CODEPOINT_MAYO1")) + oqs_sigalg_list[48].code_point = atoi(getenv("OQS_CODEPOINT_MAYO1")); + if (getenv("OQS_CODEPOINT_P256_MAYO1")) + oqs_sigalg_list[49].code_point = + atoi(getenv("OQS_CODEPOINT_P256_MAYO1")); + if (getenv("OQS_CODEPOINT_MAYO2")) + oqs_sigalg_list[50].code_point = atoi(getenv("OQS_CODEPOINT_MAYO2")); + if (getenv("OQS_CODEPOINT_P256_MAYO2")) + oqs_sigalg_list[51].code_point = + atoi(getenv("OQS_CODEPOINT_P256_MAYO2")); + if (getenv("OQS_CODEPOINT_MAYO3")) + oqs_sigalg_list[52].code_point = atoi(getenv("OQS_CODEPOINT_MAYO3")); + if (getenv("OQS_CODEPOINT_P384_MAYO3")) + oqs_sigalg_list[53].code_point = + atoi(getenv("OQS_CODEPOINT_P384_MAYO3")); + if (getenv("OQS_CODEPOINT_MAYO5")) + oqs_sigalg_list[54].code_point = atoi(getenv("OQS_CODEPOINT_MAYO5")); + if (getenv("OQS_CODEPOINT_P521_MAYO5")) + oqs_sigalg_list[55].code_point = + atoi(getenv("OQS_CODEPOINT_P521_MAYO5")); + if (getenv("OQS_CODEPOINT_CROSSRSDP128BALANCED")) + oqs_sigalg_list[56].code_point = + atoi(getenv("OQS_CODEPOINT_CROSSRSDP128BALANCED")); + ///// OQS_TEMPLATE_FRAGMENT_CODEPOINT_PATCHING_END return 1; } -static int oqs_group_capability(OSSL_CALLBACK *cb, void *arg) -{ +static int oqs_group_capability(OSSL_CALLBACK *cb, void *arg) { size_t i; for (i = 0; i < OSSL_NELEM(oqs_param_group_list); i++) { @@ -450,104 +618,148 @@ static int oqs_group_capability(OSSL_CALLBACK *cb, void *arg) } #ifdef OSSL_CAPABILITY_TLS_SIGALG_NAME -# define OQS_SIGALG_ENTRY(tlsname, realname, algorithm, oid, idx) \ - { \ - OSSL_PARAM_utf8_string(OSSL_CAPABILITY_TLS_SIGALG_IANA_NAME, \ - #tlsname, sizeof(#tlsname)), \ - OSSL_PARAM_utf8_string(OSSL_CAPABILITY_TLS_SIGALG_NAME, \ - #tlsname, sizeof(#tlsname)), \ - OSSL_PARAM_utf8_string(OSSL_CAPABILITY_TLS_SIGALG_OID, #oid, \ - sizeof(#oid)), \ - OSSL_PARAM_uint( \ - OSSL_CAPABILITY_TLS_SIGALG_CODE_POINT, \ - (unsigned int *)&oqs_sigalg_list[idx].code_point), \ - OSSL_PARAM_uint( \ - OSSL_CAPABILITY_TLS_SIGALG_SECURITY_BITS, \ - (unsigned int *)&oqs_sigalg_list[idx].secbits), \ - OSSL_PARAM_int(OSSL_CAPABILITY_TLS_SIGALG_MIN_TLS, \ - (unsigned int *)&oqs_sigalg_list[idx].mintls), \ - OSSL_PARAM_int(OSSL_CAPABILITY_TLS_SIGALG_MAX_TLS, \ - (unsigned int *)&oqs_sigalg_list[idx].maxtls), \ - OSSL_PARAM_END \ - } +#define OQS_SIGALG_ENTRY(tlsname, realname, algorithm, oid, idx) \ + { \ + OSSL_PARAM_utf8_string(OSSL_CAPABILITY_TLS_SIGALG_IANA_NAME, #tlsname, \ + sizeof(#tlsname)), \ + OSSL_PARAM_utf8_string(OSSL_CAPABILITY_TLS_SIGALG_NAME, #tlsname, \ + sizeof(#tlsname)), \ + OSSL_PARAM_utf8_string(OSSL_CAPABILITY_TLS_SIGALG_OID, #oid, \ + sizeof(#oid)), \ + OSSL_PARAM_uint(OSSL_CAPABILITY_TLS_SIGALG_CODE_POINT, \ + (unsigned int *)&oqs_sigalg_list[idx].code_point), \ + OSSL_PARAM_uint(OSSL_CAPABILITY_TLS_SIGALG_SECURITY_BITS, \ + (unsigned int *)&oqs_sigalg_list[idx].secbits), \ + OSSL_PARAM_int(OSSL_CAPABILITY_TLS_SIGALG_MIN_TLS, \ + (unsigned int *)&oqs_sigalg_list[idx].mintls), \ + OSSL_PARAM_int(OSSL_CAPABILITY_TLS_SIGALG_MAX_TLS, \ + (unsigned int *)&oqs_sigalg_list[idx].maxtls), \ + OSSL_PARAM_END \ + } static const OSSL_PARAM oqs_param_sigalg_list[][12] = { ///// OQS_TEMPLATE_FRAGMENT_SIGALG_NAMES_START #ifdef OQS_ENABLE_SIG_dilithium_2 - OQS_SIGALG_ENTRY(dilithium2, dilithium2, dilithium2, "1.3.6.1.4.1.2.267.7.4.4", 0), - OQS_SIGALG_ENTRY(p256_dilithium2, p256_dilithium2, p256_dilithium2, "1.3.9999.2.7.1", 1), - OQS_SIGALG_ENTRY(rsa3072_dilithium2, rsa3072_dilithium2, rsa3072_dilithium2, "1.3.9999.2.7.2", 2), + OQS_SIGALG_ENTRY(dilithium2, dilithium2, dilithium2, + "1.3.6.1.4.1.2.267.7.4.4", 0), + OQS_SIGALG_ENTRY(p256_dilithium2, p256_dilithium2, p256_dilithium2, + "1.3.9999.2.7.1", 1), + OQS_SIGALG_ENTRY(rsa3072_dilithium2, rsa3072_dilithium2, rsa3072_dilithium2, + "1.3.9999.2.7.2", 2), #endif #ifdef OQS_ENABLE_SIG_dilithium_3 - OQS_SIGALG_ENTRY(dilithium3, dilithium3, dilithium3, "1.3.6.1.4.1.2.267.7.6.5", 3), - OQS_SIGALG_ENTRY(p384_dilithium3, p384_dilithium3, p384_dilithium3, "1.3.9999.2.7.3", 4), + OQS_SIGALG_ENTRY(dilithium3, dilithium3, dilithium3, + "1.3.6.1.4.1.2.267.7.6.5", 3), + OQS_SIGALG_ENTRY(p384_dilithium3, p384_dilithium3, p384_dilithium3, + "1.3.9999.2.7.3", 4), #endif #ifdef OQS_ENABLE_SIG_dilithium_5 - OQS_SIGALG_ENTRY(dilithium5, dilithium5, dilithium5, "1.3.6.1.4.1.2.267.7.8.7", 5), - OQS_SIGALG_ENTRY(p521_dilithium5, p521_dilithium5, p521_dilithium5, "1.3.9999.2.7.4", 6), + OQS_SIGALG_ENTRY(dilithium5, dilithium5, dilithium5, + "1.3.6.1.4.1.2.267.7.8.7", 5), + OQS_SIGALG_ENTRY(p521_dilithium5, p521_dilithium5, p521_dilithium5, + "1.3.9999.2.7.4", 6), #endif #ifdef OQS_ENABLE_SIG_ml_dsa_44 OQS_SIGALG_ENTRY(mldsa44, mldsa44, mldsa44, "1.3.6.1.4.1.2.267.12.4.4", 7), - OQS_SIGALG_ENTRY(p256_mldsa44, p256_mldsa44, p256_mldsa44, "1.3.9999.7.1", 8), - OQS_SIGALG_ENTRY(rsa3072_mldsa44, rsa3072_mldsa44, rsa3072_mldsa44, "1.3.9999.7.2", 9), - OQS_SIGALG_ENTRY(mldsa44_pss2048, mldsa44_pss2048, mldsa44_pss2048, "2.16.840.1.114027.80.8.1.1", 10), - OQS_SIGALG_ENTRY(mldsa44_rsa2048, mldsa44_rsa2048, mldsa44_rsa2048, "2.16.840.1.114027.80.8.1.2", 11), - OQS_SIGALG_ENTRY(mldsa44_ed25519, mldsa44_ed25519, mldsa44_ed25519, "2.16.840.1.114027.80.8.1.3", 12), - OQS_SIGALG_ENTRY(mldsa44_p256, mldsa44_p256, mldsa44_p256, "2.16.840.1.114027.80.8.1.4", 13), - OQS_SIGALG_ENTRY(mldsa44_bp256, mldsa44_bp256, mldsa44_bp256, "2.16.840.1.114027.80.8.1.5", 14), + OQS_SIGALG_ENTRY(p256_mldsa44, p256_mldsa44, p256_mldsa44, "1.3.9999.7.1", + 8), + OQS_SIGALG_ENTRY(rsa3072_mldsa44, rsa3072_mldsa44, rsa3072_mldsa44, + "1.3.9999.7.2", 9), + OQS_SIGALG_ENTRY(mldsa44_pss2048, mldsa44_pss2048, mldsa44_pss2048, + "2.16.840.1.114027.80.8.1.1", 10), + OQS_SIGALG_ENTRY(mldsa44_rsa2048, mldsa44_rsa2048, mldsa44_rsa2048, + "2.16.840.1.114027.80.8.1.2", 11), + OQS_SIGALG_ENTRY(mldsa44_ed25519, mldsa44_ed25519, mldsa44_ed25519, + "2.16.840.1.114027.80.8.1.3", 12), + OQS_SIGALG_ENTRY(mldsa44_p256, mldsa44_p256, mldsa44_p256, + "2.16.840.1.114027.80.8.1.4", 13), + OQS_SIGALG_ENTRY(mldsa44_bp256, mldsa44_bp256, mldsa44_bp256, + "2.16.840.1.114027.80.8.1.5", 14), #endif #ifdef OQS_ENABLE_SIG_ml_dsa_65 OQS_SIGALG_ENTRY(mldsa65, mldsa65, mldsa65, "1.3.6.1.4.1.2.267.12.6.5", 15), - OQS_SIGALG_ENTRY(p384_mldsa65, p384_mldsa65, p384_mldsa65, "1.3.9999.7.3", 16), - OQS_SIGALG_ENTRY(mldsa65_pss3072, mldsa65_pss3072, mldsa65_pss3072, "2.16.840.1.114027.80.8.1.6", 17), - OQS_SIGALG_ENTRY(mldsa65_rsa3072, mldsa65_rsa3072, mldsa65_rsa3072, "2.16.840.1.114027.80.8.1.7", 18), - OQS_SIGALG_ENTRY(mldsa65_p256, mldsa65_p256, mldsa65_p256, "2.16.840.1.114027.80.8.1.8", 19), - OQS_SIGALG_ENTRY(mldsa65_bp256, mldsa65_bp256, mldsa65_bp256, "2.16.840.1.114027.80.8.1.9", 20), - OQS_SIGALG_ENTRY(mldsa65_ed25519, mldsa65_ed25519, mldsa65_ed25519, "2.16.840.1.114027.80.8.1.10", 21), + OQS_SIGALG_ENTRY(p384_mldsa65, p384_mldsa65, p384_mldsa65, "1.3.9999.7.3", + 16), + OQS_SIGALG_ENTRY(mldsa65_pss3072, mldsa65_pss3072, mldsa65_pss3072, + "2.16.840.1.114027.80.8.1.6", 17), + OQS_SIGALG_ENTRY(mldsa65_rsa3072, mldsa65_rsa3072, mldsa65_rsa3072, + "2.16.840.1.114027.80.8.1.7", 18), + OQS_SIGALG_ENTRY(mldsa65_p256, mldsa65_p256, mldsa65_p256, + "2.16.840.1.114027.80.8.1.8", 19), + OQS_SIGALG_ENTRY(mldsa65_bp256, mldsa65_bp256, mldsa65_bp256, + "2.16.840.1.114027.80.8.1.9", 20), + OQS_SIGALG_ENTRY(mldsa65_ed25519, mldsa65_ed25519, mldsa65_ed25519, + "2.16.840.1.114027.80.8.1.10", 21), #endif #ifdef OQS_ENABLE_SIG_ml_dsa_87 OQS_SIGALG_ENTRY(mldsa87, mldsa87, mldsa87, "1.3.6.1.4.1.2.267.12.8.7", 22), - OQS_SIGALG_ENTRY(p521_mldsa87, p521_mldsa87, p521_mldsa87, "1.3.9999.7.4", 23), - OQS_SIGALG_ENTRY(mldsa87_p384, mldsa87_p384, mldsa87_p384, "2.16.840.1.114027.80.8.1.11", 24), - OQS_SIGALG_ENTRY(mldsa87_bp384, mldsa87_bp384, mldsa87_bp384, "2.16.840.1.114027.80.8.1.12", 25), - OQS_SIGALG_ENTRY(mldsa87_ed448, mldsa87_ed448, mldsa87_ed448, "2.16.840.1.114027.80.8.1.13", 26), + OQS_SIGALG_ENTRY(p521_mldsa87, p521_mldsa87, p521_mldsa87, "1.3.9999.7.4", + 23), + OQS_SIGALG_ENTRY(mldsa87_p384, mldsa87_p384, mldsa87_p384, + "2.16.840.1.114027.80.8.1.11", 24), + OQS_SIGALG_ENTRY(mldsa87_bp384, mldsa87_bp384, mldsa87_bp384, + "2.16.840.1.114027.80.8.1.12", 25), + OQS_SIGALG_ENTRY(mldsa87_ed448, mldsa87_ed448, mldsa87_ed448, + "2.16.840.1.114027.80.8.1.13", 26), #endif #ifdef OQS_ENABLE_SIG_falcon_512 OQS_SIGALG_ENTRY(falcon512, falcon512, falcon512, "1.3.9999.3.11", 27), - OQS_SIGALG_ENTRY(p256_falcon512, p256_falcon512, p256_falcon512, "1.3.9999.3.12", 28), - OQS_SIGALG_ENTRY(rsa3072_falcon512, rsa3072_falcon512, rsa3072_falcon512, "1.3.9999.3.13", 29), + OQS_SIGALG_ENTRY(p256_falcon512, p256_falcon512, p256_falcon512, + "1.3.9999.3.12", 28), + OQS_SIGALG_ENTRY(rsa3072_falcon512, rsa3072_falcon512, rsa3072_falcon512, + "1.3.9999.3.13", 29), #endif #ifdef OQS_ENABLE_SIG_falcon_padded_512 - OQS_SIGALG_ENTRY(falconpadded512, falconpadded512, falconpadded512, "1.3.9999.3.16", 30), - OQS_SIGALG_ENTRY(p256_falconpadded512, p256_falconpadded512, p256_falconpadded512, "1.3.9999.3.17", 31), - OQS_SIGALG_ENTRY(rsa3072_falconpadded512, rsa3072_falconpadded512, rsa3072_falconpadded512, "1.3.9999.3.18", 32), + OQS_SIGALG_ENTRY(falconpadded512, falconpadded512, falconpadded512, + "1.3.9999.3.16", 30), + OQS_SIGALG_ENTRY(p256_falconpadded512, p256_falconpadded512, + p256_falconpadded512, "1.3.9999.3.17", 31), + OQS_SIGALG_ENTRY(rsa3072_falconpadded512, rsa3072_falconpadded512, + rsa3072_falconpadded512, "1.3.9999.3.18", 32), #endif #ifdef OQS_ENABLE_SIG_falcon_1024 OQS_SIGALG_ENTRY(falcon1024, falcon1024, falcon1024, "1.3.9999.3.14", 33), - OQS_SIGALG_ENTRY(p521_falcon1024, p521_falcon1024, p521_falcon1024, "1.3.9999.3.15", 34), + OQS_SIGALG_ENTRY(p521_falcon1024, p521_falcon1024, p521_falcon1024, + "1.3.9999.3.15", 34), #endif #ifdef OQS_ENABLE_SIG_falcon_padded_1024 - OQS_SIGALG_ENTRY(falconpadded1024, falconpadded1024, falconpadded1024, "1.3.9999.3.19", 35), - OQS_SIGALG_ENTRY(p521_falconpadded1024, p521_falconpadded1024, p521_falconpadded1024, "1.3.9999.3.20", 36), + OQS_SIGALG_ENTRY(falconpadded1024, falconpadded1024, falconpadded1024, + "1.3.9999.3.19", 35), + OQS_SIGALG_ENTRY(p521_falconpadded1024, p521_falconpadded1024, + p521_falconpadded1024, "1.3.9999.3.20", 36), #endif #ifdef OQS_ENABLE_SIG_sphincs_sha2_128f_simple - OQS_SIGALG_ENTRY(sphincssha2128fsimple, sphincssha2128fsimple, sphincssha2128fsimple, "1.3.9999.6.4.13", 37), - OQS_SIGALG_ENTRY(p256_sphincssha2128fsimple, p256_sphincssha2128fsimple, p256_sphincssha2128fsimple, "1.3.9999.6.4.14", 38), - OQS_SIGALG_ENTRY(rsa3072_sphincssha2128fsimple, rsa3072_sphincssha2128fsimple, rsa3072_sphincssha2128fsimple, "1.3.9999.6.4.15", 39), + OQS_SIGALG_ENTRY(sphincssha2128fsimple, sphincssha2128fsimple, + sphincssha2128fsimple, "1.3.9999.6.4.13", 37), + OQS_SIGALG_ENTRY(p256_sphincssha2128fsimple, p256_sphincssha2128fsimple, + p256_sphincssha2128fsimple, "1.3.9999.6.4.14", 38), + OQS_SIGALG_ENTRY(rsa3072_sphincssha2128fsimple, + rsa3072_sphincssha2128fsimple, + rsa3072_sphincssha2128fsimple, "1.3.9999.6.4.15", 39), #endif #ifdef OQS_ENABLE_SIG_sphincs_sha2_128s_simple - OQS_SIGALG_ENTRY(sphincssha2128ssimple, sphincssha2128ssimple, sphincssha2128ssimple, "1.3.9999.6.4.16", 40), - OQS_SIGALG_ENTRY(p256_sphincssha2128ssimple, p256_sphincssha2128ssimple, p256_sphincssha2128ssimple, "1.3.9999.6.4.17", 41), - OQS_SIGALG_ENTRY(rsa3072_sphincssha2128ssimple, rsa3072_sphincssha2128ssimple, rsa3072_sphincssha2128ssimple, "1.3.9999.6.4.18", 42), + OQS_SIGALG_ENTRY(sphincssha2128ssimple, sphincssha2128ssimple, + sphincssha2128ssimple, "1.3.9999.6.4.16", 40), + OQS_SIGALG_ENTRY(p256_sphincssha2128ssimple, p256_sphincssha2128ssimple, + p256_sphincssha2128ssimple, "1.3.9999.6.4.17", 41), + OQS_SIGALG_ENTRY(rsa3072_sphincssha2128ssimple, + rsa3072_sphincssha2128ssimple, + rsa3072_sphincssha2128ssimple, "1.3.9999.6.4.18", 42), #endif #ifdef OQS_ENABLE_SIG_sphincs_sha2_192f_simple - OQS_SIGALG_ENTRY(sphincssha2192fsimple, sphincssha2192fsimple, sphincssha2192fsimple, "1.3.9999.6.5.10", 43), - OQS_SIGALG_ENTRY(p384_sphincssha2192fsimple, p384_sphincssha2192fsimple, p384_sphincssha2192fsimple, "1.3.9999.6.5.11", 44), + OQS_SIGALG_ENTRY(sphincssha2192fsimple, sphincssha2192fsimple, + sphincssha2192fsimple, "1.3.9999.6.5.10", 43), + OQS_SIGALG_ENTRY(p384_sphincssha2192fsimple, p384_sphincssha2192fsimple, + p384_sphincssha2192fsimple, "1.3.9999.6.5.11", 44), #endif #ifdef OQS_ENABLE_SIG_sphincs_shake_128f_simple - OQS_SIGALG_ENTRY(sphincsshake128fsimple, sphincsshake128fsimple, sphincsshake128fsimple, "1.3.9999.6.7.13", 45), - OQS_SIGALG_ENTRY(p256_sphincsshake128fsimple, p256_sphincsshake128fsimple, p256_sphincsshake128fsimple, "1.3.9999.6.7.14", 46), - OQS_SIGALG_ENTRY(rsa3072_sphincsshake128fsimple, rsa3072_sphincsshake128fsimple, rsa3072_sphincsshake128fsimple, "1.3.9999.6.7.15", 47), + OQS_SIGALG_ENTRY(sphincsshake128fsimple, sphincsshake128fsimple, + sphincsshake128fsimple, "1.3.9999.6.7.13", 45), + OQS_SIGALG_ENTRY(p256_sphincsshake128fsimple, p256_sphincsshake128fsimple, + p256_sphincsshake128fsimple, "1.3.9999.6.7.14", 46), + OQS_SIGALG_ENTRY(rsa3072_sphincsshake128fsimple, + rsa3072_sphincsshake128fsimple, + rsa3072_sphincsshake128fsimple, "1.3.9999.6.7.15", 47), #endif #ifdef OQS_ENABLE_SIG_mayo_1 OQS_SIGALG_ENTRY(mayo1, mayo1, mayo1, "1.3.9999.8.1.1", 48), @@ -566,13 +778,13 @@ static const OSSL_PARAM oqs_param_sigalg_list[][12] = { OQS_SIGALG_ENTRY(p521_mayo5, p521_mayo5, p521_mayo5, "1.3.9999.8.5.2", 55), #endif #ifdef OQS_ENABLE_SIG_cross_rsdp_128_balanced - OQS_SIGALG_ENTRY(CROSSrsdp128balanced, CROSSrsdp128balanced, CROSSrsdp128balanced, "1.3.9999.9.1", 56), + OQS_SIGALG_ENTRY(CROSSrsdp128balanced, CROSSrsdp128balanced, + CROSSrsdp128balanced, "1.3.9999.9.1", 56), #endif -///// OQS_TEMPLATE_FRAGMENT_SIGALG_NAMES_END + ///// OQS_TEMPLATE_FRAGMENT_SIGALG_NAMES_END }; -static int oqs_sigalg_capability(OSSL_CALLBACK *cb, void *arg) -{ +static int oqs_sigalg_capability(OSSL_CALLBACK *cb, void *arg) { size_t i; // relaxed assertion for the case that not all algorithms are enabled in @@ -588,8 +800,7 @@ static int oqs_sigalg_capability(OSSL_CALLBACK *cb, void *arg) #endif /* OSSL_CAPABILITY_TLS_SIGALG_NAME */ int oqs_provider_get_capabilities(void *provctx, const char *capability, - OSSL_CALLBACK *cb, void *arg) -{ + OSSL_CALLBACK *cb, void *arg) { if (strcasecmp(capability, "TLS-GROUP") == 0) return oqs_group_capability(cb, arg); @@ -597,12 +808,13 @@ int oqs_provider_get_capabilities(void *provctx, const char *capability, if (strcasecmp(capability, "TLS-SIGALG") == 0) return oqs_sigalg_capability(cb, arg); #else -# ifndef NDEBUG - fprintf( - stderr, - "Warning: OSSL_CAPABILITY_TLS_SIGALG_NAME not defined: OpenSSL version used that does not support pluggable signature capabilities.\nUpgrading OpenSSL installation recommended to enable QSC TLS signature support.\n\n"); -# endif /* NDEBUG */ -#endif /* OSSL_CAPABILITY_TLS_SIGALG_NAME */ +#ifndef NDEBUG + fprintf(stderr, "Warning: OSSL_CAPABILITY_TLS_SIGALG_NAME not defined: " + "OpenSSL version used that does not support pluggable " + "signature capabilities.\nUpgrading OpenSSL installation " + "recommended to enable QSC TLS signature support.\n\n"); +#endif /* NDEBUG */ +#endif /* OSSL_CAPABILITY_TLS_SIGALG_NAME */ /* We don't support this capability */ return 0; diff --git a/oqsprov/oqsprov_keys.c b/oqsprov/oqsprov_keys.c index 1e7caa24..e402c3db 100644 --- a/oqsprov/oqsprov_keys.c +++ b/oqsprov/oqsprov_keys.c @@ -19,26 +19,22 @@ #include #ifdef NDEBUG -# define OQS_KEY_PRINTF(a) -# define OQS_KEY_PRINTF2(a, b) -# define OQS_KEY_PRINTF3(a, b, c) +#define OQS_KEY_PRINTF(a) +#define OQS_KEY_PRINTF2(a, b) +#define OQS_KEY_PRINTF3(a, b, c) #else -# define OQS_KEY_PRINTF(a) \ - if (getenv("OQSKEY")) \ - printf(a) -# define OQS_KEY_PRINTF2(a, b) \ - if (getenv("OQSKEY")) \ - printf(a, b) -# define OQS_KEY_PRINTF3(a, b, c) \ - if (getenv("OQSKEY")) \ - printf(a, b, c) +#define OQS_KEY_PRINTF(a) \ + if (getenv("OQSKEY")) \ + printf(a) +#define OQS_KEY_PRINTF2(a, b) \ + if (getenv("OQSKEY")) \ + printf(a, b) +#define OQS_KEY_PRINTF3(a, b, c) \ + if (getenv("OQSKEY")) \ + printf(a, b, c) #endif // NDEBUG -typedef enum { - KEY_OP_PUBLIC, - KEY_OP_PRIVATE, - KEY_OP_KEYGEN -} oqsx_key_op_t; +typedef enum { KEY_OP_PUBLIC, KEY_OP_PRIVATE, KEY_OP_KEYGEN } oqsx_key_op_t; /// NID/name table @@ -54,10 +50,6 @@ static int oqsx_key_recreate_classickey(OQSX_KEY *key, oqsx_key_op_t op); ///// OQS_TEMPLATE_FRAGMENT_OQSNAMES_START - - - - #ifdef OQS_KEM_ENCODERS #define NID_TABLE_LEN 110 #else @@ -67,123 +59,147 @@ static int oqsx_key_recreate_classickey(OQSX_KEY *key, oqsx_key_op_t op); static oqs_nid_name_t nid_names[NID_TABLE_LEN] = { #ifdef OQS_KEM_ENCODERS - { 0, "frodo640aes", OQS_KEM_alg_frodokem_640_aes, KEY_TYPE_KEM, 128 }, - { 0, "p256_frodo640aes", OQS_KEM_alg_frodokem_640_aes, KEY_TYPE_ECP_HYB_KEM , 128 }, - { 0, "x25519_frodo640aes", OQS_KEM_alg_frodokem_640_aes, KEY_TYPE_ECX_HYB_KEM , 128 }, - { 0, "frodo640shake", OQS_KEM_alg_frodokem_640_shake, KEY_TYPE_KEM, 128 }, - { 0, "p256_frodo640shake", OQS_KEM_alg_frodokem_640_shake, KEY_TYPE_ECP_HYB_KEM , 128 }, - { 0, "x25519_frodo640shake", OQS_KEM_alg_frodokem_640_shake, KEY_TYPE_ECX_HYB_KEM , 128 }, - { 0, "frodo976aes", OQS_KEM_alg_frodokem_976_aes, KEY_TYPE_KEM, 192 }, - { 0, "p384_frodo976aes", OQS_KEM_alg_frodokem_976_aes, KEY_TYPE_ECP_HYB_KEM , 192 }, - { 0, "x448_frodo976aes", OQS_KEM_alg_frodokem_976_aes, KEY_TYPE_ECX_HYB_KEM , 192 }, - { 0, "frodo976shake", OQS_KEM_alg_frodokem_976_shake, KEY_TYPE_KEM, 192 }, - { 0, "p384_frodo976shake", OQS_KEM_alg_frodokem_976_shake, KEY_TYPE_ECP_HYB_KEM , 192 }, - { 0, "x448_frodo976shake", OQS_KEM_alg_frodokem_976_shake, KEY_TYPE_ECX_HYB_KEM , 192 }, - { 0, "frodo1344aes", OQS_KEM_alg_frodokem_1344_aes, KEY_TYPE_KEM, 256 }, - { 0, "p521_frodo1344aes", OQS_KEM_alg_frodokem_1344_aes, KEY_TYPE_ECP_HYB_KEM , 256 }, - { 0, "frodo1344shake", OQS_KEM_alg_frodokem_1344_shake, KEY_TYPE_KEM, 256 }, - { 0, "p521_frodo1344shake", OQS_KEM_alg_frodokem_1344_shake, KEY_TYPE_ECP_HYB_KEM , 256 }, - { 0, "kyber512", OQS_KEM_alg_kyber_512, KEY_TYPE_KEM, 128 }, - { 0, "p256_kyber512", OQS_KEM_alg_kyber_512, KEY_TYPE_ECP_HYB_KEM , 128 }, - { 0, "x25519_kyber512", OQS_KEM_alg_kyber_512, KEY_TYPE_ECX_HYB_KEM , 128 }, - { 0, "kyber768", OQS_KEM_alg_kyber_768, KEY_TYPE_KEM, 192 }, - { 0, "p384_kyber768", OQS_KEM_alg_kyber_768, KEY_TYPE_ECP_HYB_KEM , 192 }, - { 0, "x448_kyber768", OQS_KEM_alg_kyber_768, KEY_TYPE_ECX_HYB_KEM , 192 }, - { 0, "x25519_kyber768", OQS_KEM_alg_kyber_768, KEY_TYPE_ECX_HYB_KEM , 192 }, - { 0, "p256_kyber768", OQS_KEM_alg_kyber_768, KEY_TYPE_ECP_HYB_KEM , 192 }, - { 0, "kyber1024", OQS_KEM_alg_kyber_1024, KEY_TYPE_KEM, 256 }, - { 0, "p521_kyber1024", OQS_KEM_alg_kyber_1024, KEY_TYPE_ECP_HYB_KEM , 256 }, - { 0, "mlkem512", OQS_KEM_alg_ml_kem_512, KEY_TYPE_KEM, 128 }, - { 0, "p256_mlkem512", OQS_KEM_alg_ml_kem_512, KEY_TYPE_ECP_HYB_KEM , 128 }, - { 0, "x25519_mlkem512", OQS_KEM_alg_ml_kem_512, KEY_TYPE_ECX_HYB_KEM , 128 }, - { 0, "mlkem768", OQS_KEM_alg_ml_kem_768, KEY_TYPE_KEM, 192 }, - { 0, "p384_mlkem768", OQS_KEM_alg_ml_kem_768, KEY_TYPE_ECP_HYB_KEM , 192 }, - { 0, "x448_mlkem768", OQS_KEM_alg_ml_kem_768, KEY_TYPE_ECX_HYB_KEM , 192 }, - { 0, "x25519_mlkem768", OQS_KEM_alg_ml_kem_768, KEY_TYPE_ECX_HYB_KEM , 192 }, - { 0, "p256_mlkem768", OQS_KEM_alg_ml_kem_768, KEY_TYPE_ECP_HYB_KEM , 192 }, - { 0, "mlkem1024", OQS_KEM_alg_ml_kem_1024, KEY_TYPE_KEM, 256 }, - { 0, "p521_mlkem1024", OQS_KEM_alg_ml_kem_1024, KEY_TYPE_ECP_HYB_KEM , 256 }, - { 0, "p384_mlkem1024", OQS_KEM_alg_ml_kem_1024, KEY_TYPE_ECP_HYB_KEM , 256 }, - { 0, "bikel1", OQS_KEM_alg_bike_l1, KEY_TYPE_KEM, 128 }, - { 0, "p256_bikel1", OQS_KEM_alg_bike_l1, KEY_TYPE_ECP_HYB_KEM , 128 }, - { 0, "x25519_bikel1", OQS_KEM_alg_bike_l1, KEY_TYPE_ECX_HYB_KEM , 128 }, - { 0, "bikel3", OQS_KEM_alg_bike_l3, KEY_TYPE_KEM, 192 }, - { 0, "p384_bikel3", OQS_KEM_alg_bike_l3, KEY_TYPE_ECP_HYB_KEM , 192 }, - { 0, "x448_bikel3", OQS_KEM_alg_bike_l3, KEY_TYPE_ECX_HYB_KEM , 192 }, - { 0, "bikel5", OQS_KEM_alg_bike_l5, KEY_TYPE_KEM, 256 }, - { 0, "p521_bikel5", OQS_KEM_alg_bike_l5, KEY_TYPE_ECP_HYB_KEM , 256 }, - { 0, "hqc128", OQS_KEM_alg_hqc_128, KEY_TYPE_KEM, 128 }, - { 0, "p256_hqc128", OQS_KEM_alg_hqc_128, KEY_TYPE_ECP_HYB_KEM , 128 }, - { 0, "x25519_hqc128", OQS_KEM_alg_hqc_128, KEY_TYPE_ECX_HYB_KEM , 128 }, - { 0, "hqc192", OQS_KEM_alg_hqc_192, KEY_TYPE_KEM, 192 }, - { 0, "p384_hqc192", OQS_KEM_alg_hqc_192, KEY_TYPE_ECP_HYB_KEM , 192 }, - { 0, "x448_hqc192", OQS_KEM_alg_hqc_192, KEY_TYPE_ECX_HYB_KEM , 192 }, - { 0, "hqc256", OQS_KEM_alg_hqc_256, KEY_TYPE_KEM, 256 }, - { 0, "p521_hqc256", OQS_KEM_alg_hqc_256, KEY_TYPE_ECP_HYB_KEM , 256 }, + {0, "frodo640aes", OQS_KEM_alg_frodokem_640_aes, KEY_TYPE_KEM, 128}, + {0, "p256_frodo640aes", OQS_KEM_alg_frodokem_640_aes, KEY_TYPE_ECP_HYB_KEM, + 128}, + {0, "x25519_frodo640aes", OQS_KEM_alg_frodokem_640_aes, + KEY_TYPE_ECX_HYB_KEM, 128}, + {0, "frodo640shake", OQS_KEM_alg_frodokem_640_shake, KEY_TYPE_KEM, 128}, + {0, "p256_frodo640shake", OQS_KEM_alg_frodokem_640_shake, + KEY_TYPE_ECP_HYB_KEM, 128}, + {0, "x25519_frodo640shake", OQS_KEM_alg_frodokem_640_shake, + KEY_TYPE_ECX_HYB_KEM, 128}, + {0, "frodo976aes", OQS_KEM_alg_frodokem_976_aes, KEY_TYPE_KEM, 192}, + {0, "p384_frodo976aes", OQS_KEM_alg_frodokem_976_aes, KEY_TYPE_ECP_HYB_KEM, + 192}, + {0, "x448_frodo976aes", OQS_KEM_alg_frodokem_976_aes, KEY_TYPE_ECX_HYB_KEM, + 192}, + {0, "frodo976shake", OQS_KEM_alg_frodokem_976_shake, KEY_TYPE_KEM, 192}, + {0, "p384_frodo976shake", OQS_KEM_alg_frodokem_976_shake, + KEY_TYPE_ECP_HYB_KEM, 192}, + {0, "x448_frodo976shake", OQS_KEM_alg_frodokem_976_shake, + KEY_TYPE_ECX_HYB_KEM, 192}, + {0, "frodo1344aes", OQS_KEM_alg_frodokem_1344_aes, KEY_TYPE_KEM, 256}, + {0, "p521_frodo1344aes", OQS_KEM_alg_frodokem_1344_aes, + KEY_TYPE_ECP_HYB_KEM, 256}, + {0, "frodo1344shake", OQS_KEM_alg_frodokem_1344_shake, KEY_TYPE_KEM, 256}, + {0, "p521_frodo1344shake", OQS_KEM_alg_frodokem_1344_shake, + KEY_TYPE_ECP_HYB_KEM, 256}, + {0, "kyber512", OQS_KEM_alg_kyber_512, KEY_TYPE_KEM, 128}, + {0, "p256_kyber512", OQS_KEM_alg_kyber_512, KEY_TYPE_ECP_HYB_KEM, 128}, + {0, "x25519_kyber512", OQS_KEM_alg_kyber_512, KEY_TYPE_ECX_HYB_KEM, 128}, + {0, "kyber768", OQS_KEM_alg_kyber_768, KEY_TYPE_KEM, 192}, + {0, "p384_kyber768", OQS_KEM_alg_kyber_768, KEY_TYPE_ECP_HYB_KEM, 192}, + {0, "x448_kyber768", OQS_KEM_alg_kyber_768, KEY_TYPE_ECX_HYB_KEM, 192}, + {0, "x25519_kyber768", OQS_KEM_alg_kyber_768, KEY_TYPE_ECX_HYB_KEM, 192}, + {0, "p256_kyber768", OQS_KEM_alg_kyber_768, KEY_TYPE_ECP_HYB_KEM, 192}, + {0, "kyber1024", OQS_KEM_alg_kyber_1024, KEY_TYPE_KEM, 256}, + {0, "p521_kyber1024", OQS_KEM_alg_kyber_1024, KEY_TYPE_ECP_HYB_KEM, 256}, + {0, "mlkem512", OQS_KEM_alg_ml_kem_512, KEY_TYPE_KEM, 128}, + {0, "p256_mlkem512", OQS_KEM_alg_ml_kem_512, KEY_TYPE_ECP_HYB_KEM, 128}, + {0, "x25519_mlkem512", OQS_KEM_alg_ml_kem_512, KEY_TYPE_ECX_HYB_KEM, 128}, + {0, "mlkem768", OQS_KEM_alg_ml_kem_768, KEY_TYPE_KEM, 192}, + {0, "p384_mlkem768", OQS_KEM_alg_ml_kem_768, KEY_TYPE_ECP_HYB_KEM, 192}, + {0, "x448_mlkem768", OQS_KEM_alg_ml_kem_768, KEY_TYPE_ECX_HYB_KEM, 192}, + {0, "x25519_mlkem768", OQS_KEM_alg_ml_kem_768, KEY_TYPE_ECX_HYB_KEM, 192}, + {0, "p256_mlkem768", OQS_KEM_alg_ml_kem_768, KEY_TYPE_ECP_HYB_KEM, 192}, + {0, "mlkem1024", OQS_KEM_alg_ml_kem_1024, KEY_TYPE_KEM, 256}, + {0, "p521_mlkem1024", OQS_KEM_alg_ml_kem_1024, KEY_TYPE_ECP_HYB_KEM, 256}, + {0, "p384_mlkem1024", OQS_KEM_alg_ml_kem_1024, KEY_TYPE_ECP_HYB_KEM, 256}, + {0, "bikel1", OQS_KEM_alg_bike_l1, KEY_TYPE_KEM, 128}, + {0, "p256_bikel1", OQS_KEM_alg_bike_l1, KEY_TYPE_ECP_HYB_KEM, 128}, + {0, "x25519_bikel1", OQS_KEM_alg_bike_l1, KEY_TYPE_ECX_HYB_KEM, 128}, + {0, "bikel3", OQS_KEM_alg_bike_l3, KEY_TYPE_KEM, 192}, + {0, "p384_bikel3", OQS_KEM_alg_bike_l3, KEY_TYPE_ECP_HYB_KEM, 192}, + {0, "x448_bikel3", OQS_KEM_alg_bike_l3, KEY_TYPE_ECX_HYB_KEM, 192}, + {0, "bikel5", OQS_KEM_alg_bike_l5, KEY_TYPE_KEM, 256}, + {0, "p521_bikel5", OQS_KEM_alg_bike_l5, KEY_TYPE_ECP_HYB_KEM, 256}, + {0, "hqc128", OQS_KEM_alg_hqc_128, KEY_TYPE_KEM, 128}, + {0, "p256_hqc128", OQS_KEM_alg_hqc_128, KEY_TYPE_ECP_HYB_KEM, 128}, + {0, "x25519_hqc128", OQS_KEM_alg_hqc_128, KEY_TYPE_ECX_HYB_KEM, 128}, + {0, "hqc192", OQS_KEM_alg_hqc_192, KEY_TYPE_KEM, 192}, + {0, "p384_hqc192", OQS_KEM_alg_hqc_192, KEY_TYPE_ECP_HYB_KEM, 192}, + {0, "x448_hqc192", OQS_KEM_alg_hqc_192, KEY_TYPE_ECX_HYB_KEM, 192}, + {0, "hqc256", OQS_KEM_alg_hqc_256, KEY_TYPE_KEM, 256}, + {0, "p521_hqc256", OQS_KEM_alg_hqc_256, KEY_TYPE_ECP_HYB_KEM, 256}, #endif /* OQS_KEM_ENCODERS */ - { 0, "dilithium2", OQS_SIG_alg_dilithium_2, KEY_TYPE_SIG, 128 }, - { 0, "p256_dilithium2", OQS_SIG_alg_dilithium_2, KEY_TYPE_HYB_SIG, 128 }, - { 0, "rsa3072_dilithium2", OQS_SIG_alg_dilithium_2, KEY_TYPE_HYB_SIG, 128 }, - { 0, "dilithium3", OQS_SIG_alg_dilithium_3, KEY_TYPE_SIG, 192 }, - { 0, "p384_dilithium3", OQS_SIG_alg_dilithium_3, KEY_TYPE_HYB_SIG, 192 }, - { 0, "dilithium5", OQS_SIG_alg_dilithium_5, KEY_TYPE_SIG, 256 }, - { 0, "p521_dilithium5", OQS_SIG_alg_dilithium_5, KEY_TYPE_HYB_SIG, 256 }, - { 0, "mldsa44", OQS_SIG_alg_ml_dsa_44, KEY_TYPE_SIG, 128 }, - { 0, "p256_mldsa44", OQS_SIG_alg_ml_dsa_44, KEY_TYPE_HYB_SIG, 128 }, - { 0, "rsa3072_mldsa44", OQS_SIG_alg_ml_dsa_44, KEY_TYPE_HYB_SIG, 128 }, - { 0, "mldsa44_pss2048", OQS_SIG_alg_ml_dsa_44, KEY_TYPE_CMP_SIG, 112 }, - { 0, "mldsa44_rsa2048", OQS_SIG_alg_ml_dsa_44, KEY_TYPE_CMP_SIG, 112 }, - { 0, "mldsa44_ed25519", OQS_SIG_alg_ml_dsa_44, KEY_TYPE_CMP_SIG, 128 }, - { 0, "mldsa44_p256", OQS_SIG_alg_ml_dsa_44, KEY_TYPE_CMP_SIG, 128 }, - { 0, "mldsa44_bp256", OQS_SIG_alg_ml_dsa_44, KEY_TYPE_CMP_SIG, 256 }, - { 0, "mldsa65", OQS_SIG_alg_ml_dsa_65, KEY_TYPE_SIG, 192 }, - { 0, "p384_mldsa65", OQS_SIG_alg_ml_dsa_65, KEY_TYPE_HYB_SIG, 192 }, - { 0, "mldsa65_pss3072", OQS_SIG_alg_ml_dsa_65, KEY_TYPE_CMP_SIG, 128 }, - { 0, "mldsa65_rsa3072", OQS_SIG_alg_ml_dsa_65, KEY_TYPE_CMP_SIG, 128 }, - { 0, "mldsa65_p256", OQS_SIG_alg_ml_dsa_65, KEY_TYPE_CMP_SIG, 128 }, - { 0, "mldsa65_bp256", OQS_SIG_alg_ml_dsa_65, KEY_TYPE_CMP_SIG, 256 }, - { 0, "mldsa65_ed25519", OQS_SIG_alg_ml_dsa_65, KEY_TYPE_CMP_SIG, 128 }, - { 0, "mldsa87", OQS_SIG_alg_ml_dsa_87, KEY_TYPE_SIG, 256 }, - { 0, "p521_mldsa87", OQS_SIG_alg_ml_dsa_87, KEY_TYPE_HYB_SIG, 256 }, - { 0, "mldsa87_p384", OQS_SIG_alg_ml_dsa_87, KEY_TYPE_CMP_SIG, 192 }, - { 0, "mldsa87_bp384", OQS_SIG_alg_ml_dsa_87, KEY_TYPE_CMP_SIG, 384 }, - { 0, "mldsa87_ed448", OQS_SIG_alg_ml_dsa_87, KEY_TYPE_CMP_SIG, 192 }, - { 0, "falcon512", OQS_SIG_alg_falcon_512, KEY_TYPE_SIG, 128 }, - { 0, "p256_falcon512", OQS_SIG_alg_falcon_512, KEY_TYPE_HYB_SIG, 128 }, - { 0, "rsa3072_falcon512", OQS_SIG_alg_falcon_512, KEY_TYPE_HYB_SIG, 128 }, - { 0, "falconpadded512", OQS_SIG_alg_falcon_padded_512, KEY_TYPE_SIG, 128 }, - { 0, "p256_falconpadded512", OQS_SIG_alg_falcon_padded_512, KEY_TYPE_HYB_SIG, 128 }, - { 0, "rsa3072_falconpadded512", OQS_SIG_alg_falcon_padded_512, KEY_TYPE_HYB_SIG, 128 }, - { 0, "falcon1024", OQS_SIG_alg_falcon_1024, KEY_TYPE_SIG, 256 }, - { 0, "p521_falcon1024", OQS_SIG_alg_falcon_1024, KEY_TYPE_HYB_SIG, 256 }, - { 0, "falconpadded1024", OQS_SIG_alg_falcon_padded_1024, KEY_TYPE_SIG, 256 }, - { 0, "p521_falconpadded1024", OQS_SIG_alg_falcon_padded_1024, KEY_TYPE_HYB_SIG, 256 }, - { 0, "sphincssha2128fsimple", OQS_SIG_alg_sphincs_sha2_128f_simple, KEY_TYPE_SIG, 128 }, - { 0, "p256_sphincssha2128fsimple", OQS_SIG_alg_sphincs_sha2_128f_simple, KEY_TYPE_HYB_SIG, 128 }, - { 0, "rsa3072_sphincssha2128fsimple", OQS_SIG_alg_sphincs_sha2_128f_simple, KEY_TYPE_HYB_SIG, 128 }, - { 0, "sphincssha2128ssimple", OQS_SIG_alg_sphincs_sha2_128s_simple, KEY_TYPE_SIG, 128 }, - { 0, "p256_sphincssha2128ssimple", OQS_SIG_alg_sphincs_sha2_128s_simple, KEY_TYPE_HYB_SIG, 128 }, - { 0, "rsa3072_sphincssha2128ssimple", OQS_SIG_alg_sphincs_sha2_128s_simple, KEY_TYPE_HYB_SIG, 128 }, - { 0, "sphincssha2192fsimple", OQS_SIG_alg_sphincs_sha2_192f_simple, KEY_TYPE_SIG, 192 }, - { 0, "p384_sphincssha2192fsimple", OQS_SIG_alg_sphincs_sha2_192f_simple, KEY_TYPE_HYB_SIG, 192 }, - { 0, "sphincsshake128fsimple", OQS_SIG_alg_sphincs_shake_128f_simple, KEY_TYPE_SIG, 128 }, - { 0, "p256_sphincsshake128fsimple", OQS_SIG_alg_sphincs_shake_128f_simple, KEY_TYPE_HYB_SIG, 128 }, - { 0, "rsa3072_sphincsshake128fsimple", OQS_SIG_alg_sphincs_shake_128f_simple, KEY_TYPE_HYB_SIG, 128 }, - { 0, "mayo1", OQS_SIG_alg_mayo_1, KEY_TYPE_SIG, 128 }, - { 0, "p256_mayo1", OQS_SIG_alg_mayo_1, KEY_TYPE_HYB_SIG, 128 }, - { 0, "mayo2", OQS_SIG_alg_mayo_2, KEY_TYPE_SIG, 128 }, - { 0, "p256_mayo2", OQS_SIG_alg_mayo_2, KEY_TYPE_HYB_SIG, 128 }, - { 0, "mayo3", OQS_SIG_alg_mayo_3, KEY_TYPE_SIG, 192 }, - { 0, "p384_mayo3", OQS_SIG_alg_mayo_3, KEY_TYPE_HYB_SIG, 192 }, - { 0, "mayo5", OQS_SIG_alg_mayo_5, KEY_TYPE_SIG, 256 }, - { 0, "p521_mayo5", OQS_SIG_alg_mayo_5, KEY_TYPE_HYB_SIG, 256 }, - { 0, "CROSSrsdp128balanced", OQS_SIG_alg_cross_rsdp_128_balanced, KEY_TYPE_SIG, 128 }, -///// OQS_TEMPLATE_FRAGMENT_OQSNAMES_END + {0, "dilithium2", OQS_SIG_alg_dilithium_2, KEY_TYPE_SIG, 128}, + {0, "p256_dilithium2", OQS_SIG_alg_dilithium_2, KEY_TYPE_HYB_SIG, 128}, + {0, "rsa3072_dilithium2", OQS_SIG_alg_dilithium_2, KEY_TYPE_HYB_SIG, 128}, + {0, "dilithium3", OQS_SIG_alg_dilithium_3, KEY_TYPE_SIG, 192}, + {0, "p384_dilithium3", OQS_SIG_alg_dilithium_3, KEY_TYPE_HYB_SIG, 192}, + {0, "dilithium5", OQS_SIG_alg_dilithium_5, KEY_TYPE_SIG, 256}, + {0, "p521_dilithium5", OQS_SIG_alg_dilithium_5, KEY_TYPE_HYB_SIG, 256}, + {0, "mldsa44", OQS_SIG_alg_ml_dsa_44, KEY_TYPE_SIG, 128}, + {0, "p256_mldsa44", OQS_SIG_alg_ml_dsa_44, KEY_TYPE_HYB_SIG, 128}, + {0, "rsa3072_mldsa44", OQS_SIG_alg_ml_dsa_44, KEY_TYPE_HYB_SIG, 128}, + {0, "mldsa44_pss2048", OQS_SIG_alg_ml_dsa_44, KEY_TYPE_CMP_SIG, 112}, + {0, "mldsa44_rsa2048", OQS_SIG_alg_ml_dsa_44, KEY_TYPE_CMP_SIG, 112}, + {0, "mldsa44_ed25519", OQS_SIG_alg_ml_dsa_44, KEY_TYPE_CMP_SIG, 128}, + {0, "mldsa44_p256", OQS_SIG_alg_ml_dsa_44, KEY_TYPE_CMP_SIG, 128}, + {0, "mldsa44_bp256", OQS_SIG_alg_ml_dsa_44, KEY_TYPE_CMP_SIG, 256}, + {0, "mldsa65", OQS_SIG_alg_ml_dsa_65, KEY_TYPE_SIG, 192}, + {0, "p384_mldsa65", OQS_SIG_alg_ml_dsa_65, KEY_TYPE_HYB_SIG, 192}, + {0, "mldsa65_pss3072", OQS_SIG_alg_ml_dsa_65, KEY_TYPE_CMP_SIG, 128}, + {0, "mldsa65_rsa3072", OQS_SIG_alg_ml_dsa_65, KEY_TYPE_CMP_SIG, 128}, + {0, "mldsa65_p256", OQS_SIG_alg_ml_dsa_65, KEY_TYPE_CMP_SIG, 128}, + {0, "mldsa65_bp256", OQS_SIG_alg_ml_dsa_65, KEY_TYPE_CMP_SIG, 256}, + {0, "mldsa65_ed25519", OQS_SIG_alg_ml_dsa_65, KEY_TYPE_CMP_SIG, 128}, + {0, "mldsa87", OQS_SIG_alg_ml_dsa_87, KEY_TYPE_SIG, 256}, + {0, "p521_mldsa87", OQS_SIG_alg_ml_dsa_87, KEY_TYPE_HYB_SIG, 256}, + {0, "mldsa87_p384", OQS_SIG_alg_ml_dsa_87, KEY_TYPE_CMP_SIG, 192}, + {0, "mldsa87_bp384", OQS_SIG_alg_ml_dsa_87, KEY_TYPE_CMP_SIG, 384}, + {0, "mldsa87_ed448", OQS_SIG_alg_ml_dsa_87, KEY_TYPE_CMP_SIG, 192}, + {0, "falcon512", OQS_SIG_alg_falcon_512, KEY_TYPE_SIG, 128}, + {0, "p256_falcon512", OQS_SIG_alg_falcon_512, KEY_TYPE_HYB_SIG, 128}, + {0, "rsa3072_falcon512", OQS_SIG_alg_falcon_512, KEY_TYPE_HYB_SIG, 128}, + {0, "falconpadded512", OQS_SIG_alg_falcon_padded_512, KEY_TYPE_SIG, 128}, + {0, "p256_falconpadded512", OQS_SIG_alg_falcon_padded_512, KEY_TYPE_HYB_SIG, + 128}, + {0, "rsa3072_falconpadded512", OQS_SIG_alg_falcon_padded_512, + KEY_TYPE_HYB_SIG, 128}, + {0, "falcon1024", OQS_SIG_alg_falcon_1024, KEY_TYPE_SIG, 256}, + {0, "p521_falcon1024", OQS_SIG_alg_falcon_1024, KEY_TYPE_HYB_SIG, 256}, + {0, "falconpadded1024", OQS_SIG_alg_falcon_padded_1024, KEY_TYPE_SIG, 256}, + {0, "p521_falconpadded1024", OQS_SIG_alg_falcon_padded_1024, + KEY_TYPE_HYB_SIG, 256}, + {0, "sphincssha2128fsimple", OQS_SIG_alg_sphincs_sha2_128f_simple, + KEY_TYPE_SIG, 128}, + {0, "p256_sphincssha2128fsimple", OQS_SIG_alg_sphincs_sha2_128f_simple, + KEY_TYPE_HYB_SIG, 128}, + {0, "rsa3072_sphincssha2128fsimple", OQS_SIG_alg_sphincs_sha2_128f_simple, + KEY_TYPE_HYB_SIG, 128}, + {0, "sphincssha2128ssimple", OQS_SIG_alg_sphincs_sha2_128s_simple, + KEY_TYPE_SIG, 128}, + {0, "p256_sphincssha2128ssimple", OQS_SIG_alg_sphincs_sha2_128s_simple, + KEY_TYPE_HYB_SIG, 128}, + {0, "rsa3072_sphincssha2128ssimple", OQS_SIG_alg_sphincs_sha2_128s_simple, + KEY_TYPE_HYB_SIG, 128}, + {0, "sphincssha2192fsimple", OQS_SIG_alg_sphincs_sha2_192f_simple, + KEY_TYPE_SIG, 192}, + {0, "p384_sphincssha2192fsimple", OQS_SIG_alg_sphincs_sha2_192f_simple, + KEY_TYPE_HYB_SIG, 192}, + {0, "sphincsshake128fsimple", OQS_SIG_alg_sphincs_shake_128f_simple, + KEY_TYPE_SIG, 128}, + {0, "p256_sphincsshake128fsimple", OQS_SIG_alg_sphincs_shake_128f_simple, + KEY_TYPE_HYB_SIG, 128}, + {0, "rsa3072_sphincsshake128fsimple", OQS_SIG_alg_sphincs_shake_128f_simple, + KEY_TYPE_HYB_SIG, 128}, + {0, "mayo1", OQS_SIG_alg_mayo_1, KEY_TYPE_SIG, 128}, + {0, "p256_mayo1", OQS_SIG_alg_mayo_1, KEY_TYPE_HYB_SIG, 128}, + {0, "mayo2", OQS_SIG_alg_mayo_2, KEY_TYPE_SIG, 128}, + {0, "p256_mayo2", OQS_SIG_alg_mayo_2, KEY_TYPE_HYB_SIG, 128}, + {0, "mayo3", OQS_SIG_alg_mayo_3, KEY_TYPE_SIG, 192}, + {0, "p384_mayo3", OQS_SIG_alg_mayo_3, KEY_TYPE_HYB_SIG, 192}, + {0, "mayo5", OQS_SIG_alg_mayo_5, KEY_TYPE_SIG, 256}, + {0, "p521_mayo5", OQS_SIG_alg_mayo_5, KEY_TYPE_HYB_SIG, 256}, + {0, "CROSSrsdp128balanced", OQS_SIG_alg_cross_rsdp_128_balanced, + KEY_TYPE_SIG, 128}, + ///// OQS_TEMPLATE_FRAGMENT_OQSNAMES_END }; -int oqs_set_nid(char *tlsname, int nid) -{ +int oqs_set_nid(char *tlsname, int nid) { int i; for (i = 0; i < NID_TABLE_LEN; i++) { if (!strcmp(nid_names[i].tlsname, tlsname)) { @@ -194,8 +210,7 @@ int oqs_set_nid(char *tlsname, int nid) return 0; } -static int get_secbits(int nid) -{ +static int get_secbits(int nid) { int i; for (i = 0; i < NID_TABLE_LEN; i++) { if (nid_names[i].nid == nid) @@ -204,8 +219,7 @@ static int get_secbits(int nid) return 0; } -static int get_keytype(int nid) -{ +static int get_keytype(int nid) { int i; for (i = 0; i < NID_TABLE_LEN; i++) { if (nid_names[i].nid == nid) @@ -214,21 +228,19 @@ static int get_keytype(int nid) return 0; } -char *get_oqsname_fromtls(char *tlsname) -{ +char *get_oqsname_fromtls(char *tlsname) { int i; for (i = 0; i < NID_TABLE_LEN; i++) { if (nid_names[i].keytype == KEY_TYPE_SIG) { - if (!strcmp(nid_names[i].oqsname, tlsname) - || !strcmp(nid_names[i].tlsname, tlsname)) + if (!strcmp(nid_names[i].oqsname, tlsname) || + !strcmp(nid_names[i].tlsname, tlsname)) return nid_names[i].oqsname; } } return 0; // classical } -char *get_oqsname(int nid) -{ +char *get_oqsname(int nid) { int i; for (i = 0; i < NID_TABLE_LEN; i++) { if (nid_names[i].nid == nid) @@ -237,8 +249,7 @@ char *get_oqsname(int nid) return 0; } -char *get_cmpname(int nid, int index) -{ +char *get_cmpname(int nid, int index) { int i, len; char *name, *s; if ((i = get_oqsalg_idx(nid)) == -1) @@ -265,8 +276,7 @@ char *get_cmpname(int nid, int index) return name; } -int get_oqsalg_idx(int nid) -{ +int get_oqsalg_idx(int nid) { int i; for (i = 0; i < NID_TABLE_LEN; i++) { if (nid_names[i].nid == nid) @@ -276,8 +286,7 @@ int get_oqsalg_idx(int nid) } /* Prepare composite data structures. RetVal 0 is error. */ -static int oqsx_key_set_composites(OQSX_KEY *key) -{ +static int oqsx_key_set_composites(OQSX_KEY *key) { int ret = 1; OQS_KEY_PRINTF2("Setting composites with evp_info %p\n", key->evp_info); @@ -316,8 +325,8 @@ static int oqsx_key_set_composites(OQSX_KEY *key) ERR_raise(ERR_LIB_USER, OQSPROV_R_INVALID_ENCODING); goto err; } - key->comp_privkey[1] = (char *)key->privkey - + classic_privkey_len + SIZE_OF_UINT32; + key->comp_privkey[1] = + (char *)key->privkey + classic_privkey_len + SIZE_OF_UINT32; } else { key->comp_privkey[0] = NULL; key->comp_privkey[1] = NULL; @@ -329,8 +338,8 @@ static int oqsx_key_set_composites(OQSX_KEY *key) ERR_raise(ERR_LIB_USER, OQSPROV_R_INVALID_ENCODING); goto err; } - key->comp_pubkey[1] - = (char *)key->pubkey + classic_pubkey_len + SIZE_OF_UINT32; + key->comp_pubkey[1] = + (char *)key->pubkey + classic_pubkey_len + SIZE_OF_UINT32; } else { key->comp_pubkey[0] = NULL; key->comp_pubkey[1] = NULL; @@ -342,8 +351,7 @@ static int oqsx_key_set_composites(OQSX_KEY *key) } PROV_OQS_CTX *oqsx_newprovctx(OSSL_LIB_CTX *libctx, - const OSSL_CORE_HANDLE *handle, BIO_METHOD *bm) -{ + const OSSL_CORE_HANDLE *handle, BIO_METHOD *bm) { PROV_OQS_CTX *ret = OPENSSL_zalloc(sizeof(PROV_OQS_CTX)); if (ret) { ret->libctx = libctx; @@ -353,22 +361,19 @@ PROV_OQS_CTX *oqsx_newprovctx(OSSL_LIB_CTX *libctx, return ret; } -void oqsx_freeprovctx(PROV_OQS_CTX *ctx) -{ +void oqsx_freeprovctx(PROV_OQS_CTX *ctx) { OSSL_LIB_CTX_free(ctx->libctx); BIO_meth_free(ctx->corebiometh); OPENSSL_free(ctx); } -void oqsx_key_set0_libctx(OQSX_KEY *key, OSSL_LIB_CTX *libctx) -{ +void oqsx_key_set0_libctx(OQSX_KEY *key, OSSL_LIB_CTX *libctx) { key->libctx = libctx; } /* convenience function creating OQSX keys from nids (only for sigs) */ static OQSX_KEY *oqsx_key_new_from_nid(OSSL_LIB_CTX *libctx, const char *propq, - int nid) -{ + int nid) { OQS_KEY_PRINTF2("Generating OQSX key for nid %d\n", nid); char *tls_algname = (char *)OBJ_nid2sn(nid); @@ -386,18 +391,17 @@ static OQSX_KEY *oqsx_key_new_from_nid(OSSL_LIB_CTX *libctx, const char *propq, /* Workaround for not functioning EC PARAM initialization * TBD, check https://github.com/openssl/openssl/issues/16989 */ -EVP_PKEY *setECParams(EVP_PKEY *eck, int nid) -{ - const unsigned char p256params[] - = {0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x03, 0x01, 0x07}; - const unsigned char p384params[] - = {0x06, 0x05, 0x2b, 0x81, 0x04, 0x00, 0x22}; - const unsigned char p521params[] - = {0x06, 0x05, 0x2b, 0x81, 0x04, 0x00, 0x23}; - const char bp256params[] - = {0x06, 0x09, 0x2b, 0x24, 0x03, 0x03, 0x02, 0x08, 0x01, 0x01, 0x07}; - const char bp384params[] - = {0x06, 0x09, 0x2b, 0x24, 0x03, 0x03, 0x02, 0x08, 0x01, 0x01, 0x0b}; +EVP_PKEY *setECParams(EVP_PKEY *eck, int nid) { + const unsigned char p256params[] = {0x06, 0x08, 0x2a, 0x86, 0x48, + 0xce, 0x3d, 0x03, 0x01, 0x07}; + const unsigned char p384params[] = {0x06, 0x05, 0x2b, 0x81, + 0x04, 0x00, 0x22}; + const unsigned char p521params[] = {0x06, 0x05, 0x2b, 0x81, + 0x04, 0x00, 0x23}; + const char bp256params[] = {0x06, 0x09, 0x2b, 0x24, 0x03, 0x03, + 0x02, 0x08, 0x01, 0x01, 0x07}; + const char bp384params[] = {0x06, 0x09, 0x2b, 0x24, 0x03, 0x03, + 0x02, 0x08, 0x01, 0x01, 0x0b}; const unsigned char *params; switch (nid) { @@ -454,8 +458,7 @@ static const OQSX_EVP_INFO nids_ecx[] = { }; static int oqsx_hybsig_init(int bit_security, OQSX_EVP_CTX *evp_ctx, - char *algname) -{ + char *algname) { int ret = 1; int idx = (bit_security - 128) / 64; ON_ERR_GOTO(idx < 0 || idx > 5, err_init); @@ -518,8 +521,7 @@ static int oqsx_hybsig_init(int bit_security, OQSX_EVP_CTX *evp_ctx, return ret; } -static const int oqshybkem_init_ecp(char *tls_name, OQSX_EVP_CTX *evp_ctx) -{ +static const int oqshybkem_init_ecp(char *tls_name, OQSX_EVP_CTX *evp_ctx) { int ret = 1; int idx = 0; while (idx < OSSL_NELEM(OQSX_ECP_NAMES)) { @@ -548,8 +550,7 @@ static const int oqshybkem_init_ecp(char *tls_name, OQSX_EVP_CTX *evp_ctx) return ret; } -static const int oqshybkem_init_ecx(char *tls_name, OQSX_EVP_CTX *evp_ctx) -{ +static const int oqshybkem_init_ecx(char *tls_name, OQSX_EVP_CTX *evp_ctx) { int ret = 1; int idx = 0; @@ -578,8 +579,7 @@ static const int oqshybkem_init_ecx(char *tls_name, OQSX_EVP_CTX *evp_ctx) /* Re-create OQSX_KEY from encoding(s): Same end-state as after ken-gen */ static OQSX_KEY *oqsx_key_op(const X509_ALGOR *palg, const unsigned char *p, int plen, oqsx_key_op_t op, OSSL_LIB_CTX *libctx, - const char *propq) -{ + const char *propq) { OQSX_KEY *key = NULL; void **privkey, **pubkey; int nid = NID_undef; @@ -612,12 +612,12 @@ static OQSX_KEY *oqsx_key_op(const X509_ALGOR *palg, const unsigned char *p, if (op == KEY_OP_PUBLIC) { #ifdef USE_ENCODING_LIB - if (key->oqsx_encoding_ctx.encoding_ctx - && key->oqsx_encoding_ctx.encoding_impl) { - key->pubkeylen = key->oqsx_encoding_ctx.encoding_ctx - ->raw_crypto_publickeybytes; - if (key->oqsx_encoding_ctx.encoding_impl->crypto_publickeybytes - != plen) { + if (key->oqsx_encoding_ctx.encoding_ctx && + key->oqsx_encoding_ctx.encoding_impl) { + key->pubkeylen = + key->oqsx_encoding_ctx.encoding_ctx->raw_crypto_publickeybytes; + if (key->oqsx_encoding_ctx.encoding_impl->crypto_publickeybytes != + plen) { ERR_raise(ERR_LIB_USER, OQSPROV_R_INVALID_ENCODING); goto err_key_op; } @@ -627,8 +627,8 @@ static OQSX_KEY *oqsx_key_op(const X509_ALGOR *palg, const unsigned char *p, } if (qsc_decode(key->oqsx_encoding_ctx.encoding_ctx, key->oqsx_encoding_ctx.encoding_impl, p, - (unsigned char **)&key->pubkey, 0, 0, 1) - != QSC_ENC_OK) { + (unsigned char **)&key->pubkey, 0, 0, + 1) != QSC_ENC_OK) { ERR_raise(ERR_LIB_USER, OQSPROV_R_INVALID_ENCODING); goto err_key_op; } @@ -665,8 +665,8 @@ static OQSX_KEY *oqsx_key_op(const X509_ALGOR *palg, const unsigned char *p, // check if key is the right size for (i = 0; i < key->numkeys; i++) { char *name; - if ((name = get_cmpname(OBJ_sn2nid(key->tls_name), i)) - == NULL) { + if ((name = get_cmpname(OBJ_sn2nid(key->tls_name), i)) == + NULL) { ERR_raise(ERR_LIB_USER, OQSPROV_R_INVALID_ENCODING); goto err_key_op; } @@ -706,8 +706,8 @@ static OQSX_KEY *oqsx_key_op(const X509_ALGOR *palg, const unsigned char *p, for (i = 0; i < key->numkeys; i++) { size_t classic_publen = 0; char *name; - if ((name = get_cmpname(OBJ_sn2nid(key->tls_name), i)) - == NULL) { + if ((name = get_cmpname(OBJ_sn2nid(key->tls_name), i)) == + NULL) { ERR_raise(ERR_LIB_USER, OQSPROV_R_INVALID_ENCODING); OPENSSL_secure_clear_free(temp_priv, temp_priv_len); OPENSSL_secure_clear_free(temp_pub, temp_pub_len); @@ -716,8 +716,9 @@ static OQSX_KEY *oqsx_key_op(const X509_ALGOR *palg, const unsigned char *p, if (get_oqsname_fromtls(name) == 0) { // classical key publen = 0; // no pubkey encoded with privkey on classical // keys. will recreate the pubkey later - if (key->oqsx_provider_ctx.oqsx_evp_ctx->evp_info->keytype - == EVP_PKEY_RSA) { // get the RSA real key size + if (key->oqsx_provider_ctx.oqsx_evp_ctx->evp_info + ->keytype == + EVP_PKEY_RSA) { // get the RSA real key size if (previous_privlen + previous_publen + 4 > plen) { OPENSSL_free(name); OPENSSL_secure_clear_free(temp_priv, temp_priv_len); @@ -770,26 +771,26 @@ static OQSX_KEY *oqsx_key_op(const X509_ALGOR *palg, const unsigned char *p, OPENSSL_secure_clear_free(temp_pub, temp_pub_len); } else { if (key->numkeys == 2) { - size_t expected_pq_privkey_len - = key->oqsx_provider_ctx.oqsx_qs_ctx.kem->length_secret_key; + size_t expected_pq_privkey_len = + key->oqsx_provider_ctx.oqsx_qs_ctx.kem->length_secret_key; #ifndef NOPUBKEY_IN_PRIVKEY - expected_pq_privkey_len += key->oqsx_provider_ctx.oqsx_qs_ctx - .kem->length_public_key; + expected_pq_privkey_len += + key->oqsx_provider_ctx.oqsx_qs_ctx.kem->length_public_key; #endif if (plen > (SIZE_OF_UINT32 + expected_pq_privkey_len)) { - size_t max_classical_privkey_len - = key->evp_info->length_private_key; - size_t space_for_classical_privkey - = plen - expected_pq_privkey_len - SIZE_OF_UINT32; - if (space_for_classical_privkey - > max_classical_privkey_len) { + size_t max_classical_privkey_len = + key->evp_info->length_private_key; + size_t space_for_classical_privkey = + plen - expected_pq_privkey_len - SIZE_OF_UINT32; + if (space_for_classical_privkey > + max_classical_privkey_len) { ERR_raise(ERR_LIB_USER, OQSPROV_R_INVALID_ENCODING); goto err_key_op; } DECODE_UINT32(classical_privatekey_len, p); // actual classic key len - if (classical_privatekey_len - != space_for_classical_privkey) { + if (classical_privatekey_len != + space_for_classical_privkey) { ERR_raise(ERR_LIB_USER, OQSPROV_R_INVALID_ENCODING); goto err_key_op; } @@ -797,23 +798,22 @@ static OQSX_KEY *oqsx_key_op(const X509_ALGOR *palg, const unsigned char *p, ERR_raise(ERR_LIB_USER, OQSPROV_R_INVALID_ENCODING); goto err_key_op; } - actualprivkeylen -= (key->evp_info->length_private_key - - classical_privatekey_len); + actualprivkeylen -= (key->evp_info->length_private_key - + classical_privatekey_len); } #ifdef USE_ENCODING_LIB - if (key->oqsx_encoding_ctx.encoding_ctx - && key->oqsx_encoding_ctx.encoding_impl) { - const qsc_encoding_t *encoding_ctx - = key->oqsx_encoding_ctx.encoding_ctx; -# ifdef NOPUBKEY_IN_PRIVKEY + if (key->oqsx_encoding_ctx.encoding_ctx && + key->oqsx_encoding_ctx.encoding_impl) { + const qsc_encoding_t *encoding_ctx = + key->oqsx_encoding_ctx.encoding_ctx; +#ifdef NOPUBKEY_IN_PRIVKEY // if the raw private key includes the public key, the optional // part is needed, otherwise not. - int withoptional - = (encoding_ctx->raw_private_key_encodes_public_key ? 1 - : 0); -# else + int withoptional = + (encoding_ctx->raw_private_key_encodes_public_key ? 1 : 0); +#else int withoptional = 1; -# endif +#endif int pubkey_available = withoptional; if (oqsx_key_allocate_keymaterial(key, 1)) { ERR_raise(ERR_LIB_USER, ERR_R_MALLOC_FAILURE); @@ -829,8 +829,8 @@ static OQSX_KEY *oqsx_key_op(const X509_ALGOR *palg, const unsigned char *p, if (qsc_decode( encoding_ctx, key->oqsx_encoding_ctx.encoding_impl, 0, (pubkey_available ? (unsigned char **)&key->pubkey : 0), - p, (unsigned char **)&key->privkey, withoptional) - != QSC_ENC_OK) { + p, (unsigned char **)&key->privkey, + withoptional) != QSC_ENC_OK) { ERR_raise(ERR_LIB_USER, OQSPROV_R_INVALID_ENCODING); goto err_key_op; } @@ -839,17 +839,17 @@ static OQSX_KEY *oqsx_key_op(const X509_ALGOR *palg, const unsigned char *p, #endif #ifdef NOPUBKEY_IN_PRIVKEY if (actualprivkeylen != plen) { - OQS_KEY_PRINTF3( - "OQSX KEY: private key with unexpected length %d vs %d\n", - plen, (int)(actualprivkeylen)); + OQS_KEY_PRINTF3("OQSX KEY: private key with unexpected " + "length %d vs %d\n", + plen, (int)(actualprivkeylen)); #else - if (actualprivkeylen + oqsx_key_get_oqs_public_key_len(key) - != plen) { + if (actualprivkeylen + oqsx_key_get_oqs_public_key_len(key) != + plen) { OQS_KEY_PRINTF3( "OQSX KEY: private key with unexpected length %d vs %d\n", plen, - (int)(actualprivkeylen - + oqsx_key_get_oqs_public_key_len(key))); + (int)(actualprivkeylen + + oqsx_key_get_oqs_public_key_len(key))); #endif ERR_raise(ERR_LIB_USER, OQSPROV_R_INVALID_ENCODING); goto err_key_op; @@ -866,8 +866,8 @@ static OQSX_KEY *oqsx_key_op(const X509_ALGOR *palg, const unsigned char *p, memcpy(key->privkey, p, actualprivkeylen); #ifndef NOPUBKEY_IN_PRIVKEY // only enough data to fill public OQS key component - if (oqsx_key_get_oqs_public_key_len(key) - != plen - actualprivkeylen) { + if (oqsx_key_get_oqs_public_key_len(key) != + plen - actualprivkeylen) { ERR_raise(ERR_LIB_USER, OQSPROV_R_INVALID_ENCODING); goto err_key_op; } @@ -875,8 +875,8 @@ static OQSX_KEY *oqsx_key_op(const X509_ALGOR *palg, const unsigned char *p, if (key->numkeys == 2) { unsigned char *pubkey = (unsigned char *)key->pubkey; ENCODE_UINT32(pubkey, key->evp_info->length_public_key); - memcpy(pubkey + SIZE_OF_UINT32 - + key->evp_info->length_public_key, + memcpy(pubkey + SIZE_OF_UINT32 + + key->evp_info->length_public_key, p + actualprivkeylen, plen - actualprivkeylen); } else memcpy(key->pubkey, p + key->privkeylen, @@ -898,16 +898,15 @@ static OQSX_KEY *oqsx_key_op(const X509_ALGOR *palg, const unsigned char *p, } /* Recreate EVP data structure after import. RetVal 0 is error. */ -static int oqsx_key_recreate_classickey(OQSX_KEY *key, oqsx_key_op_t op) -{ +static int oqsx_key_recreate_classickey(OQSX_KEY *key, oqsx_key_op_t op) { if (key->keytype == KEY_TYPE_CMP_SIG) { int i; if (op == KEY_OP_PUBLIC) { for (i = 0; i < key->numkeys; i++) { char *name; - if ((name = get_cmpname(OBJ_sn2nid(key->tls_name), i)) - == NULL) { + if ((name = get_cmpname(OBJ_sn2nid(key->tls_name), i)) == + NULL) { ERR_raise(ERR_LIB_USER, OQSPROV_R_INVALID_ENCODING); goto rec_err; } @@ -918,8 +917,7 @@ static int oqsx_key_recreate_classickey(OQSX_KEY *key, oqsx_key_op_t op) ->raw_key_support) { EVP_PKEY *npk = EVP_PKEY_new(); if (key->oqsx_provider_ctx.oqsx_evp_ctx->evp_info - ->keytype - != EVP_PKEY_RSA) { + ->keytype != EVP_PKEY_RSA) { npk = setECParams(npk, key->oqsx_provider_ctx .oqsx_evp_ctx->evp_info->nid); @@ -947,8 +945,8 @@ static int oqsx_key_recreate_classickey(OQSX_KEY *key, oqsx_key_op_t op) for (i = 0; i < key->numkeys; i++) { char *name; - if ((name = get_cmpname(OBJ_sn2nid(key->tls_name), i)) - == NULL) { + if ((name = get_cmpname(OBJ_sn2nid(key->tls_name), i)) == + NULL) { ERR_raise(ERR_LIB_USER, OQSPROV_R_INVALID_ENCODING); goto rec_err; } @@ -975,11 +973,10 @@ static int oqsx_key_recreate_classickey(OQSX_KEY *key, oqsx_key_op_t op) if (!key->oqsx_provider_ctx.oqsx_evp_ctx->evp_info ->raw_key_support) { unsigned char *comp_pubkey = key->comp_pubkey[i]; - int pubkeylen - = i2d_PublicKey(key->classical_pkey, &comp_pubkey); - if (pubkeylen - != key->oqsx_provider_ctx.oqsx_evp_ctx->evp_info - ->length_public_key) { + int pubkeylen = + i2d_PublicKey(key->classical_pkey, &comp_pubkey); + if (pubkeylen != key->oqsx_provider_ctx.oqsx_evp_ctx + ->evp_info->length_public_key) { ERR_raise(ERR_LIB_USER, OQSPROV_R_INVALID_ENCODING); OPENSSL_free(name); goto rec_err; @@ -1027,9 +1024,9 @@ static int oqsx_key_recreate_classickey(OQSX_KEY *key, oqsx_key_op_t op) if (key->evp_info->keytype != EVP_PKEY_RSA) { npk = setECParams(npk, key->evp_info->nid); } - key->classical_pkey - = d2i_PublicKey(key->evp_info->keytype, &npk, - &enc_pubkey, classical_pubkey_len); + key->classical_pkey = + d2i_PublicKey(key->evp_info->keytype, &npk, &enc_pubkey, + classical_pubkey_len); if (!key->classical_pkey) { ERR_raise(ERR_LIB_USER, OQSPROV_R_INVALID_ENCODING); EVP_PKEY_free(npk); @@ -1059,26 +1056,25 @@ static int oqsx_key_recreate_classickey(OQSX_KEY *key, oqsx_key_op_t op) EVP_PKEY_get_raw_public_key(key->classical_pkey, NULL, &pubkeylen); - if (pubkeylen != key->evp_info->length_public_key - || EVP_PKEY_get_raw_public_key(key->classical_pkey, - enc_pubkey, &pubkeylen) - != 1) { + if (pubkeylen != key->evp_info->length_public_key || + EVP_PKEY_get_raw_public_key( + key->classical_pkey, enc_pubkey, &pubkeylen) != 1) { ERR_raise(ERR_LIB_USER, OQSPROV_R_INVALID_ENCODING); goto rec_err; } #endif } else { - key->classical_pkey - = d2i_PrivateKey(key->evp_info->keytype, NULL, - &enc_privkey, classical_privkey_len); + key->classical_pkey = + d2i_PrivateKey(key->evp_info->keytype, NULL, + &enc_privkey, classical_privkey_len); if (!key->classical_pkey) { ERR_raise(ERR_LIB_USER, OQSPROV_R_INVALID_ENCODING); goto rec_err; } #ifndef NOPUBKEY_IN_PRIVKEY // re-create classic public key part from private key: - int pubkeylen - = i2d_PublicKey(key->classical_pkey, &enc_pubkey); + int pubkeylen = + i2d_PublicKey(key->classical_pkey, &enc_pubkey); if (pubkeylen != key->evp_info->length_public_key) { ERR_raise(ERR_LIB_USER, OQSPROV_R_INVALID_ENCODING); goto rec_err; @@ -1096,8 +1092,7 @@ static int oqsx_key_recreate_classickey(OQSX_KEY *key, oqsx_key_op_t op) } OQSX_KEY *oqsx_key_from_x509pubkey(const X509_PUBKEY *xpk, OSSL_LIB_CTX *libctx, - const char *propq) -{ + const char *propq) { const unsigned char *p; int plen; X509_ALGOR *palg; @@ -1120,15 +1115,15 @@ OQSX_KEY *oqsx_key_from_x509pubkey(const X509_PUBKEY *xpk, OSSL_LIB_CTX *libctx, return NULL; } else { count = sk_ASN1_TYPE_num(sk); - concat_key - = OPENSSL_zalloc(plen); // concat_key is allocated with plen, - // which is the max value for pubkey + concat_key = + OPENSSL_zalloc(plen); // concat_key is allocated with plen, + // which is the max value for pubkey aux = 0; for (i = 0; i < count; i++) { - aType - = sk_ASN1_TYPE_pop(sk); // this remove in FILO order, but we - // need this in the opposite order + aType = + sk_ASN1_TYPE_pop(sk); // this remove in FILO order, but we + // need this in the opposite order buf = aType->value.sequence->data; buflen = aType->value.sequence->length; aux += buflen; @@ -1151,8 +1146,7 @@ OQSX_KEY *oqsx_key_from_x509pubkey(const X509_PUBKEY *xpk, OSSL_LIB_CTX *libctx, } OQSX_KEY *oqsx_key_from_pkcs8(const PKCS8_PRIV_KEY_INFO *p8inf, - OSSL_LIB_CTX *libctx, const char *propq) -{ + OSSL_LIB_CTX *libctx, const char *propq) { OQSX_KEY *oqsx = NULL; const unsigned char *p; int plen; @@ -1192,15 +1186,14 @@ OQSX_KEY *oqsx_key_from_pkcs8(const PKCS8_PRIV_KEY_INFO *p8inf, aux = 0; for (i = 0; i < count; i++) { - aType - = sk_ASN1_TYPE_pop(sk); // this remove in FILO order, but we - // need this in the opposite order + aType = + sk_ASN1_TYPE_pop(sk); // this remove in FILO order, but we + // need this in the opposite order p8inf_internal = PKCS8_PRIV_KEY_INFO_new(); nid = 0; char *name; - if ((name - = get_cmpname(OBJ_obj2nid(palg->algorithm), count - 1 - i)) - == NULL) { + if ((name = get_cmpname(OBJ_obj2nid(palg->algorithm), + count - 1 - i)) == NULL) { ASN1_TYPE_free(aType); OPENSSL_clear_free(concat_key, plen); PKCS8_PRIV_KEY_INFO_free(p8inf_internal); @@ -1211,8 +1204,8 @@ OQSX_KEY *oqsx_key_from_pkcs8(const PKCS8_PRIV_KEY_INFO *p8inf, buflen = aType->value.sequence->length; const unsigned char *buf2 = aType->value.sequence->data; - p8inf_internal - = d2i_PKCS8_PRIV_KEY_INFO(&p8inf_internal, &buf2, buflen); + p8inf_internal = + d2i_PKCS8_PRIV_KEY_INFO(&p8inf_internal, &buf2, buflen); if (!PKCS8_pkey_get0(NULL, &buf, &buflen, &palg_internal, p8inf_internal)) { OPENSSL_free(name); @@ -1230,22 +1223,21 @@ OQSX_KEY *oqsx_key_from_pkcs8(const PKCS8_PRIV_KEY_INFO *p8inf, int j; nid = OBJ_obj2nid(palg_internal->parameter->value.object); for (j = 0; j < OSSL_NELEM(nids_sig); j++) { - if ((nids_sig[j].nid == nid) - && (nids_sig[j].length_private_key - > buflen)) { // check if the curve is the same - // and if the key len is smaller - // than the max key size + if ((nids_sig[j].nid == nid) && + (nids_sig[j].length_private_key > + buflen)) { // check if the curve is the same + // and if the key len is smaller + // than the max key size EVP_PKEY *ec_pkey; OSSL_PARAM params[3]; int include_pub = 1; - const unsigned char *buf3 - = aType->value.sequence->data; + const unsigned char *buf3 = + aType->value.sequence->data; unsigned char *buf4, *buf5; - if (buflen - != nids_sig[j].kex_length_secret - + 7) { // no OPTIONAL ECParameter and no - // OPTIONAL Pubkey + if (buflen != nids_sig[j].kex_length_secret + + 7) { // no OPTIONAL ECParameter + // and no OPTIONAL Pubkey OPENSSL_free(name); ASN1_TYPE_free(aType); PKCS8_PRIV_KEY_INFO_free(p8inf_internal); @@ -1271,8 +1263,8 @@ OQSX_KEY *oqsx_key_from_pkcs8(const PKCS8_PRIV_KEY_INFO *p8inf, params[2] = OSSL_PARAM_construct_end(); EVP_PKEY_set_params(ec_pkey, params); - buf4 = OPENSSL_malloc( - nids_sig[j].length_private_key); + buf4 = + OPENSSL_malloc(nids_sig[j].length_private_key); buf5 = buf4; buflen = i2d_PrivateKey( ec_pkey, @@ -1331,8 +1323,8 @@ OQSX_KEY *oqsx_key_from_pkcs8(const PKCS8_PRIV_KEY_INFO *p8inf, return oqsx; } -static const int (*init_kex_fun[])(char *, OQSX_EVP_CTX *) - = {oqshybkem_init_ecp, oqshybkem_init_ecx}; +static const int (*init_kex_fun[])(char *, OQSX_EVP_CTX *) = { + oqshybkem_init_ecp, oqshybkem_init_ecx}; #ifdef USE_ENCODING_LIB extern const char *oqs_alg_encoding_list[]; #endif @@ -1340,10 +1332,9 @@ extern const char *oqs_oid_alg_list[]; OQSX_KEY *oqsx_key_new(OSSL_LIB_CTX *libctx, char *oqs_name, char *tls_name, int primitive, const char *propq, int bit_security, - int alg_idx) -{ - OQSX_KEY *ret = OPENSSL_zalloc( - sizeof(*ret)); // ensure all component pointers are NULL + int alg_idx) { + OQSX_KEY *ret = + OPENSSL_zalloc(sizeof(*ret)); // ensure all component pointers are NULL OQSX_EVP_CTX *evp_ctx = NULL; int ret2 = 0, i; @@ -1374,36 +1365,36 @@ OQSX_KEY *oqsx_key_new(OSSL_LIB_CTX *libctx, char *oqs_name, char *tls_name, ret->oqsx_provider_ctx.oqsx_evp_ctx = NULL; ret->oqsx_provider_ctx.oqsx_qs_ctx.sig = OQS_SIG_new(oqs_name); if (!ret->oqsx_provider_ctx.oqsx_qs_ctx.sig) { - fprintf( - stderr, - "Could not create OQS signature algorithm %s. Enabled in liboqs?\n", - oqs_name); + fprintf(stderr, + "Could not create OQS signature algorithm %s. Enabled in " + "liboqs?\n", + oqs_name); goto err; } #ifdef USE_ENCODING_LIB - if (alg_idx >= 0 && oqs_alg_encoding_list[2 * alg_idx] != NULL - && oqs_alg_encoding_list[2 * alg_idx + 1] != NULL) { + if (alg_idx >= 0 && oqs_alg_encoding_list[2 * alg_idx] != NULL && + oqs_alg_encoding_list[2 * alg_idx + 1] != NULL) { if (qsc_encoding_by_name_oid(&ret->oqsx_encoding_ctx.encoding_ctx, &ret->oqsx_encoding_ctx.encoding_impl, oqs_alg_encoding_list[2 * alg_idx + 1], - oqs_alg_encoding_list[2 * alg_idx]) - != QSC_ENC_OK) { - fprintf( - stderr, - "Could not create OQS signature encoding algorithm %s (%s, %s).\n", - oqs_alg_encoding_list[2 * alg_idx + 1], oqs_name, - oqs_alg_encoding_list[2 * alg_idx]); + oqs_alg_encoding_list[2 * alg_idx]) != + QSC_ENC_OK) { + fprintf(stderr, + "Could not create OQS signature encoding algorithm %s " + "(%s, %s).\n", + oqs_alg_encoding_list[2 * alg_idx + 1], oqs_name, + oqs_alg_encoding_list[2 * alg_idx]); ret->oqsx_encoding_ctx.encoding_ctx = NULL; ret->oqsx_encoding_ctx.encoding_impl = NULL; goto err; } } #endif - ret->privkeylen - = ret->oqsx_provider_ctx.oqsx_qs_ctx.sig->length_secret_key; - ret->pubkeylen - = ret->oqsx_provider_ctx.oqsx_qs_ctx.sig->length_public_key; + ret->privkeylen = + ret->oqsx_provider_ctx.oqsx_qs_ctx.sig->length_secret_key; + ret->pubkeylen = + ret->oqsx_provider_ctx.oqsx_qs_ctx.sig->length_public_key; ret->keytype = KEY_TYPE_SIG; break; case KEY_TYPE_KEM: @@ -1420,10 +1411,10 @@ OQSX_KEY *oqsx_key_new(OSSL_LIB_CTX *libctx, char *oqs_name, char *tls_name, oqs_name); goto err; } - ret->privkeylen - = ret->oqsx_provider_ctx.oqsx_qs_ctx.kem->length_secret_key; - ret->pubkeylen - = ret->oqsx_provider_ctx.oqsx_qs_ctx.kem->length_public_key; + ret->privkeylen = + ret->oqsx_provider_ctx.oqsx_qs_ctx.kem->length_secret_key; + ret->pubkeylen = + ret->oqsx_provider_ctx.oqsx_qs_ctx.kem->length_public_key; ret->keytype = KEY_TYPE_KEM; break; case KEY_TYPE_ECX_HYB_KEM: @@ -1439,22 +1430,22 @@ OQSX_KEY *oqsx_key_new(OSSL_LIB_CTX *libctx, char *oqs_name, char *tls_name, evp_ctx = OPENSSL_zalloc(sizeof(OQSX_EVP_CTX)); ON_ERR_GOTO(!evp_ctx, err); - ret2 = (init_kex_fun[primitive - KEY_TYPE_ECP_HYB_KEM])(tls_name, - evp_ctx); + ret2 = + (init_kex_fun[primitive - KEY_TYPE_ECP_HYB_KEM])(tls_name, evp_ctx); ON_ERR_GOTO(ret2 <= 0 || !evp_ctx->keyParam || !evp_ctx->ctx, err); ret->numkeys = 2; ret->comp_privkey = OPENSSL_malloc(ret->numkeys * sizeof(void *)); ret->comp_pubkey = OPENSSL_malloc(ret->numkeys * sizeof(void *)); ON_ERR_GOTO(!ret->comp_privkey || !ret->comp_pubkey, err); - ret->privkeylen - = (ret->numkeys - 1) * SIZE_OF_UINT32 - + ret->oqsx_provider_ctx.oqsx_qs_ctx.kem->length_secret_key - + evp_ctx->evp_info->length_private_key; - ret->pubkeylen - = (ret->numkeys - 1) * SIZE_OF_UINT32 - + ret->oqsx_provider_ctx.oqsx_qs_ctx.kem->length_public_key - + evp_ctx->evp_info->length_public_key; + ret->privkeylen = + (ret->numkeys - 1) * SIZE_OF_UINT32 + + ret->oqsx_provider_ctx.oqsx_qs_ctx.kem->length_secret_key + + evp_ctx->evp_info->length_private_key; + ret->pubkeylen = + (ret->numkeys - 1) * SIZE_OF_UINT32 + + ret->oqsx_provider_ctx.oqsx_qs_ctx.kem->length_public_key + + evp_ctx->evp_info->length_public_key; ret->oqsx_provider_ctx.oqsx_evp_ctx = evp_ctx; ret->keytype = primitive; ret->evp_info = evp_ctx->evp_info; @@ -1462,10 +1453,10 @@ OQSX_KEY *oqsx_key_new(OSSL_LIB_CTX *libctx, char *oqs_name, char *tls_name, case KEY_TYPE_HYB_SIG: ret->oqsx_provider_ctx.oqsx_qs_ctx.sig = OQS_SIG_new(oqs_name); if (!ret->oqsx_provider_ctx.oqsx_qs_ctx.sig) { - fprintf( - stderr, - "Could not create OQS signature algorithm %s. Enabled in liboqs?\n", - oqs_name); + fprintf(stderr, + "Could not create OQS signature algorithm %s. Enabled in " + "liboqs?\n", + oqs_name); goto err; } evp_ctx = OPENSSL_zalloc(sizeof(OQSX_EVP_CTX)); @@ -1478,14 +1469,14 @@ OQSX_KEY *oqsx_key_new(OSSL_LIB_CTX *libctx, char *oqs_name, char *tls_name, ret->comp_privkey = OPENSSL_malloc(ret->numkeys * sizeof(void *)); ret->comp_pubkey = OPENSSL_malloc(ret->numkeys * sizeof(void *)); ON_ERR_GOTO(!ret->comp_privkey || !ret->comp_pubkey, err); - ret->privkeylen - = (ret->numkeys - 1) * SIZE_OF_UINT32 - + ret->oqsx_provider_ctx.oqsx_qs_ctx.sig->length_secret_key - + evp_ctx->evp_info->length_private_key; - ret->pubkeylen - = (ret->numkeys - 1) * SIZE_OF_UINT32 - + ret->oqsx_provider_ctx.oqsx_qs_ctx.sig->length_public_key - + evp_ctx->evp_info->length_public_key; + ret->privkeylen = + (ret->numkeys - 1) * SIZE_OF_UINT32 + + ret->oqsx_provider_ctx.oqsx_qs_ctx.sig->length_secret_key + + evp_ctx->evp_info->length_private_key; + ret->pubkeylen = + (ret->numkeys - 1) * SIZE_OF_UINT32 + + ret->oqsx_provider_ctx.oqsx_qs_ctx.sig->length_public_key + + evp_ctx->evp_info->length_public_key; ret->oqsx_provider_ctx.oqsx_evp_ctx = evp_ctx; ret->keytype = primitive; ret->evp_info = evp_ctx->evp_info; @@ -1506,19 +1497,19 @@ OQSX_KEY *oqsx_key_new(OSSL_LIB_CTX *libctx, char *oqs_name, char *tls_name, goto err; } if (get_oqsname_fromtls(name) != 0) { - ret->oqsx_provider_ctx.oqsx_qs_ctx.sig - = OQS_SIG_new(get_oqsname_fromtls(name)); + ret->oqsx_provider_ctx.oqsx_qs_ctx.sig = + OQS_SIG_new(get_oqsname_fromtls(name)); if (!ret->oqsx_provider_ctx.oqsx_qs_ctx.sig) { - fprintf( - stderr, - "Could not create OQS signature algorithm %s. Enabled in liboqs?A\n", - name); + fprintf(stderr, + "Could not create OQS signature algorithm %s. " + "Enabled in liboqs?A\n", + name); goto err; } - ret->privkeylen_cmp[i] - = ret->oqsx_provider_ctx.oqsx_qs_ctx.sig->length_secret_key; - ret->pubkeylen_cmp[i] - = ret->oqsx_provider_ctx.oqsx_qs_ctx.sig->length_public_key; + ret->privkeylen_cmp[i] = + ret->oqsx_provider_ctx.oqsx_qs_ctx.sig->length_secret_key; + ret->pubkeylen_cmp[i] = + ret->oqsx_provider_ctx.oqsx_qs_ctx.sig->length_public_key; } else { evp_ctx = OPENSSL_zalloc(sizeof(OQSX_EVP_CTX)); ON_ERR_GOTO(!evp_ctx, err); @@ -1573,16 +1564,15 @@ OQSX_KEY *oqsx_key_new(OSSL_LIB_CTX *libctx, char *oqs_name, char *tls_name, return NULL; } -void oqsx_key_free(OQSX_KEY *key) -{ +void oqsx_key_free(OQSX_KEY *key) { int refcnt; if (key == NULL) return; #ifndef OQS_PROVIDER_NOATOMIC - refcnt - = atomic_fetch_sub_explicit(&key->references, 1, memory_order_relaxed) - - 1; + refcnt = + atomic_fetch_sub_explicit(&key->references, 1, memory_order_relaxed) - + 1; if (refcnt == 0) atomic_thread_fence(memory_order_acquire); #else @@ -1608,8 +1598,8 @@ void oqsx_key_free(OQSX_KEY *key) } if (key->keytype == KEY_TYPE_KEM) OQS_KEM_free(key->oqsx_provider_ctx.oqsx_qs_ctx.kem); - else if (key->keytype == KEY_TYPE_ECP_HYB_KEM - || key->keytype == KEY_TYPE_ECX_HYB_KEM) { + else if (key->keytype == KEY_TYPE_ECP_HYB_KEM || + key->keytype == KEY_TYPE_ECX_HYB_KEM) { OQS_KEM_free(key->oqsx_provider_ctx.oqsx_qs_ctx.kem); } else OQS_SIG_free(key->oqsx_provider_ctx.oqsx_qs_ctx.sig); @@ -1626,14 +1616,13 @@ void oqsx_key_free(OQSX_KEY *key) OPENSSL_free(key); } -int oqsx_key_up_ref(OQSX_KEY *key) -{ +int oqsx_key_up_ref(OQSX_KEY *key) { int refcnt; #ifndef OQS_PROVIDER_NOATOMIC - refcnt - = atomic_fetch_add_explicit(&key->references, 1, memory_order_relaxed) - + 1; + refcnt = + atomic_fetch_add_explicit(&key->references, 1, memory_order_relaxed) + + 1; #else CRYPTO_atomic_add(&key->references, 1, &refcnt, key->lock); #endif @@ -1645,8 +1634,7 @@ int oqsx_key_up_ref(OQSX_KEY *key) return (refcnt > 1); } -int oqsx_key_allocate_keymaterial(OQSX_KEY *key, int include_private) -{ +int oqsx_key_allocate_keymaterial(OQSX_KEY *key, int include_private) { int ret = 0, aux = 0; if (key->keytype != KEY_TYPE_CMP_SIG) @@ -1665,8 +1653,7 @@ int oqsx_key_allocate_keymaterial(OQSX_KEY *key, int include_private) } int oqsx_key_fromdata(OQSX_KEY *key, const OSSL_PARAM params[], - int include_private) -{ + int include_private) { const OSSL_PARAM *pp1, *pp2; OQS_KEY_PRINTF("OQSX Key from data called\n"); @@ -1711,16 +1698,15 @@ int oqsx_key_fromdata(OQSX_KEY *key, const OSSL_PARAM params[], } memcpy(key->pubkey, pp2->data, pp2->data_size); } - if (!oqsx_key_set_composites(key) - || !oqsx_key_recreate_classickey( + if (!oqsx_key_set_composites(key) || + !oqsx_key_recreate_classickey( key, key->privkey != NULL ? KEY_OP_PRIVATE : KEY_OP_PUBLIC)) return 0; return 1; } // OQS key always the last of the numkeys comp keys -static int oqsx_key_gen_oqs(OQSX_KEY *key, int gen_kem) -{ +static int oqsx_key_gen_oqs(OQSX_KEY *key, int gen_kem) { if (gen_kem) return OQS_KEM_keypair(key->oqsx_provider_ctx.oqsx_qs_ctx.kem, key->comp_pubkey[key->numkeys - 1], @@ -1736,8 +1722,7 @@ static int oqsx_key_gen_oqs(OQSX_KEY *key, int gen_kem) * pubkey/privkey buffers; returned EVP_PKEY must be freed if not used */ static EVP_PKEY *oqsx_key_gen_evp_key(OQSX_EVP_CTX *ctx, unsigned char *pubkey, - unsigned char *privkey, int encode) -{ + unsigned char *privkey, int encode) { int ret = 0, ret2 = 0, aux = 0; // Free at errhyb: @@ -1773,38 +1758,38 @@ static EVP_PKEY *oqsx_key_gen_evp_key(OQSX_EVP_CTX *ctx, unsigned char *pubkey, if (ctx->evp_info->raw_key_support) { // TODO: If available, use preallocated memory - if (ctx->evp_info->nid != NID_ED25519 - && ctx->evp_info->nid != NID_ED448) { + if (ctx->evp_info->nid != NID_ED25519 && + ctx->evp_info->nid != NID_ED448) { pubkeylen = EVP_PKEY_get1_encoded_public_key(pkey, &pubkey_encoded); - ON_ERR_SET_GOTO(pubkeylen != ctx->evp_info->length_public_key - || !pubkey_encoded, + ON_ERR_SET_GOTO(pubkeylen != ctx->evp_info->length_public_key || + !pubkey_encoded, ret, -3, errhyb); memcpy(pubkey + aux, pubkey_encoded, pubkeylen); } else { pubkeylen = ctx->evp_info->length_public_key; ret2 = EVP_PKEY_get_raw_public_key(pkey, pubkey + aux, &pubkeylen); - ON_ERR_SET_GOTO( - ret2 <= 0 || pubkeylen != ctx->evp_info->length_public_key, ret, - -3, errhyb); + ON_ERR_SET_GOTO(ret2 <= 0 || + pubkeylen != ctx->evp_info->length_public_key, + ret, -3, errhyb); } privkeylen = ctx->evp_info->length_private_key; ret2 = EVP_PKEY_get_raw_private_key(pkey, privkey + aux, &privkeylen); - ON_ERR_SET_GOTO(ret2 <= 0 - || privkeylen != ctx->evp_info->length_private_key, + ON_ERR_SET_GOTO(ret2 <= 0 || + privkeylen != ctx->evp_info->length_private_key, ret, -4, errhyb); } else { unsigned char *pubkey_enc = pubkey + aux; const unsigned char *pubkey_enc2 = pubkey + aux; pubkeylen = i2d_PublicKey(pkey, &pubkey_enc); - ON_ERR_SET_GOTO( - !pubkey_enc || pubkeylen > (int)ctx->evp_info->length_public_key, - ret, -11, errhyb); + ON_ERR_SET_GOTO(!pubkey_enc || + pubkeylen > (int)ctx->evp_info->length_public_key, + ret, -11, errhyb); unsigned char *privkey_enc = privkey + aux; const unsigned char *privkey_enc2 = privkey + aux; privkeylen = i2d_PrivateKey(pkey, &privkey_enc); - ON_ERR_SET_GOTO( - !privkey_enc || privkeylen > (int)ctx->evp_info->length_private_key, - ret, -12, errhyb); + ON_ERR_SET_GOTO(!privkey_enc || + privkeylen > (int)ctx->evp_info->length_private_key, + ret, -12, errhyb); // selftest: EVP_PKEY *ck2 = d2i_PrivateKey(ctx->evp_info->keytype, NULL, &privkey_enc2, privkeylen); @@ -1831,14 +1816,13 @@ static EVP_PKEY *oqsx_key_gen_evp_key(OQSX_EVP_CTX *ctx, unsigned char *pubkey, } /* allocates OQS and classical keys */ -int oqsx_key_gen(OQSX_KEY *key) -{ +int oqsx_key_gen(OQSX_KEY *key) { int ret = 0; EVP_PKEY *pkey = NULL; if (key->privkey == NULL || key->pubkey == NULL) { - ret = oqsx_key_allocate_keymaterial(key, 0) - || oqsx_key_allocate_keymaterial(key, 1); + ret = oqsx_key_allocate_keymaterial(key, 0) || + oqsx_key_allocate_keymaterial(key, 1); ON_ERR_GOTO(ret, err_gen); } @@ -1846,9 +1830,9 @@ int oqsx_key_gen(OQSX_KEY *key) ret = !oqsx_key_set_composites(key); ON_ERR_GOTO(ret, err_gen); ret = oqsx_key_gen_oqs(key, 1); - } else if (key->keytype == KEY_TYPE_ECP_HYB_KEM - || key->keytype == KEY_TYPE_ECX_HYB_KEM - || key->keytype == KEY_TYPE_HYB_SIG) { + } else if (key->keytype == KEY_TYPE_ECP_HYB_KEM || + key->keytype == KEY_TYPE_ECX_HYB_KEM || + key->keytype == KEY_TYPE_HYB_SIG) { pkey = oqsx_key_gen_evp_key(key->oqsx_provider_ctx.oqsx_evp_ctx, key->pubkey, key->privkey, 1); ON_ERR_GOTO(pkey == NULL, err_gen); @@ -1875,9 +1859,9 @@ int oqsx_key_gen(OQSX_KEY *key) ON_ERR_GOTO(pkey == NULL, err_gen); key->classical_pkey = pkey; } else { - ret = OQS_SIG_keypair(key->oqsx_provider_ctx.oqsx_qs_ctx.sig, - key->comp_pubkey[i], - key->comp_privkey[i]); + ret = + OQS_SIG_keypair(key->oqsx_provider_ctx.oqsx_qs_ctx.sig, + key->comp_pubkey[i], key->comp_privkey[i]); OPENSSL_free(name); ON_ERR_GOTO(ret, err_gen); } @@ -1898,30 +1882,27 @@ int oqsx_key_gen(OQSX_KEY *key) return ret; } -int oqsx_key_secbits(OQSX_KEY *key) -{ - return key->bit_security; -} +int oqsx_key_secbits(OQSX_KEY *key) { return key->bit_security; } -int oqsx_key_maxsize(OQSX_KEY *key) -{ +int oqsx_key_maxsize(OQSX_KEY *key) { switch (key->keytype) { case KEY_TYPE_KEM: return key->oqsx_provider_ctx.oqsx_qs_ctx.kem->length_shared_secret; case KEY_TYPE_ECP_HYB_KEM: case KEY_TYPE_ECX_HYB_KEM: - return key->oqsx_provider_ctx.oqsx_evp_ctx->evp_info->kex_length_secret - + key->oqsx_provider_ctx.oqsx_qs_ctx.kem->length_shared_secret; + return key->oqsx_provider_ctx.oqsx_evp_ctx->evp_info + ->kex_length_secret + + key->oqsx_provider_ctx.oqsx_qs_ctx.kem->length_shared_secret; case KEY_TYPE_SIG: return key->oqsx_provider_ctx.oqsx_qs_ctx.sig->length_signature; case KEY_TYPE_HYB_SIG: - return key->oqsx_provider_ctx.oqsx_qs_ctx.sig->length_signature - + key->oqsx_provider_ctx.oqsx_evp_ctx->evp_info->length_signature - + SIZE_OF_UINT32; + return key->oqsx_provider_ctx.oqsx_qs_ctx.sig->length_signature + + key->oqsx_provider_ctx.oqsx_evp_ctx->evp_info->length_signature + + SIZE_OF_UINT32; case KEY_TYPE_CMP_SIG: - return sizeof(CompositeSignature) - + key->oqsx_provider_ctx.oqsx_evp_ctx->evp_info->length_signature - + key->oqsx_provider_ctx.oqsx_qs_ctx.sig->length_signature; + return sizeof(CompositeSignature) + + key->oqsx_provider_ctx.oqsx_evp_ctx->evp_info->length_signature + + key->oqsx_provider_ctx.oqsx_qs_ctx.sig->length_signature; default: OQS_KEY_PRINTF("OQSX KEY: Wrong key type\n"); @@ -1929,8 +1910,7 @@ int oqsx_key_maxsize(OQSX_KEY *key) } } -int oqsx_key_get_oqs_public_key_len(OQSX_KEY *k) -{ +int oqsx_key_get_oqs_public_key_len(OQSX_KEY *k) { switch (k->keytype) { case KEY_TYPE_SIG: case KEY_TYPE_KEM: diff --git a/test/oqs_test_endecode.c b/test/oqs_test_endecode.c index 1427d121..db0dfd77 100644 --- a/test/oqs_test_endecode.c +++ b/test/oqs_test_endecode.c @@ -51,8 +51,7 @@ static ENDECODE_PARAMS test_params_list[] = { }; static EVP_PKEY *oqstest_make_key(const char *type, EVP_PKEY *template, - OSSL_PARAM *genparams) -{ + OSSL_PARAM *genparams) { EVP_PKEY *pkey = NULL; EVP_PKEY_CTX *ctx = NULL; @@ -69,25 +68,24 @@ static EVP_PKEY *oqstest_make_key(const char *type, EVP_PKEY *template, * No real need to check the errors other than for the cascade * effect. |pkey| will simply remain NULL if something goes wrong. */ - (void)(ctx != NULL && EVP_PKEY_keygen_init(ctx) > 0 - && (genparams == NULL || EVP_PKEY_CTX_set_params(ctx, genparams) > 0) - && EVP_PKEY_keygen(ctx, &pkey) > 0); + (void)(ctx != NULL && EVP_PKEY_keygen_init(ctx) > 0 && + (genparams == NULL || EVP_PKEY_CTX_set_params(ctx, genparams) > 0) && + EVP_PKEY_keygen(ctx, &pkey) > 0); EVP_PKEY_CTX_free(ctx); return pkey; } static int encode_EVP_PKEY_prov(const EVP_PKEY *pkey, const char *format, const char *structure, const char *pass, - const int selection, BUF_MEM **encoded) -{ + const int selection, BUF_MEM **encoded) { OSSL_ENCODER_CTX *ectx; BIO *mem_ser = NULL; BUF_MEM *mem_buf = NULL; const char *cipher = "AES-256-CBC"; int ok = 0; - ectx = OSSL_ENCODER_CTX_new_for_pkey(pkey, selection, format, structure, - NULL); + ectx = + OSSL_ENCODER_CTX_new_for_pkey(pkey, selection, format, structure, NULL); if (ectx == NULL) { printf("No suitable encoder found\n"); goto end; @@ -127,8 +125,7 @@ static int encode_EVP_PKEY_prov(const EVP_PKEY *pkey, const char *format, static int decode_EVP_PKEY_prov(const char *input_type, const char *structure, const char *pass, const char *keytype, const int selection, EVP_PKEY **object, - const void *encoded, const long encoded_len) -{ + const void *encoded, const long encoded_len) { EVP_PKEY *pkey = NULL; OSSL_DECODER_CTX *dctx = NULL; BIO *encoded_bio = NULL; @@ -165,8 +162,7 @@ static int decode_EVP_PKEY_prov(const char *input_type, const char *structure, return ok; } -static int test_oqs_encdec(const char *alg_name) -{ +static int test_oqs_encdec(const char *alg_name) { EVP_PKEY *pkey = NULL; EVP_PKEY *decoded_pkey = NULL; BUF_MEM *encoded = NULL; @@ -213,8 +209,7 @@ static int test_oqs_encdec(const char *alg_name) return ok; } -static int test_algs(const OSSL_ALGORITHM *algs) -{ +static int test_algs(const OSSL_ALGORITHM *algs) { int errcnt = 0; for (; algs->algorithm_names != NULL; algs++) { if (test_oqs_encdec(algs->algorithm_names)) { @@ -232,8 +227,7 @@ static int test_algs(const OSSL_ALGORITHM *algs) return errcnt; } -int main(int argc, char *argv[]) -{ +int main(int argc, char *argv[]) { size_t i; int errcnt = 0, test = 0, query_nocache; OSSL_PROVIDER *oqsprov = NULL; diff --git a/test/oqs_test_evp_pkey_params.c b/test/oqs_test_evp_pkey_params.c index aadfeca9..e287b7bc 100644 --- a/test/oqs_test_evp_pkey_params.c +++ b/test/oqs_test_evp_pkey_params.c @@ -19,8 +19,32 @@ /** \brief List of hybrid signature algorithms. */ const char *kHybridSignatureAlgorithms[] = { -"p256_dilithium2","rsa3072_dilithium2","p384_dilithium3","p521_dilithium5","p256_mldsa44","rsa3072_mldsa44","p384_mldsa65","p521_mldsa87","p256_falcon512","rsa3072_falcon512","p256_falconpadded512","rsa3072_falconpadded512","p521_falcon1024","p521_falconpadded1024","p256_sphincssha2128fsimple","rsa3072_sphincssha2128fsimple","p256_sphincssha2128ssimple","rsa3072_sphincssha2128ssimple","p384_sphincssha2192fsimple","p256_sphincsshake128fsimple","rsa3072_sphincsshake128fsimple","p256_mayo1","p256_mayo2","p384_mayo3","p521_mayo5", -NULL, + "p256_dilithium2", + "rsa3072_dilithium2", + "p384_dilithium3", + "p521_dilithium5", + "p256_mldsa44", + "rsa3072_mldsa44", + "p384_mldsa65", + "p521_mldsa87", + "p256_falcon512", + "rsa3072_falcon512", + "p256_falconpadded512", + "rsa3072_falconpadded512", + "p521_falcon1024", + "p521_falconpadded1024", + "p256_sphincssha2128fsimple", + "rsa3072_sphincssha2128fsimple", + "p256_sphincssha2128ssimple", + "rsa3072_sphincssha2128ssimple", + "p384_sphincssha2192fsimple", + "p256_sphincsshake128fsimple", + "rsa3072_sphincsshake128fsimple", + "p256_mayo1", + "p256_mayo2", + "p384_mayo3", + "p521_mayo5", + NULL, }; ///// OQS_TEMPLATE_FRAGMENT_HYBRID_SIG_ALGS_END @@ -28,43 +52,19 @@ NULL, /** \brief List of hybrid KEMs. */ const char *kHybridKEMAlgorithms[] = { - "p256_frodo640aes", - "x25519_frodo640aes", - "p256_frodo640shake", - "x25519_frodo640shake", - "p384_frodo976aes", - "x448_frodo976aes", - "p384_frodo976shake", - "x448_frodo976shake", - "p521_frodo1344aes", - "p521_frodo1344shake", - "p256_kyber512", - "x25519_kyber512", - "p384_kyber768", - "x448_kyber768", - "x25519_kyber768", - "p256_kyber768", - "p521_kyber1024", - "p256_mlkem512", - "x25519_mlkem512", - "p384_mlkem768", - "x448_mlkem768", - "x25519_mlkem768", - "p256_mlkem768", - "p521_mlkem1024", - "p384_mlkem1024", - "p256_bikel1", - "x25519_bikel1", - "p384_bikel3", - "x448_bikel3", - "p521_bikel5", - "p256_hqc128", - "x25519_hqc128", - "p384_hqc192", - "x448_hqc192", - "p521_hqc256", -NULL, -};///// OQS_TEMPLATE_FRAGMENT_HYBRID_KEM_ALGS_END + "p256_frodo640aes", "x25519_frodo640aes", "p256_frodo640shake", + "x25519_frodo640shake", "p384_frodo976aes", "x448_frodo976aes", + "p384_frodo976shake", "x448_frodo976shake", "p521_frodo1344aes", + "p521_frodo1344shake", "p256_kyber512", "x25519_kyber512", + "p384_kyber768", "x448_kyber768", "x25519_kyber768", + "p256_kyber768", "p521_kyber1024", "p256_mlkem512", + "x25519_mlkem512", "p384_mlkem768", "x448_mlkem768", + "x25519_mlkem768", "p256_mlkem768", "p521_mlkem1024", + "p384_mlkem1024", "p256_bikel1", "x25519_bikel1", + "p384_bikel3", "x448_bikel3", "p521_bikel5", + "p256_hqc128", "x25519_hqc128", "p384_hqc192", + "x448_hqc192", "p521_hqc256", NULL, +}; ///// OQS_TEMPLATE_FRAGMENT_HYBRID_KEM_ALGS_END /** \brief Indicates if a string is in a given list of strings. * @@ -72,8 +72,7 @@ NULL, * \param s String to test. * * \return 1 if `s` is in `list`, else 0. */ -static int is_string_in_list(const char **list, const char *s) -{ +static int is_string_in_list(const char **list, const char *s) { for (; *list != NULL && strcmp(*list, s) != 0; ++list) ; if (*list != NULL) { @@ -87,7 +86,7 @@ static int is_string_in_list(const char **list, const char *s) * \param alg Algorithm name. * * \returns 1 if hybrid, else 0. */ -#define is_signature_algorithm_hybrid(_alg_) \ +#define is_signature_algorithm_hybrid(_alg_) \ is_string_in_list(kHybridSignatureAlgorithms, (_alg_)) /** \brief Indicates if an kem algorithm is hybrid or not. @@ -95,7 +94,7 @@ static int is_string_in_list(const char **list, const char *s) * \param alg Algorithm name. * * \returns 1 if hybrid, else 0. */ -#define is_kem_algorithm_hybrid(_alg_) \ +#define is_kem_algorithm_hybrid(_alg_) \ is_string_in_list(kHybridKEMAlgorithms, (_alg_)) /** \brief A pair of keys. */ @@ -120,8 +119,7 @@ struct KeyPair { /** \brief Frees the memory occupied by a KeyPair. * * \param kp Keypair to free. */ -static void keypair_free(struct KeyPair *kp) -{ +static void keypair_free(struct KeyPair *kp) { free(kp->pubkey); free(kp->privkey); } @@ -129,8 +127,7 @@ static void keypair_free(struct KeyPair *kp) /** \brief Initializes an OpenSSL top-level context. * * \returns The top-level context, or `NULL` if an error occurred. */ -static OSSL_LIB_CTX *init_openssl(void) -{ +static OSSL_LIB_CTX *init_openssl(void) { OSSL_LIB_CTX *ctx; if (!(ctx = OSSL_LIB_CTX_new())) { @@ -147,8 +144,7 @@ static OSSL_LIB_CTX *init_openssl(void) * \paran alg The algorithm to use. * * \returns The EVP_PKEY context, or `NULL` if an error occurred. */ -static EVP_PKEY_CTX *init_EVP_PKEY_CTX(OSSL_LIB_CTX *libctx, const char *alg) -{ +static EVP_PKEY_CTX *init_EVP_PKEY_CTX(OSSL_LIB_CTX *libctx, const char *alg) { EVP_PKEY_CTX *ctx; if (!(ctx = EVP_PKEY_CTX_new_from_name(libctx, alg, NULL))) { @@ -167,8 +163,7 @@ static EVP_PKEY_CTX *init_EVP_PKEY_CTX(OSSL_LIB_CTX *libctx, const char *alg) * \param ctx EVP_PKEY context. * * \returns 0 on success. */ -static int init_keygen(EVP_PKEY_CTX *ctx) -{ +static int init_keygen(EVP_PKEY_CTX *ctx) { int err; if ((err = EVP_PKEY_keygen_init(ctx)) == -2) { @@ -192,8 +187,7 @@ static int init_keygen(EVP_PKEY_CTX *ctx) * \param ctx EVP_PKEY context. * * \returns The private key, or `NULL` if an error occurred. */ -static EVP_PKEY *generate_private_key(EVP_PKEY_CTX *ctx) -{ +static EVP_PKEY *generate_private_key(EVP_PKEY_CTX *ctx) { EVP_PKEY *private_key = NULL; int err; @@ -221,14 +215,13 @@ static EVP_PKEY *generate_private_key(EVP_PKEY_CTX *ctx) * * \returns 0 on success. */ static int get_param_octet_string(const EVP_PKEY *key, const char *param_name, - uint8_t **buf, size_t *buf_len) -{ + uint8_t **buf, size_t *buf_len) { *buf = NULL; *buf_len = 0; int ret = -1; - if (EVP_PKEY_get_octet_string_param(key, param_name, NULL, 0, buf_len) - != 1) { + if (EVP_PKEY_get_octet_string_param(key, param_name, NULL, 0, buf_len) != + 1) { fprintf(stderr, cRED "`EVP_PKEY_get_octet_string_param` failed with param `%s`: ", @@ -242,8 +235,7 @@ static int get_param_octet_string(const EVP_PKEY *key, const char *param_name, goto out; } if (EVP_PKEY_get_octet_string_param(key, param_name, *buf, *buf_len, - buf_len) - != 1) { + buf_len) != 1) { fprintf(stderr, cRED "`EVP_PKEY_get_octet_string_param` failed with param `%s`: ", @@ -267,8 +259,7 @@ static int get_param_octet_string(const EVP_PKEY *key, const char *param_name, * * \returns 0 on success. */ static int private_key_params_get_classical_keys(const EVP_PKEY *private_key, - struct KeyPair *out) -{ + struct KeyPair *out) { int ret = -1; if (get_param_octet_string(private_key, @@ -298,8 +289,7 @@ static int private_key_params_get_classical_keys(const EVP_PKEY *private_key, * * \returns 0 on success. */ static int private_key_params_get_pq_keys(const EVP_PKEY *private_key, - struct KeyPair *out) -{ + struct KeyPair *out) { int ret = -1; if (get_param_octet_string(private_key, OQS_HYBRID_PKEY_PARAM_PQ_PUB_KEY, @@ -327,8 +317,7 @@ static int private_key_params_get_pq_keys(const EVP_PKEY *private_key, * * \returns 0 on success. */ static int private_key_params_get_full_keys(const EVP_PKEY *private_key, - struct KeyPair *out) -{ + struct KeyPair *out) { int ret = -1; if (get_param_octet_string(private_key, OSSL_PKEY_PARAM_PUB_KEY, @@ -362,8 +351,7 @@ static int private_key_params_get_full_keys(const EVP_PKEY *private_key, * \returns 0 on success. */ static int reconstitute_keys(const uint8_t *classical, const size_t classical_n, const uint8_t *pq, const size_t pq_n, - uint8_t **buf, size_t *buf_len) -{ + uint8_t **buf, size_t *buf_len) { uint32_t header; int ret = -1; @@ -395,8 +383,7 @@ static int reconstitute_keys(const uint8_t *classical, const size_t classical_n, * \returns 0 on success. */ static int keypairs_verify_consistency(const struct KeyPair *classical, const struct KeyPair *pq, - const struct KeyPair *comb) -{ + const struct KeyPair *comb) { uint8_t *reconstitution; size_t n; int ret = -1; @@ -460,8 +447,7 @@ static int keypairs_verify_consistency(const struct KeyPair *classical, * \param algname Algorithm name. * * \returns 0 on success. */ -static int test_algorithm(OSSL_LIB_CTX *libctx, const char *algname) -{ +static int test_algorithm(OSSL_LIB_CTX *libctx, const char *algname) { EVP_PKEY_CTX *evp_pkey_ctx; EVP_PKEY *private_key; struct KeyPair classical_keypair; @@ -517,8 +503,7 @@ static int test_algorithm(OSSL_LIB_CTX *libctx, const char *algname) return ret; } -int main(int argc, char **argv) -{ +int main(int argc, char **argv) { OSSL_LIB_CTX *libctx; OSSL_PROVIDER *default_provider; OSSL_PROVIDER *oqs_provider; diff --git a/test/oqs_test_groups.c b/test/oqs_test_groups.c index 171d2b44..a0361273 100644 --- a/test/oqs_test_groups.c +++ b/test/oqs_test_groups.c @@ -14,8 +14,7 @@ static char *cert = NULL; static char *privkey = NULL; static char *certsdir = NULL; -char *test_mk_file_path(const char *dir, const char *file) -{ +char *test_mk_file_path(const char *dir, const char *file) { #ifndef OPENSSL_SYS_VMS const char *sep = "/"; #else @@ -33,8 +32,7 @@ char *test_mk_file_path(const char *dir, const char *file) return full_file; } -static int test_oqs_groups(const char *group_name) -{ +static int test_oqs_groups(const char *group_name) { SSL_CTX *cctx = NULL, *sctx = NULL; SSL *clientssl = NULL, *serverssl = NULL; int ret = 1, testresult = 0; @@ -83,12 +81,11 @@ static int test_oqs_groups(const char *group_name) return ret; } -static int test_group(const OSSL_PARAM params[], void *data) -{ +static int test_group(const OSSL_PARAM params[], void *data) { int ret = 1; int *errcnt = (int *)data; - const OSSL_PARAM *p - = OSSL_PARAM_locate_const(params, OSSL_CAPABILITY_TLS_GROUP_NAME); + const OSSL_PARAM *p = + OSSL_PARAM_locate_const(params, OSSL_CAPABILITY_TLS_GROUP_NAME); if (p == NULL || p->data_type != OSSL_PARAM_UTF8_STRING) { ret = -1; goto err; @@ -117,8 +114,7 @@ static int test_group(const OSSL_PARAM params[], void *data) return ret; } -static int test_provider_groups(OSSL_PROVIDER *provider, void *vctx) -{ +static int test_provider_groups(OSSL_PROVIDER *provider, void *vctx) { const char *provname = OSSL_PROVIDER_get0_name(provider); if (!strcmp(provname, PROVIDER_NAME_OQS)) @@ -128,8 +124,7 @@ static int test_provider_groups(OSSL_PROVIDER *provider, void *vctx) return 1; } -int main(int argc, char *argv[]) -{ +int main(int argc, char *argv[]) { size_t i; int errcnt = 0, test = 0; diff --git a/test/oqs_test_kems.c b/test/oqs_test_kems.c index 4b734aa9..fbb37bc3 100644 --- a/test/oqs_test_kems.c +++ b/test/oqs_test_kems.c @@ -10,8 +10,7 @@ static OSSL_LIB_CTX *libctx = NULL; static char *modulename = NULL; static char *configfile = NULL; -static int test_oqs_kems(const char *kemalg_name) -{ +static int test_oqs_kems(const char *kemalg_name) { EVP_MD_CTX *mdctx = NULL; EVP_PKEY_CTX *ctx = NULL; EVP_PKEY *key = NULL; @@ -29,39 +28,38 @@ static int test_oqs_kems(const char *kemalg_name) // test with built-in digest only if default provider is active: // TBD revisit when hybrids are activated: They always need default provider if (OSSL_PROVIDER_available(libctx, "default")) { - testresult - &= (ctx = EVP_PKEY_CTX_new_from_name(libctx, kemalg_name, NULL)) - != NULL - && EVP_PKEY_keygen_init(ctx) && EVP_PKEY_generate(ctx, &key); + testresult &= (ctx = EVP_PKEY_CTX_new_from_name(libctx, kemalg_name, + NULL)) != NULL && + EVP_PKEY_keygen_init(ctx) && EVP_PKEY_generate(ctx, &key); if (!testresult) goto err; EVP_PKEY_CTX_free(ctx); ctx = NULL; - testresult - &= (ctx = EVP_PKEY_CTX_new_from_pkey(libctx, key, NULL)) != NULL - && EVP_PKEY_encapsulate_init(ctx, NULL) - && EVP_PKEY_encapsulate(ctx, NULL, &outlen, NULL, &seclen) - && (out = OPENSSL_malloc(outlen)) != NULL - && (secenc = OPENSSL_malloc(seclen)) != NULL - && memset(secenc, 0x11, seclen) != NULL - && (secdec = OPENSSL_malloc(seclen)) != NULL - && memset(secdec, 0xff, seclen) != NULL - && EVP_PKEY_encapsulate(ctx, out, &outlen, secenc, &seclen) - && EVP_PKEY_decapsulate_init(ctx, NULL) - && EVP_PKEY_decapsulate(ctx, secdec, &seclen, out, outlen) - && memcmp(secenc, secdec, seclen) == 0; + testresult &= + (ctx = EVP_PKEY_CTX_new_from_pkey(libctx, key, NULL)) != NULL && + EVP_PKEY_encapsulate_init(ctx, NULL) && + EVP_PKEY_encapsulate(ctx, NULL, &outlen, NULL, &seclen) && + (out = OPENSSL_malloc(outlen)) != NULL && + (secenc = OPENSSL_malloc(seclen)) != NULL && + memset(secenc, 0x11, seclen) != NULL && + (secdec = OPENSSL_malloc(seclen)) != NULL && + memset(secdec, 0xff, seclen) != NULL && + EVP_PKEY_encapsulate(ctx, out, &outlen, secenc, &seclen) && + EVP_PKEY_decapsulate_init(ctx, NULL) && + EVP_PKEY_decapsulate(ctx, secdec, &seclen, out, outlen) && + memcmp(secenc, secdec, seclen) == 0; if (!testresult) goto err; out[0] = ~out[0]; out[outlen - 1] = ~out[outlen - 1]; - testresult - &= memset(secdec, 0xff, seclen) != NULL - && EVP_PKEY_decapsulate_init(ctx, NULL) - && (EVP_PKEY_decapsulate(ctx, secdec, &seclen, out, outlen) || 1) - && memcmp(secenc, secdec, seclen) != 0; + testresult &= + memset(secdec, 0xff, seclen) != NULL && + EVP_PKEY_decapsulate_init(ctx, NULL) && + (EVP_PKEY_decapsulate(ctx, secdec, &seclen, out, outlen) || 1) && + memcmp(secenc, secdec, seclen) != 0; } err: @@ -75,8 +73,7 @@ static int test_oqs_kems(const char *kemalg_name) #define nelem(a) (sizeof(a) / sizeof((a)[0])) -int main(int argc, char *argv[]) -{ +int main(int argc, char *argv[]) { size_t i; int errcnt = 0, test = 0, query_nocache; OSSL_PROVIDER *oqsprov = NULL; @@ -91,8 +88,8 @@ int main(int argc, char *argv[]) oqsprov = OSSL_PROVIDER_load(libctx, modulename); - kemalgs - = OSSL_PROVIDER_query_operation(oqsprov, OSSL_OP_KEM, &query_nocache); + kemalgs = + OSSL_PROVIDER_query_operation(oqsprov, OSSL_OP_KEM, &query_nocache); if (kemalgs) { for (; kemalgs->algorithm_names != NULL; kemalgs++) { if (test_oqs_kems(kemalgs->algorithm_names)) { diff --git a/test/oqs_test_signatures.c b/test/oqs_test_signatures.c index b1137839..fc81acfc 100644 --- a/test/oqs_test_signatures.c +++ b/test/oqs_test_signatures.c @@ -15,8 +15,7 @@ static char *srpvfile = NULL; static char *tmpfilename = NULL; // sign-and-hash must work with and without providing a digest algorithm -static int test_oqs_signatures(const char *sigalg_name) -{ +static int test_oqs_signatures(const char *sigalg_name) { EVP_MD_CTX *mdctx = NULL; EVP_PKEY_CTX *ctx = NULL; EVP_PKEY *key = NULL; @@ -33,26 +32,26 @@ static int test_oqs_signatures(const char *sigalg_name) // test with built-in digest only if default provider is active: // TBD revisit when hybrids are activated: They always need default provider if (OSSL_PROVIDER_available(libctx, "default")) { - testresult - &= (ctx = EVP_PKEY_CTX_new_from_name(libctx, sigalg_name, NULL)) - != NULL - && EVP_PKEY_keygen_init(ctx) && EVP_PKEY_generate(ctx, &key) - && (mdctx = EVP_MD_CTX_new()) != NULL - && EVP_DigestSignInit_ex(mdctx, NULL, "SHA512", libctx, NULL, - key, NULL) - && EVP_DigestSignUpdate(mdctx, msg, sizeof(msg)) - && EVP_DigestSignFinal(mdctx, NULL, &siglen) - && (sig = OPENSSL_malloc(siglen)) != NULL - && EVP_DigestSignFinal(mdctx, sig, &siglen) - && EVP_DigestVerifyInit_ex(mdctx, NULL, "SHA512", libctx, NULL, - key, NULL) - && EVP_DigestVerifyUpdate(mdctx, msg, sizeof(msg)) - && EVP_DigestVerifyFinal(mdctx, sig, siglen); + testresult &= + (ctx = EVP_PKEY_CTX_new_from_name(libctx, sigalg_name, NULL)) != + NULL && + EVP_PKEY_keygen_init(ctx) && EVP_PKEY_generate(ctx, &key) && + (mdctx = EVP_MD_CTX_new()) != NULL && + EVP_DigestSignInit_ex(mdctx, NULL, "SHA512", libctx, NULL, key, + NULL) && + EVP_DigestSignUpdate(mdctx, msg, sizeof(msg)) && + EVP_DigestSignFinal(mdctx, NULL, &siglen) && + (sig = OPENSSL_malloc(siglen)) != NULL && + EVP_DigestSignFinal(mdctx, sig, &siglen) && + EVP_DigestVerifyInit_ex(mdctx, NULL, "SHA512", libctx, NULL, key, + NULL) && + EVP_DigestVerifyUpdate(mdctx, msg, sizeof(msg)) && + EVP_DigestVerifyFinal(mdctx, sig, siglen); sig[0] = ~sig[0]; testresult &= EVP_DigestVerifyInit_ex(mdctx, NULL, "SHA512", libctx, - NULL, key, NULL) - && EVP_DigestVerifyUpdate(mdctx, msg, sizeof(msg)) - && !EVP_DigestVerifyFinal(mdctx, sig, siglen); + NULL, key, NULL) && + EVP_DigestVerifyUpdate(mdctx, msg, sizeof(msg)) && + !EVP_DigestVerifyFinal(mdctx, sig, siglen); } EVP_MD_CTX_free(mdctx); @@ -63,24 +62,23 @@ static int test_oqs_signatures(const char *sigalg_name) key = NULL; // this test must work also with default provider inactive: - testresult - &= (ctx = EVP_PKEY_CTX_new_from_name(libctx, sigalg_name, NULL)) != NULL - && EVP_PKEY_keygen_init(ctx) && EVP_PKEY_generate(ctx, &key) - && (mdctx = EVP_MD_CTX_new()) != NULL - && EVP_DigestSignInit_ex(mdctx, NULL, NULL, libctx, NULL, key, NULL) - && EVP_DigestSignUpdate(mdctx, msg, sizeof(msg)) - && EVP_DigestSignFinal(mdctx, NULL, &siglen) - && (sig = OPENSSL_malloc(siglen)) != NULL - && EVP_DigestSignFinal(mdctx, sig, &siglen) - && EVP_DigestVerifyInit_ex(mdctx, NULL, NULL, libctx, NULL, key, - NULL) - && EVP_DigestVerifyUpdate(mdctx, msg, sizeof(msg)) - && EVP_DigestVerifyFinal(mdctx, sig, siglen); + testresult &= + (ctx = EVP_PKEY_CTX_new_from_name(libctx, sigalg_name, NULL)) != NULL && + EVP_PKEY_keygen_init(ctx) && EVP_PKEY_generate(ctx, &key) && + (mdctx = EVP_MD_CTX_new()) != NULL && + EVP_DigestSignInit_ex(mdctx, NULL, NULL, libctx, NULL, key, NULL) && + EVP_DigestSignUpdate(mdctx, msg, sizeof(msg)) && + EVP_DigestSignFinal(mdctx, NULL, &siglen) && + (sig = OPENSSL_malloc(siglen)) != NULL && + EVP_DigestSignFinal(mdctx, sig, &siglen) && + EVP_DigestVerifyInit_ex(mdctx, NULL, NULL, libctx, NULL, key, NULL) && + EVP_DigestVerifyUpdate(mdctx, msg, sizeof(msg)) && + EVP_DigestVerifyFinal(mdctx, sig, siglen); sig[0] = ~sig[0]; - testresult - &= EVP_DigestVerifyInit_ex(mdctx, NULL, NULL, libctx, NULL, key, NULL) - && EVP_DigestVerifyUpdate(mdctx, msg, sizeof(msg)) - && !EVP_DigestVerifyFinal(mdctx, sig, siglen); + testresult &= + EVP_DigestVerifyInit_ex(mdctx, NULL, NULL, libctx, NULL, key, NULL) && + EVP_DigestVerifyUpdate(mdctx, msg, sizeof(msg)) && + !EVP_DigestVerifyFinal(mdctx, sig, siglen); EVP_MD_CTX_free(mdctx); EVP_PKEY_free(key); @@ -91,8 +89,7 @@ static int test_oqs_signatures(const char *sigalg_name) #define nelem(a) (sizeof(a) / sizeof((a)[0])) -int main(int argc, char *argv[]) -{ +int main(int argc, char *argv[]) { size_t i; int errcnt = 0, test = 0, query_nocache; OSSL_PROVIDER *oqsprov = NULL; diff --git a/test/oqs_test_tlssig.c b/test/oqs_test_tlssig.c index a735570a..d5ae6c80 100644 --- a/test/oqs_test_tlssig.c +++ b/test/oqs_test_tlssig.c @@ -19,18 +19,17 @@ static char *configfile = NULL; static char *certsdir = NULL; #ifdef OSSL_CAPABILITY_TLS_SIGALG_NAME -static int test_oqs_tlssig(const char *sig_name) -{ +static int test_oqs_tlssig(const char *sig_name) { SSL_CTX *cctx = NULL, *sctx = NULL; SSL *clientssl = NULL, *serverssl = NULL; int ret = 1, testresult = 0; char certpath[300]; char privkeypath[300]; -# ifndef OPENSSL_SYS_VMS +#ifndef OPENSSL_SYS_VMS const char *sep = "/"; -# else +#else const char *sep = ""; -# endif +#endif if (!alg_is_enabled(sig_name)) { printf("Not testing disabled algorithm %s.\n", sig_name); @@ -55,8 +54,8 @@ static int test_oqs_tlssig(const char *sig_name) goto err; } - testresult - = create_tls1_3_ctx_pair(libctx, &sctx, &cctx, certpath, privkeypath); + testresult = + create_tls1_3_ctx_pair(libctx, &sctx, &cctx, certpath, privkeypath); if (!testresult) { ret = -1; @@ -95,12 +94,11 @@ EVP_SIGNATURE_get0_name(evpsig)); } */ -static int test_signature(const OSSL_PARAM params[], void *data) -{ +static int test_signature(const OSSL_PARAM params[], void *data) { int ret = 0; int *errcnt = (int *)data; - const OSSL_PARAM *p - = OSSL_PARAM_locate_const(params, OSSL_CAPABILITY_TLS_SIGALG_NAME); + const OSSL_PARAM *p = + OSSL_PARAM_locate_const(params, OSSL_CAPABILITY_TLS_SIGALG_NAME); if (p == NULL || p->data_type != OSSL_PARAM_UTF8_STRING) { ret = -1; @@ -133,8 +131,7 @@ static int test_signature(const OSSL_PARAM params[], void *data) return ret; } -static int test_provider_signatures(OSSL_PROVIDER *provider, void *vctx) -{ +static int test_provider_signatures(OSSL_PROVIDER *provider, void *vctx) { const char *provname = OSSL_PROVIDER_get0_name(provider); if (!strcmp(provname, PROVIDER_NAME_OQS)) @@ -145,8 +142,7 @@ static int test_provider_signatures(OSSL_PROVIDER *provider, void *vctx) } #endif /* OSSL_CAPABILITY_TLS_SIGALG_NAME */ -int main(int argc, char *argv[]) -{ +int main(int argc, char *argv[]) { size_t i; int errcnt = 0, test = 0; @@ -171,9 +167,8 @@ int main(int argc, char *argv[]) // crashes: EVP_SIGNATURE_do_all_provided(libctx, test_oqs_sigs, &errcnt); OSSL_PROVIDER_do_all(libctx, test_provider_signatures, &errcnt); #else - fprintf( - stderr, - "TLS-SIG handshake test not enabled. Update OpenSSL to more current version.\n"); + fprintf(stderr, "TLS-SIG handshake test not enabled. Update OpenSSL to " + "more current version.\n"); #endif OSSL_LIB_CTX_free(libctx); diff --git a/test/test_common.c b/test/test_common.c index cee953d9..e0f3026d 100644 --- a/test/test_common.c +++ b/test/test_common.c @@ -3,8 +3,7 @@ #include "test_common.h" #include -void hexdump(const void *ptr, size_t len) -{ +void hexdump(const void *ptr, size_t len) { const unsigned char *p = ptr; size_t i, j; @@ -16,8 +15,7 @@ void hexdump(const void *ptr, size_t len) } #define MIN(X, Y) (((X) < (Y)) ? (X) : (Y)) -int alg_is_enabled(const char *algname) -{ +int alg_is_enabled(const char *algname) { char *alglist = getenv("OQS_SKIP_TESTS"); char *comma = NULL; char totest[200]; @@ -35,25 +33,23 @@ int alg_is_enabled(const char *algname) return strstr(algname, alglist) == NULL; } -OSSL_PROVIDER *load_default_provider(OSSL_LIB_CTX *libctx) -{ +OSSL_PROVIDER *load_default_provider(OSSL_LIB_CTX *libctx) { OSSL_PROVIDER *provider; T((provider = OSSL_PROVIDER_load(libctx, "default"))); return provider; } #ifdef OQS_PROVIDER_STATIC -# define OQS_PROVIDER_ENTRYPOINT_NAME oqs_provider_init +#define OQS_PROVIDER_ENTRYPOINT_NAME oqs_provider_init #else -# define OQS_PROVIDER_ENTRYPOINT_NAME OSSL_provider_init +#define OQS_PROVIDER_ENTRYPOINT_NAME OSSL_provider_init #endif // ifdef OQS_PROVIDER_STATIC #ifndef OQS_PROVIDER_STATIC /* Loads the oqs-provider from a shared module (.so). */ void load_oqs_provider(OSSL_LIB_CTX *libctx, const char *modulename, - const char *configfile) -{ + const char *configfile) { T(OSSL_LIB_CTX_load_config(libctx, configfile)); T(OSSL_PROVIDER_available(libctx, modulename)); } @@ -64,8 +60,7 @@ extern OSSL_provider_init_fn OQS_PROVIDER_ENTRYPOINT_NAME; /* Loads the statically linked oqs-provider. */ void load_oqs_provider(OSSL_LIB_CTX *libctx, const char *modulename, - const char *configfile) -{ + const char *configfile) { (void)configfile; T(OSSL_PROVIDER_add_builtin(libctx, modulename, OQS_PROVIDER_ENTRYPOINT_NAME)); diff --git a/test/test_common.h b/test/test_common.h index 5cb9161d..b7aa76ff 100644 --- a/test/test_common.h +++ b/test/test_common.h @@ -5,32 +5,32 @@ #include /* For controlled success */ -#define T(e) \ - if (!(e)) { \ - ERR_print_errors_fp(stderr); \ - OPENSSL_die(#e, __FILE__, __LINE__); \ +#define T(e) \ + if (!(e)) { \ + ERR_print_errors_fp(stderr); \ + OPENSSL_die(#e, __FILE__, __LINE__); \ } /* For controlled failure */ -#define TF(e) \ - if ((e)) { \ - ERR_print_errors_fp(stderr); \ - } else { \ - OPENSSL_die(#e, __FILE__, __LINE__); \ +#define TF(e) \ + if ((e)) { \ + ERR_print_errors_fp(stderr); \ + } else { \ + OPENSSL_die(#e, __FILE__, __LINE__); \ } -#define cRED "\033[1;31m" -#define cDRED "\033[0;31m" -#define cGREEN "\033[1;32m" -#define cDGREEN "\033[0;32m" -#define cBLUE "\033[1;34m" -#define cDBLUE "\033[0;34m" -#define cNORM "\033[m" +#define cRED "\033[1;31m" +#define cDRED "\033[0;31m" +#define cGREEN "\033[1;32m" +#define cDGREEN "\033[0;32m" +#define cBLUE "\033[1;34m" +#define cDBLUE "\033[0;34m" +#define cNORM "\033[m" #define PROVIDER_NAME_OQS "oqsprovider" -#define TEST_ASSERT(e) \ - { \ - if (!(test = (e))) \ - printf(cRED " Test FAILED" cNORM "\n"); \ - else \ - printf(cGREEN " Test passed" cNORM "\n"); \ +#define TEST_ASSERT(e) \ + { \ + if (!(test = (e))) \ + printf(cRED " Test FAILED" cNORM "\n"); \ + else \ + printf(cGREEN " Test passed" cNORM "\n"); \ } void hexdump(const void *ptr, size_t len); diff --git a/test/tlstest_helpers.c b/test/tlstest_helpers.c index c2490887..e3ccb384 100644 --- a/test/tlstest_helpers.c +++ b/test/tlstest_helpers.c @@ -6,8 +6,7 @@ /* Stolen from openssl/tests/sslapitest.c: */ int create_cert_key(OSSL_LIB_CTX *libctx, char *algname, char *certfilename, - char *privkeyfilename) -{ + char *privkeyfilename) { EVP_PKEY_CTX *evpctx = EVP_PKEY_CTX_new_from_name(libctx, algname, NULL); EVP_PKEY *pkey = NULL; X509 *x509 = X509_new(); @@ -15,24 +14,24 @@ int create_cert_key(OSSL_LIB_CTX *libctx, char *algname, char *certfilename, BIO *keybio = NULL, *certbio = NULL; int ret = 1; - if (!evpctx || !EVP_PKEY_keygen_init(evpctx) - || !EVP_PKEY_generate(evpctx, &pkey) || !pkey || !x509 - || !ASN1_INTEGER_set(X509_get_serialNumber(x509), 1) - || !X509_gmtime_adj(X509_getm_notBefore(x509), 0) - || !X509_gmtime_adj(X509_getm_notAfter(x509), 31536000L) - || !X509_set_pubkey(x509, pkey) || !(name = X509_get_subject_name(x509)) - || !X509_NAME_add_entry_by_txt(name, "C", MBSTRING_ASC, - (unsigned char *)"CH", -1, -1, 0) - || !X509_NAME_add_entry_by_txt(name, "O", MBSTRING_ASC, - (unsigned char *)"test.org", -1, -1, 0) - || !X509_NAME_add_entry_by_txt(name, "CN", MBSTRING_ASC, - (unsigned char *)"localhost", -1, -1, 0) - || !X509_set_issuer_name(x509, name) - || !X509_sign(x509, pkey, EVP_sha1()) - || !(keybio = BIO_new_file(privkeyfilename, "wb")) - || !PEM_write_bio_PrivateKey(keybio, pkey, NULL, NULL, 0, NULL, NULL) - || !(certbio = BIO_new_file(certfilename, "wb")) - || !PEM_write_bio_X509(certbio, x509)) + if (!evpctx || !EVP_PKEY_keygen_init(evpctx) || + !EVP_PKEY_generate(evpctx, &pkey) || !pkey || !x509 || + !ASN1_INTEGER_set(X509_get_serialNumber(x509), 1) || + !X509_gmtime_adj(X509_getm_notBefore(x509), 0) || + !X509_gmtime_adj(X509_getm_notAfter(x509), 31536000L) || + !X509_set_pubkey(x509, pkey) || !(name = X509_get_subject_name(x509)) || + !X509_NAME_add_entry_by_txt(name, "C", MBSTRING_ASC, + (unsigned char *)"CH", -1, -1, 0) || + !X509_NAME_add_entry_by_txt(name, "O", MBSTRING_ASC, + (unsigned char *)"test.org", -1, -1, 0) || + !X509_NAME_add_entry_by_txt(name, "CN", MBSTRING_ASC, + (unsigned char *)"localhost", -1, -1, 0) || + !X509_set_issuer_name(x509, name) || + !X509_sign(x509, pkey, EVP_sha1()) || + !(keybio = BIO_new_file(privkeyfilename, "wb")) || + !PEM_write_bio_PrivateKey(keybio, pkey, NULL, NULL, 0, NULL, NULL) || + !(certbio = BIO_new_file(certfilename, "wb")) || + !PEM_write_bio_X509(certbio, x509)) ret = 0; EVP_PKEY_free(pkey); @@ -44,8 +43,7 @@ int create_cert_key(OSSL_LIB_CTX *libctx, char *algname, char *certfilename, } /* end steal */ int create_tls1_3_ctx_pair(OSSL_LIB_CTX *libctx, SSL_CTX **sctx, SSL_CTX **cctx, - char *certfile, char *privkeyfile) -{ + char *certfile, char *privkeyfile) { SSL_CTX *serverctx = NULL, *clientctx = NULL; if (sctx == NULL || cctx == NULL) @@ -83,8 +81,7 @@ int create_tls1_3_ctx_pair(OSSL_LIB_CTX *libctx, SSL_CTX **sctx, SSL_CTX **cctx, } int create_tls_objects(SSL_CTX *serverctx, SSL_CTX *clientctx, SSL **sssl, - SSL **cssl) -{ + SSL **cssl) { SSL *serverssl = NULL, *clientssl = NULL; BIO *s_to_c_bio = NULL, *c_to_s_bio = NULL; @@ -134,8 +131,7 @@ int create_tls_objects(SSL_CTX *serverctx, SSL_CTX *clientctx, SSL **sssl, * attempt could be restarted by a subsequent call to this function. */ int create_bare_tls_connection(SSL *serverssl, SSL *clientssl, int want, - int read) -{ + int read) { int retc = -1, rets = -1, err, abortctr = 0; int clienterr = 0, servererr = 0; @@ -166,8 +162,8 @@ int create_bare_tls_connection(SSL *serverssl, SSL *clientssl, int want, err = SSL_get_error(serverssl, rets); } - if (!servererr && rets <= 0 && err != SSL_ERROR_WANT_READ - && err != SSL_ERROR_WANT_X509_LOOKUP) { + if (!servererr && rets <= 0 && err != SSL_ERROR_WANT_READ && + err != SSL_ERROR_WANT_X509_LOOKUP) { fprintf(stderr, "SSL_accept() failed returning %d, SSL error %d.\n", rets, err); ERR_print_errors_fp(stderr); @@ -194,8 +190,7 @@ int create_bare_tls_connection(SSL *serverssl, SSL *clientssl, int want, * Create an SSL connection including any post handshake NewSessionTicket * messages. */ -int create_tls_connection(SSL *serverssl, SSL *clientssl, int want) -{ +int create_tls_connection(SSL *serverssl, SSL *clientssl, int want) { int i; unsigned char buf; size_t readbytes;