diff --git a/oqsprov/oqs_decode_der2key.c b/oqsprov/oqs_decode_der2key.c index 4bedc2c8..99093ffa 100644 --- a/oqsprov/oqs_decode_der2key.c +++ b/oqsprov/oqs_decode_der2key.c @@ -492,12 +492,10 @@ static void oqsx_key_adjust(void *key, struct der2key_ctx_st *ctx) * It takes the following arguments: * * oqskemhyb Possible prefix for OQS KEM hybrids; typically empty - * oqskemhyb Possible prefix for OQS KEM hybrids; typically empty * keytype_name The implementation key type as a string. * keytype The implementation key type. This must correspond exactly * to our existing keymgmt keytype names... in other words, * there must exist an oqs_##keytype##_keymgmt_functions. - * there must exist an oqs_##keytype##_keymgmt_functions. * type The type name for the set of functions that implement the * decoder for the key type. This isn't necessarily the same * as keytype. For example, the key types ed25519, ed448, @@ -508,34 +506,6 @@ 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}, \ #define MAKE_DECODER(oqskemhyb, keytype_name, keytype, type, kind) \ static struct keytype_desc_st kind##_##keytype##_desc \ = {keytype_name, oqs##oqskemhyb##_##keytype##_keymgmt_functions, \ @@ -798,77 +768,52 @@ 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, MAKE_DECODER(, "p521_falconpadded1024", p521_falconpadded1024, oqsx, PrivateKeyInfo); MAKE_DECODER(, "p521_falconpadded1024", p521_falconpadded1024, oqsx, SubjectPublicKeyInfo); -MAKE_DECODER(, "sphincssha2128fsimple", sphincssha2128fsimple, oqsx, MAKE_DECODER(, "sphincssha2128fsimple", sphincssha2128fsimple, oqsx, PrivateKeyInfo); -MAKE_DECODER(, "sphincssha2128fsimple", sphincssha2128fsimple, oqsx, MAKE_DECODER(, "sphincssha2128fsimple", sphincssha2128fsimple, oqsx, SubjectPublicKeyInfo); -MAKE_DECODER(, "p256_sphincssha2128fsimple", p256_sphincssha2128fsimple, oqsx, MAKE_DECODER(, "p256_sphincssha2128fsimple", p256_sphincssha2128fsimple, oqsx, PrivateKeyInfo); -MAKE_DECODER(, "p256_sphincssha2128fsimple", p256_sphincssha2128fsimple, oqsx, MAKE_DECODER(, "p256_sphincssha2128fsimple", p256_sphincssha2128fsimple, oqsx, SubjectPublicKeyInfo); -MAKE_DECODER(, "rsa3072_sphincssha2128fsimple", rsa3072_sphincssha2128fsimple, MAKE_DECODER(, "rsa3072_sphincssha2128fsimple", rsa3072_sphincssha2128fsimple, oqsx, PrivateKeyInfo); -MAKE_DECODER(, "rsa3072_sphincssha2128fsimple", rsa3072_sphincssha2128fsimple, MAKE_DECODER(, "rsa3072_sphincssha2128fsimple", rsa3072_sphincssha2128fsimple, oqsx, SubjectPublicKeyInfo); -MAKE_DECODER(, "sphincssha2128ssimple", sphincssha2128ssimple, oqsx, MAKE_DECODER(, "sphincssha2128ssimple", sphincssha2128ssimple, oqsx, PrivateKeyInfo); -MAKE_DECODER(, "sphincssha2128ssimple", sphincssha2128ssimple, oqsx, MAKE_DECODER(, "sphincssha2128ssimple", sphincssha2128ssimple, oqsx, SubjectPublicKeyInfo); -MAKE_DECODER(, "p256_sphincssha2128ssimple", p256_sphincssha2128ssimple, oqsx, MAKE_DECODER(, "p256_sphincssha2128ssimple", p256_sphincssha2128ssimple, oqsx, PrivateKeyInfo); -MAKE_DECODER(, "p256_sphincssha2128ssimple", p256_sphincssha2128ssimple, oqsx, MAKE_DECODER(, "p256_sphincssha2128ssimple", p256_sphincssha2128ssimple, oqsx, SubjectPublicKeyInfo); -MAKE_DECODER(, "rsa3072_sphincssha2128ssimple", rsa3072_sphincssha2128ssimple, MAKE_DECODER(, "rsa3072_sphincssha2128ssimple", rsa3072_sphincssha2128ssimple, oqsx, PrivateKeyInfo); -MAKE_DECODER(, "rsa3072_sphincssha2128ssimple", rsa3072_sphincssha2128ssimple, MAKE_DECODER(, "rsa3072_sphincssha2128ssimple", rsa3072_sphincssha2128ssimple, oqsx, SubjectPublicKeyInfo); -MAKE_DECODER(, "sphincssha2192fsimple", sphincssha2192fsimple, oqsx, MAKE_DECODER(, "sphincssha2192fsimple", sphincssha2192fsimple, oqsx, PrivateKeyInfo); -MAKE_DECODER(, "sphincssha2192fsimple", sphincssha2192fsimple, oqsx, MAKE_DECODER(, "sphincssha2192fsimple", sphincssha2192fsimple, oqsx, SubjectPublicKeyInfo); -MAKE_DECODER(, "p384_sphincssha2192fsimple", p384_sphincssha2192fsimple, oqsx, MAKE_DECODER(, "p384_sphincssha2192fsimple", p384_sphincssha2192fsimple, oqsx, PrivateKeyInfo); -MAKE_DECODER(, "p384_sphincssha2192fsimple", p384_sphincssha2192fsimple, oqsx, MAKE_DECODER(, "p384_sphincssha2192fsimple", p384_sphincssha2192fsimple, oqsx, SubjectPublicKeyInfo); -MAKE_DECODER(, "sphincsshake128fsimple", sphincsshake128fsimple, oqsx, MAKE_DECODER(, "sphincsshake128fsimple", sphincsshake128fsimple, oqsx, PrivateKeyInfo); -MAKE_DECODER(, "sphincsshake128fsimple", sphincsshake128fsimple, oqsx, MAKE_DECODER(, "sphincsshake128fsimple", sphincsshake128fsimple, oqsx, SubjectPublicKeyInfo); -MAKE_DECODER(, "p256_sphincsshake128fsimple", p256_sphincsshake128fsimple, oqsx, MAKE_DECODER(, "p256_sphincsshake128fsimple", p256_sphincsshake128fsimple, oqsx, PrivateKeyInfo); -MAKE_DECODER(, "p256_sphincsshake128fsimple", p256_sphincsshake128fsimple, oqsx, MAKE_DECODER(, "p256_sphincsshake128fsimple", p256_sphincsshake128fsimple, oqsx, SubjectPublicKeyInfo); -MAKE_DECODER(, "rsa3072_sphincsshake128fsimple", rsa3072_sphincsshake128fsimple, MAKE_DECODER(, "rsa3072_sphincsshake128fsimple", rsa3072_sphincsshake128fsimple, oqsx, PrivateKeyInfo); -MAKE_DECODER(, "rsa3072_sphincsshake128fsimple", rsa3072_sphincsshake128fsimple, MAKE_DECODER(, "rsa3072_sphincsshake128fsimple", rsa3072_sphincsshake128fsimple, oqsx, SubjectPublicKeyInfo); ///// OQS_TEMPLATE_FRAGMENT_DECODER_MAKE_END diff --git a/oqsprov/oqs_kmgmt.c b/oqsprov/oqs_kmgmt.c index 9c31df3b..7c5f870e 100644 --- a/oqsprov/oqs_kmgmt.c +++ b/oqsprov/oqs_kmgmt.c @@ -139,11 +139,6 @@ static int oqsx_match(const void *keydata1, const void *keydata2, int selection) return 0; } - if (key1 == NULL || key2 == NULL) { - ERR_raise(ERR_LIB_USER, OQSPROV_R_WRONG_PARAMETERS); - return 0; - } - #ifdef NOPUBKEY_IN_PRIVKEY /* Now this is a "leap of faith" logic: If a public-only PKEY and a * private-only PKEY are tested for equality we cannot do anything other @@ -170,9 +165,7 @@ static int oqsx_match(const void *keydata1, const void *keydata2, int selection) || (key1->privkey != NULL && key2->privkey == NULL) || ((key1->tls_name != NULL && key2->tls_name != NULL) && strcmp(key1->tls_name, key2->tls_name))) { - && strcmp(key1->tls_name, key2->tls_name))) { ok = 0; - } else { } else { ok = ((key1->privkey == NULL && key2->privkey == NULL) || ((key1->privkey != NULL) @@ -180,7 +173,6 @@ static int oqsx_match(const void *keydata1, const void *keydata2, int selection) key1->privkeylen) == 0)); } - } } if ((selection & OSSL_KEYMGMT_SELECT_PUBLIC_KEY) != 0) { @@ -188,7 +180,6 @@ static int oqsx_match(const void *keydata1, const void *keydata2, int selection) || (key1->pubkey != NULL && key2->pubkey == NULL) || ((key1->tls_name != NULL && key2->tls_name != NULL) && strcmp(key1->tls_name, key2->tls_name))) { - && 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) @@ -196,7 +187,6 @@ static int oqsx_match(const void *keydata1, const void *keydata2, int selection) && (CRYPTO_memcmp(key1->privkey, key2->privkey, key1->privkeylen) == 0); - } else { } else { ok = ok && ((key1->pubkey == NULL && key2->pubkey == NULL) @@ -205,7 +195,6 @@ static int oqsx_match(const void *keydata1, const void *keydata2, int selection) key1->pubkeylen) == 0)); } - } } if (!ok) OQS_KM_PRINTF("OQSKEYMGMT: match failed!\n"); @@ -275,7 +264,6 @@ int oqsx_key_to_params(const OQSX_KEY *key, OSSL_PARAM_BLD *tmpl, } } // not passing in params to respond to is no error; the response is empty - // not passing in params to respond to is no error; the response is empty ret = 1; err: return ret; @@ -296,8 +284,6 @@ static int oqsx_export(void *keydata, int selection, OSSL_CALLBACK *param_cb, * In this implementation, only public and private keys can be exported, * nothing else */ - if (key == NULL || param_cb == NULL) { - ERR_raise(ERR_LIB_USER, OQSPROV_R_WRONG_PARAMETERS); if (key == NULL || param_cb == NULL) { ERR_raise(ERR_LIB_USER, OQSPROV_R_WRONG_PARAMETERS); return 0; @@ -353,11 +339,6 @@ static int oqsx_get_params(void *key, OSSL_PARAM params[]) return 0; } - if (oqsxk == NULL || params == NULL) { - ERR_raise(ERR_LIB_USER, OQSPROV_R_WRONG_PARAMETERS); - return 0; - } - 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))) @@ -404,7 +385,6 @@ static int oqsx_get_params(void *key, OSSL_PARAM params[]) return 0; } - // not passing in params to respond to is no error // not passing in params to respond to is no error return 1; } @@ -448,10 +428,6 @@ static int oqsx_set_params(void *key, const OSSL_PARAM params[]) ERR_raise(ERR_LIB_USER, OQSPROV_R_WRONG_PARAMETERS); return 0; } - if (oqsxkey == NULL) { - ERR_raise(ERR_LIB_USER, OQSPROV_R_WRONG_PARAMETERS); - return 0; - } p = OSSL_PARAM_locate_const(params, OSSL_PKEY_PARAM_ENCODED_PUBLIC_KEY); if (p != NULL) { size_t used_len; @@ -484,7 +460,6 @@ static int oqsx_set_params(void *key, const OSSL_PARAM params[]) } } - // not passing in params to set is no error, just a no-op // not passing in params to set is no error, just a no-op return 1; } @@ -530,8 +505,6 @@ static void *oqsx_genkey(struct oqsx_gen_ctx *gctx) return NULL; OQS_KM_PRINTF3("OQSKEYMGMT: gen called for %s (%s)\n", gctx->oqs_name, gctx->tls_name); - OQS_KM_PRINTF3("OQSKEYMGMT: gen called for %s (%s)\n", gctx->oqs_name, - 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)) @@ -618,7 +591,6 @@ static int oqsx_gen_set_params(void *genctx, const OSSL_PARAM params[]) return 0; } // not passing in params is no error; subsequent operations may fail, though - // not passing in params is no error; subsequent operations may fail, though return 1; } @@ -1368,15 +1340,10 @@ MAKE_SIG_KEYMGMT_FUNCTIONS(rsa3072_falcon512) MAKE_SIG_KEYMGMT_FUNCTIONS(falconpadded512) MAKE_SIG_KEYMGMT_FUNCTIONS(p256_falconpadded512) MAKE_SIG_KEYMGMT_FUNCTIONS(rsa3072_falconpadded512) -MAKE_SIG_KEYMGMT_FUNCTIONS(falconpadded512) -MAKE_SIG_KEYMGMT_FUNCTIONS(p256_falconpadded512) -MAKE_SIG_KEYMGMT_FUNCTIONS(rsa3072_falconpadded512) MAKE_SIG_KEYMGMT_FUNCTIONS(falcon1024) MAKE_SIG_KEYMGMT_FUNCTIONS(p521_falcon1024) MAKE_SIG_KEYMGMT_FUNCTIONS(falconpadded1024) MAKE_SIG_KEYMGMT_FUNCTIONS(p521_falconpadded1024) -MAKE_SIG_KEYMGMT_FUNCTIONS(falconpadded1024) -MAKE_SIG_KEYMGMT_FUNCTIONS(p521_falconpadded1024) MAKE_SIG_KEYMGMT_FUNCTIONS(sphincssha2128fsimple) MAKE_SIG_KEYMGMT_FUNCTIONS(p256_sphincssha2128fsimple) MAKE_SIG_KEYMGMT_FUNCTIONS(rsa3072_sphincssha2128fsimple) @@ -1456,23 +1423,6 @@ MAKE_KEM_ECX_KEYMGMT_FUNCTIONS(x25519_mlkem768, OQS_KEM_alg_ml_kem_768, 128) MAKE_KEM_ECP_KEYMGMT_FUNCTIONS(p256_mlkem768, OQS_KEM_alg_ml_kem_768, 128) MAKE_KEM_KEYMGMT_FUNCTIONS(mlkem1024, OQS_KEM_alg_ml_kem_1024, 256) -MAKE_KEM_ECP_KEYMGMT_FUNCTIONS(p521_mlkem1024, OQS_KEM_alg_ml_kem_1024, 256) -MAKE_KEM_ECP_KEYMGMT_FUNCTIONS(p384_mlkem1024, OQS_KEM_alg_ml_kem_1024, 192) -MAKE_KEM_KEYMGMT_FUNCTIONS(mlkem512, OQS_KEM_alg_ml_kem_512, 128) - -MAKE_KEM_ECP_KEYMGMT_FUNCTIONS(p256_mlkem512, OQS_KEM_alg_ml_kem_512, 128) - -MAKE_KEM_ECX_KEYMGMT_FUNCTIONS(x25519_mlkem512, OQS_KEM_alg_ml_kem_512, 128) -MAKE_KEM_KEYMGMT_FUNCTIONS(mlkem768, OQS_KEM_alg_ml_kem_768, 192) - -MAKE_KEM_ECP_KEYMGMT_FUNCTIONS(p384_mlkem768, OQS_KEM_alg_ml_kem_768, 192) - -MAKE_KEM_ECX_KEYMGMT_FUNCTIONS(x448_mlkem768, OQS_KEM_alg_ml_kem_768, 192) - -MAKE_KEM_ECX_KEYMGMT_FUNCTIONS(x25519_mlkem768, OQS_KEM_alg_ml_kem_768, 128) -MAKE_KEM_ECP_KEYMGMT_FUNCTIONS(p256_mlkem768, OQS_KEM_alg_ml_kem_768, 128) -MAKE_KEM_KEYMGMT_FUNCTIONS(mlkem1024, OQS_KEM_alg_ml_kem_1024, 256) - MAKE_KEM_ECP_KEYMGMT_FUNCTIONS(p521_mlkem1024, OQS_KEM_alg_ml_kem_1024, 256) MAKE_KEM_ECP_KEYMGMT_FUNCTIONS(p384_mlkem1024, OQS_KEM_alg_ml_kem_1024, 192) MAKE_KEM_KEYMGMT_FUNCTIONS(bikel1, OQS_KEM_alg_bike_l1, 128) diff --git a/oqsprov/oqsdecoders.inc b/oqsprov/oqsdecoders.inc index e61ddba3..f9d9fc4d 100644 --- a/oqsprov/oqsdecoders.inc +++ b/oqsprov/oqsdecoders.inc @@ -226,200 +226,7 @@ DECODER_w_structure("frodo640aes", der, PrivateKeyInfo, frodo640aes), #endif /* OQS_KEM_ENCODERS */ -#ifdef OQS_KEM_ENCODERS - -# ifdef OQS_ENABLE_KEM_frodokem_640_aes -DECODER_w_structure("frodo640aes", der, PrivateKeyInfo, frodo640aes), - DECODER_w_structure("frodo640aes", der, SubjectPublicKeyInfo, frodo640aes), - DECODER_w_structure("p256_frodo640aes", der, PrivateKeyInfo, - p256_frodo640aes), - DECODER_w_structure("p256_frodo640aes", der, SubjectPublicKeyInfo, - p256_frodo640aes), - DECODER_w_structure("x25519_frodo640aes", der, PrivateKeyInfo, - x25519_frodo640aes), - DECODER_w_structure("x25519_frodo640aes", der, SubjectPublicKeyInfo, - x25519_frodo640aes), -# endif -# ifdef OQS_ENABLE_KEM_frodokem_640_shake - DECODER_w_structure("frodo640shake", der, PrivateKeyInfo, frodo640shake), - DECODER_w_structure("frodo640shake", der, SubjectPublicKeyInfo, - frodo640shake), - DECODER_w_structure("p256_frodo640shake", der, PrivateKeyInfo, - p256_frodo640shake), - DECODER_w_structure("p256_frodo640shake", der, SubjectPublicKeyInfo, - p256_frodo640shake), - DECODER_w_structure("x25519_frodo640shake", der, PrivateKeyInfo, - x25519_frodo640shake), - DECODER_w_structure("x25519_frodo640shake", der, SubjectPublicKeyInfo, - x25519_frodo640shake), -# endif -# ifdef OQS_ENABLE_KEM_frodokem_976_aes - DECODER_w_structure("frodo976aes", der, PrivateKeyInfo, frodo976aes), - DECODER_w_structure("frodo976aes", der, SubjectPublicKeyInfo, frodo976aes), - DECODER_w_structure("p384_frodo976aes", der, PrivateKeyInfo, - p384_frodo976aes), - DECODER_w_structure("p384_frodo976aes", der, SubjectPublicKeyInfo, - p384_frodo976aes), - DECODER_w_structure("x448_frodo976aes", der, PrivateKeyInfo, - x448_frodo976aes), - DECODER_w_structure("x448_frodo976aes", der, SubjectPublicKeyInfo, - x448_frodo976aes), -# endif -# ifdef OQS_ENABLE_KEM_frodokem_976_shake - DECODER_w_structure("frodo976shake", der, PrivateKeyInfo, frodo976shake), - DECODER_w_structure("frodo976shake", der, SubjectPublicKeyInfo, - frodo976shake), - DECODER_w_structure("p384_frodo976shake", der, PrivateKeyInfo, - p384_frodo976shake), - DECODER_w_structure("p384_frodo976shake", der, SubjectPublicKeyInfo, - p384_frodo976shake), - DECODER_w_structure("x448_frodo976shake", der, PrivateKeyInfo, - x448_frodo976shake), - DECODER_w_structure("x448_frodo976shake", der, SubjectPublicKeyInfo, - x448_frodo976shake), -# endif -# ifdef OQS_ENABLE_KEM_frodokem_1344_aes - DECODER_w_structure("frodo1344aes", der, PrivateKeyInfo, frodo1344aes), - DECODER_w_structure("frodo1344aes", der, SubjectPublicKeyInfo, - frodo1344aes), - DECODER_w_structure("p521_frodo1344aes", der, PrivateKeyInfo, - p521_frodo1344aes), - DECODER_w_structure("p521_frodo1344aes", der, SubjectPublicKeyInfo, - p521_frodo1344aes), -# endif -# ifdef OQS_ENABLE_KEM_frodokem_1344_shake - DECODER_w_structure("frodo1344shake", der, PrivateKeyInfo, frodo1344shake), - DECODER_w_structure("frodo1344shake", der, SubjectPublicKeyInfo, - frodo1344shake), - DECODER_w_structure("p521_frodo1344shake", der, PrivateKeyInfo, - p521_frodo1344shake), - DECODER_w_structure("p521_frodo1344shake", der, SubjectPublicKeyInfo, - p521_frodo1344shake), -# endif -# ifdef OQS_ENABLE_KEM_kyber_512 - DECODER_w_structure("kyber512", der, PrivateKeyInfo, kyber512), - DECODER_w_structure("kyber512", der, SubjectPublicKeyInfo, kyber512), - DECODER_w_structure("p256_kyber512", der, PrivateKeyInfo, p256_kyber512), - DECODER_w_structure("p256_kyber512", der, SubjectPublicKeyInfo, - p256_kyber512), - DECODER_w_structure("x25519_kyber512", der, PrivateKeyInfo, - x25519_kyber512), - DECODER_w_structure("x25519_kyber512", der, SubjectPublicKeyInfo, - x25519_kyber512), -# endif -# ifdef OQS_ENABLE_KEM_kyber_768 - DECODER_w_structure("kyber768", der, PrivateKeyInfo, kyber768), - DECODER_w_structure("kyber768", der, SubjectPublicKeyInfo, kyber768), - DECODER_w_structure("p384_kyber768", der, PrivateKeyInfo, p384_kyber768), - DECODER_w_structure("p384_kyber768", der, SubjectPublicKeyInfo, - p384_kyber768), - DECODER_w_structure("x448_kyber768", der, PrivateKeyInfo, x448_kyber768), - DECODER_w_structure("x448_kyber768", der, SubjectPublicKeyInfo, - x448_kyber768), - DECODER_w_structure("x25519_kyber768", der, PrivateKeyInfo, - x25519_kyber768), - DECODER_w_structure("x25519_kyber768", der, SubjectPublicKeyInfo, - x25519_kyber768), - DECODER_w_structure("p256_kyber768", der, PrivateKeyInfo, p256_kyber768), - DECODER_w_structure("p256_kyber768", der, SubjectPublicKeyInfo, - p256_kyber768), -# endif -# ifdef OQS_ENABLE_KEM_kyber_1024 - DECODER_w_structure("kyber1024", der, PrivateKeyInfo, kyber1024), - DECODER_w_structure("kyber1024", der, SubjectPublicKeyInfo, kyber1024), - DECODER_w_structure("p521_kyber1024", der, PrivateKeyInfo, p521_kyber1024), - DECODER_w_structure("p521_kyber1024", der, SubjectPublicKeyInfo, - p521_kyber1024), -# endif -# ifdef OQS_ENABLE_KEM_ml_kem_512 - DECODER_w_structure("mlkem512", der, PrivateKeyInfo, mlkem512), - DECODER_w_structure("mlkem512", der, SubjectPublicKeyInfo, mlkem512), - DECODER_w_structure("p256_mlkem512", der, PrivateKeyInfo, p256_mlkem512), - DECODER_w_structure("p256_mlkem512", der, SubjectPublicKeyInfo, - p256_mlkem512), - DECODER_w_structure("x25519_mlkem512", der, PrivateKeyInfo, - x25519_mlkem512), - DECODER_w_structure("x25519_mlkem512", der, SubjectPublicKeyInfo, - x25519_mlkem512), -# endif -# ifdef OQS_ENABLE_KEM_ml_kem_768 - DECODER_w_structure("mlkem768", der, PrivateKeyInfo, mlkem768), - DECODER_w_structure("mlkem768", der, SubjectPublicKeyInfo, mlkem768), - DECODER_w_structure("p384_mlkem768", der, PrivateKeyInfo, p384_mlkem768), - DECODER_w_structure("p384_mlkem768", der, SubjectPublicKeyInfo, - p384_mlkem768), - DECODER_w_structure("x448_mlkem768", der, PrivateKeyInfo, x448_mlkem768), - DECODER_w_structure("x448_mlkem768", der, SubjectPublicKeyInfo, - x448_mlkem768), - DECODER_w_structure("x25519_mlkem768", der, PrivateKeyInfo, - x25519_mlkem768), - DECODER_w_structure("x25519_mlkem768", der, SubjectPublicKeyInfo, - x25519_mlkem768), - DECODER_w_structure("p256_mlkem768", der, PrivateKeyInfo, p256_mlkem768), - DECODER_w_structure("p256_mlkem768", der, SubjectPublicKeyInfo, - p256_mlkem768), -# endif -# ifdef OQS_ENABLE_KEM_ml_kem_1024 - DECODER_w_structure("mlkem1024", der, PrivateKeyInfo, mlkem1024), - DECODER_w_structure("mlkem1024", der, SubjectPublicKeyInfo, mlkem1024), - DECODER_w_structure("p521_mlkem1024", der, PrivateKeyInfo, p521_mlkem1024), - DECODER_w_structure("p521_mlkem1024", der, SubjectPublicKeyInfo, - p521_mlkem1024), - DECODER_w_structure("p384_mlkem1024", der, PrivateKeyInfo, p384_mlkem1024), - DECODER_w_structure("p384_mlkem1024", der, SubjectPublicKeyInfo, - p384_mlkem1024), -# endif -# ifdef OQS_ENABLE_KEM_bike_l1 - DECODER_w_structure("bikel1", der, PrivateKeyInfo, bikel1), - DECODER_w_structure("bikel1", der, SubjectPublicKeyInfo, bikel1), - DECODER_w_structure("p256_bikel1", der, PrivateKeyInfo, p256_bikel1), - DECODER_w_structure("p256_bikel1", der, SubjectPublicKeyInfo, p256_bikel1), - DECODER_w_structure("x25519_bikel1", der, PrivateKeyInfo, x25519_bikel1), - DECODER_w_structure("x25519_bikel1", der, SubjectPublicKeyInfo, - x25519_bikel1), -# endif -# ifdef OQS_ENABLE_KEM_bike_l3 - DECODER_w_structure("bikel3", der, PrivateKeyInfo, bikel3), - DECODER_w_structure("bikel3", der, SubjectPublicKeyInfo, bikel3), - DECODER_w_structure("p384_bikel3", der, PrivateKeyInfo, p384_bikel3), - DECODER_w_structure("p384_bikel3", der, SubjectPublicKeyInfo, p384_bikel3), - DECODER_w_structure("x448_bikel3", der, PrivateKeyInfo, x448_bikel3), - DECODER_w_structure("x448_bikel3", der, SubjectPublicKeyInfo, x448_bikel3), -# endif -# ifdef OQS_ENABLE_KEM_bike_l5 - DECODER_w_structure("bikel5", der, PrivateKeyInfo, bikel5), - DECODER_w_structure("bikel5", der, SubjectPublicKeyInfo, bikel5), - DECODER_w_structure("p521_bikel5", der, PrivateKeyInfo, p521_bikel5), - DECODER_w_structure("p521_bikel5", der, SubjectPublicKeyInfo, p521_bikel5), -# endif -# ifdef OQS_ENABLE_KEM_hqc_128 - DECODER_w_structure("hqc128", der, PrivateKeyInfo, hqc128), - DECODER_w_structure("hqc128", der, SubjectPublicKeyInfo, hqc128), - DECODER_w_structure("p256_hqc128", der, PrivateKeyInfo, p256_hqc128), - DECODER_w_structure("p256_hqc128", der, SubjectPublicKeyInfo, p256_hqc128), - DECODER_w_structure("x25519_hqc128", der, PrivateKeyInfo, x25519_hqc128), - DECODER_w_structure("x25519_hqc128", der, SubjectPublicKeyInfo, - x25519_hqc128), -# endif -# ifdef OQS_ENABLE_KEM_hqc_192 - DECODER_w_structure("hqc192", der, PrivateKeyInfo, hqc192), - DECODER_w_structure("hqc192", der, SubjectPublicKeyInfo, hqc192), - DECODER_w_structure("p384_hqc192", der, PrivateKeyInfo, p384_hqc192), - DECODER_w_structure("p384_hqc192", der, SubjectPublicKeyInfo, p384_hqc192), - DECODER_w_structure("x448_hqc192", der, PrivateKeyInfo, x448_hqc192), - DECODER_w_structure("x448_hqc192", der, SubjectPublicKeyInfo, x448_hqc192), -# endif -# ifdef OQS_ENABLE_KEM_hqc_256 - DECODER_w_structure("hqc256", der, PrivateKeyInfo, hqc256), - DECODER_w_structure("hqc256", der, SubjectPublicKeyInfo, hqc256), - DECODER_w_structure("p521_hqc256", der, PrivateKeyInfo, p521_hqc256), - DECODER_w_structure("p521_hqc256", der, SubjectPublicKeyInfo, p521_hqc256), -# endif - -#endif /* OQS_KEM_ENCODERS */ - #ifdef OQS_ENABLE_SIG_dilithium_2 - DECODER_w_structure("dilithium2", der, PrivateKeyInfo, dilithium2), DECODER_w_structure("dilithium2", der, PrivateKeyInfo, dilithium2), DECODER_w_structure("dilithium2", der, SubjectPublicKeyInfo, dilithium2), DECODER_w_structure("p256_dilithium2", der, PrivateKeyInfo, @@ -542,20 +349,6 @@ DECODER_w_structure("frodo640aes", der, PrivateKeyInfo, frodo640aes), DECODER_w_structure("rsa3072_falconpadded512", der, SubjectPublicKeyInfo, rsa3072_falconpadded512), #endif -#ifdef OQS_ENABLE_SIG_falcon_padded_512 - DECODER_w_structure("falconpadded512", der, PrivateKeyInfo, - falconpadded512), - DECODER_w_structure("falconpadded512", der, SubjectPublicKeyInfo, - falconpadded512), - DECODER_w_structure("p256_falconpadded512", der, PrivateKeyInfo, - p256_falconpadded512), - DECODER_w_structure("p256_falconpadded512", der, SubjectPublicKeyInfo, - p256_falconpadded512), - DECODER_w_structure("rsa3072_falconpadded512", der, PrivateKeyInfo, - rsa3072_falconpadded512), - DECODER_w_structure("rsa3072_falconpadded512", der, SubjectPublicKeyInfo, - rsa3072_falconpadded512), -#endif #ifdef OQS_ENABLE_SIG_falcon_1024 DECODER_w_structure("falcon1024", der, PrivateKeyInfo, falcon1024), DECODER_w_structure("falcon1024", der, SubjectPublicKeyInfo, falcon1024), @@ -574,16 +367,6 @@ DECODER_w_structure("frodo640aes", der, PrivateKeyInfo, frodo640aes), DECODER_w_structure("p521_falconpadded1024", der, SubjectPublicKeyInfo, p521_falconpadded1024), #endif -#ifdef OQS_ENABLE_SIG_falcon_padded_1024 - DECODER_w_structure("falconpadded1024", der, PrivateKeyInfo, - falconpadded1024), - DECODER_w_structure("falconpadded1024", der, SubjectPublicKeyInfo, - falconpadded1024), - DECODER_w_structure("p521_falconpadded1024", der, PrivateKeyInfo, - p521_falconpadded1024), - DECODER_w_structure("p521_falconpadded1024", der, SubjectPublicKeyInfo, - p521_falconpadded1024), -#endif #ifdef OQS_ENABLE_SIG_sphincs_sha2_128f_simple DECODER_w_structure("sphincssha2128fsimple", der, PrivateKeyInfo, sphincssha2128fsimple), diff --git a/oqsprov/oqsencoders.inc b/oqsprov/oqsencoders.inc index d9a5e0a0..34537f51 100644 --- a/oqsprov/oqsencoders.inc +++ b/oqsprov/oqsencoders.inc @@ -663,592 +663,7 @@ ENCODER_w_structure("frodo640aes", frodo640aes, der, PrivateKeyInfo), #endif /* OQS_KEM_ENCODERS */ -#ifdef OQS_KEM_ENCODERS - -# ifdef OQS_ENABLE_KEM_frodokem_640_aes -ENCODER_w_structure("frodo640aes", frodo640aes, der, PrivateKeyInfo), - ENCODER_w_structure("frodo640aes", frodo640aes, pem, PrivateKeyInfo), - ENCODER_w_structure("frodo640aes", frodo640aes, der, - EncryptedPrivateKeyInfo), - ENCODER_w_structure("frodo640aes", frodo640aes, pem, - EncryptedPrivateKeyInfo), - ENCODER_w_structure("frodo640aes", frodo640aes, der, SubjectPublicKeyInfo), - ENCODER_w_structure("frodo640aes", frodo640aes, pem, SubjectPublicKeyInfo), - ENCODER_TEXT("frodo640aes", frodo640aes), - ENCODER_w_structure("p256_frodo640aes", p256_frodo640aes, der, - PrivateKeyInfo), - ENCODER_w_structure("p256_frodo640aes", p256_frodo640aes, pem, - PrivateKeyInfo), - ENCODER_w_structure("p256_frodo640aes", p256_frodo640aes, der, - EncryptedPrivateKeyInfo), - ENCODER_w_structure("p256_frodo640aes", p256_frodo640aes, pem, - EncryptedPrivateKeyInfo), - ENCODER_w_structure("p256_frodo640aes", p256_frodo640aes, der, - SubjectPublicKeyInfo), - ENCODER_w_structure("p256_frodo640aes", p256_frodo640aes, pem, - SubjectPublicKeyInfo), - ENCODER_TEXT("p256_frodo640aes", p256_frodo640aes), - ENCODER_w_structure("x25519_frodo640aes", x25519_frodo640aes, der, - PrivateKeyInfo), - ENCODER_w_structure("x25519_frodo640aes", x25519_frodo640aes, pem, - PrivateKeyInfo), - ENCODER_w_structure("x25519_frodo640aes", x25519_frodo640aes, der, - EncryptedPrivateKeyInfo), - ENCODER_w_structure("x25519_frodo640aes", x25519_frodo640aes, pem, - EncryptedPrivateKeyInfo), - ENCODER_w_structure("x25519_frodo640aes", x25519_frodo640aes, der, - SubjectPublicKeyInfo), - ENCODER_w_structure("x25519_frodo640aes", x25519_frodo640aes, pem, - SubjectPublicKeyInfo), - ENCODER_TEXT("x25519_frodo640aes", x25519_frodo640aes), -# endif -# ifdef OQS_ENABLE_KEM_frodokem_640_shake - ENCODER_w_structure("frodo640shake", frodo640shake, der, PrivateKeyInfo), - ENCODER_w_structure("frodo640shake", frodo640shake, pem, PrivateKeyInfo), - ENCODER_w_structure("frodo640shake", frodo640shake, der, - EncryptedPrivateKeyInfo), - ENCODER_w_structure("frodo640shake", frodo640shake, pem, - EncryptedPrivateKeyInfo), - ENCODER_w_structure("frodo640shake", frodo640shake, der, - SubjectPublicKeyInfo), - ENCODER_w_structure("frodo640shake", frodo640shake, pem, - SubjectPublicKeyInfo), - ENCODER_TEXT("frodo640shake", frodo640shake), - ENCODER_w_structure("p256_frodo640shake", p256_frodo640shake, der, - PrivateKeyInfo), - ENCODER_w_structure("p256_frodo640shake", p256_frodo640shake, pem, - PrivateKeyInfo), - ENCODER_w_structure("p256_frodo640shake", p256_frodo640shake, der, - EncryptedPrivateKeyInfo), - ENCODER_w_structure("p256_frodo640shake", p256_frodo640shake, pem, - EncryptedPrivateKeyInfo), - ENCODER_w_structure("p256_frodo640shake", p256_frodo640shake, der, - SubjectPublicKeyInfo), - ENCODER_w_structure("p256_frodo640shake", p256_frodo640shake, pem, - SubjectPublicKeyInfo), - ENCODER_TEXT("p256_frodo640shake", p256_frodo640shake), - ENCODER_w_structure("x25519_frodo640shake", x25519_frodo640shake, der, - PrivateKeyInfo), - ENCODER_w_structure("x25519_frodo640shake", x25519_frodo640shake, pem, - PrivateKeyInfo), - ENCODER_w_structure("x25519_frodo640shake", x25519_frodo640shake, der, - EncryptedPrivateKeyInfo), - ENCODER_w_structure("x25519_frodo640shake", x25519_frodo640shake, pem, - EncryptedPrivateKeyInfo), - ENCODER_w_structure("x25519_frodo640shake", x25519_frodo640shake, der, - SubjectPublicKeyInfo), - ENCODER_w_structure("x25519_frodo640shake", x25519_frodo640shake, pem, - SubjectPublicKeyInfo), - ENCODER_TEXT("x25519_frodo640shake", x25519_frodo640shake), -# endif -# ifdef OQS_ENABLE_KEM_frodokem_976_aes - ENCODER_w_structure("frodo976aes", frodo976aes, der, PrivateKeyInfo), - ENCODER_w_structure("frodo976aes", frodo976aes, pem, PrivateKeyInfo), - ENCODER_w_structure("frodo976aes", frodo976aes, der, - EncryptedPrivateKeyInfo), - ENCODER_w_structure("frodo976aes", frodo976aes, pem, - EncryptedPrivateKeyInfo), - ENCODER_w_structure("frodo976aes", frodo976aes, der, SubjectPublicKeyInfo), - ENCODER_w_structure("frodo976aes", frodo976aes, pem, SubjectPublicKeyInfo), - ENCODER_TEXT("frodo976aes", frodo976aes), - ENCODER_w_structure("p384_frodo976aes", p384_frodo976aes, der, - PrivateKeyInfo), - ENCODER_w_structure("p384_frodo976aes", p384_frodo976aes, pem, - PrivateKeyInfo), - ENCODER_w_structure("p384_frodo976aes", p384_frodo976aes, der, - EncryptedPrivateKeyInfo), - ENCODER_w_structure("p384_frodo976aes", p384_frodo976aes, pem, - EncryptedPrivateKeyInfo), - ENCODER_w_structure("p384_frodo976aes", p384_frodo976aes, der, - SubjectPublicKeyInfo), - ENCODER_w_structure("p384_frodo976aes", p384_frodo976aes, pem, - SubjectPublicKeyInfo), - ENCODER_TEXT("p384_frodo976aes", p384_frodo976aes), - ENCODER_w_structure("x448_frodo976aes", x448_frodo976aes, der, - PrivateKeyInfo), - ENCODER_w_structure("x448_frodo976aes", x448_frodo976aes, pem, - PrivateKeyInfo), - ENCODER_w_structure("x448_frodo976aes", x448_frodo976aes, der, - EncryptedPrivateKeyInfo), - ENCODER_w_structure("x448_frodo976aes", x448_frodo976aes, pem, - EncryptedPrivateKeyInfo), - ENCODER_w_structure("x448_frodo976aes", x448_frodo976aes, der, - SubjectPublicKeyInfo), - ENCODER_w_structure("x448_frodo976aes", x448_frodo976aes, pem, - SubjectPublicKeyInfo), - ENCODER_TEXT("x448_frodo976aes", x448_frodo976aes), -# endif -# ifdef OQS_ENABLE_KEM_frodokem_976_shake - ENCODER_w_structure("frodo976shake", frodo976shake, der, PrivateKeyInfo), - ENCODER_w_structure("frodo976shake", frodo976shake, pem, PrivateKeyInfo), - ENCODER_w_structure("frodo976shake", frodo976shake, der, - EncryptedPrivateKeyInfo), - ENCODER_w_structure("frodo976shake", frodo976shake, pem, - EncryptedPrivateKeyInfo), - ENCODER_w_structure("frodo976shake", frodo976shake, der, - SubjectPublicKeyInfo), - ENCODER_w_structure("frodo976shake", frodo976shake, pem, - SubjectPublicKeyInfo), - ENCODER_TEXT("frodo976shake", frodo976shake), - ENCODER_w_structure("p384_frodo976shake", p384_frodo976shake, der, - PrivateKeyInfo), - ENCODER_w_structure("p384_frodo976shake", p384_frodo976shake, pem, - PrivateKeyInfo), - ENCODER_w_structure("p384_frodo976shake", p384_frodo976shake, der, - EncryptedPrivateKeyInfo), - ENCODER_w_structure("p384_frodo976shake", p384_frodo976shake, pem, - EncryptedPrivateKeyInfo), - ENCODER_w_structure("p384_frodo976shake", p384_frodo976shake, der, - SubjectPublicKeyInfo), - ENCODER_w_structure("p384_frodo976shake", p384_frodo976shake, pem, - SubjectPublicKeyInfo), - ENCODER_TEXT("p384_frodo976shake", p384_frodo976shake), - ENCODER_w_structure("x448_frodo976shake", x448_frodo976shake, der, - PrivateKeyInfo), - ENCODER_w_structure("x448_frodo976shake", x448_frodo976shake, pem, - PrivateKeyInfo), - ENCODER_w_structure("x448_frodo976shake", x448_frodo976shake, der, - EncryptedPrivateKeyInfo), - ENCODER_w_structure("x448_frodo976shake", x448_frodo976shake, pem, - EncryptedPrivateKeyInfo), - ENCODER_w_structure("x448_frodo976shake", x448_frodo976shake, der, - SubjectPublicKeyInfo), - ENCODER_w_structure("x448_frodo976shake", x448_frodo976shake, pem, - SubjectPublicKeyInfo), - ENCODER_TEXT("x448_frodo976shake", x448_frodo976shake), -# endif -# ifdef OQS_ENABLE_KEM_frodokem_1344_aes - ENCODER_w_structure("frodo1344aes", frodo1344aes, der, PrivateKeyInfo), - ENCODER_w_structure("frodo1344aes", frodo1344aes, pem, PrivateKeyInfo), - ENCODER_w_structure("frodo1344aes", frodo1344aes, der, - EncryptedPrivateKeyInfo), - ENCODER_w_structure("frodo1344aes", frodo1344aes, pem, - EncryptedPrivateKeyInfo), - ENCODER_w_structure("frodo1344aes", frodo1344aes, der, - SubjectPublicKeyInfo), - ENCODER_w_structure("frodo1344aes", frodo1344aes, pem, - SubjectPublicKeyInfo), - ENCODER_TEXT("frodo1344aes", frodo1344aes), - ENCODER_w_structure("p521_frodo1344aes", p521_frodo1344aes, der, - PrivateKeyInfo), - ENCODER_w_structure("p521_frodo1344aes", p521_frodo1344aes, pem, - PrivateKeyInfo), - ENCODER_w_structure("p521_frodo1344aes", p521_frodo1344aes, der, - EncryptedPrivateKeyInfo), - ENCODER_w_structure("p521_frodo1344aes", p521_frodo1344aes, pem, - EncryptedPrivateKeyInfo), - ENCODER_w_structure("p521_frodo1344aes", p521_frodo1344aes, der, - SubjectPublicKeyInfo), - ENCODER_w_structure("p521_frodo1344aes", p521_frodo1344aes, pem, - SubjectPublicKeyInfo), - ENCODER_TEXT("p521_frodo1344aes", p521_frodo1344aes), -# endif -# ifdef OQS_ENABLE_KEM_frodokem_1344_shake - ENCODER_w_structure("frodo1344shake", frodo1344shake, der, PrivateKeyInfo), - ENCODER_w_structure("frodo1344shake", frodo1344shake, pem, PrivateKeyInfo), - ENCODER_w_structure("frodo1344shake", frodo1344shake, der, - EncryptedPrivateKeyInfo), - ENCODER_w_structure("frodo1344shake", frodo1344shake, pem, - EncryptedPrivateKeyInfo), - ENCODER_w_structure("frodo1344shake", frodo1344shake, der, - SubjectPublicKeyInfo), - ENCODER_w_structure("frodo1344shake", frodo1344shake, pem, - SubjectPublicKeyInfo), - ENCODER_TEXT("frodo1344shake", frodo1344shake), - ENCODER_w_structure("p521_frodo1344shake", p521_frodo1344shake, der, - PrivateKeyInfo), - ENCODER_w_structure("p521_frodo1344shake", p521_frodo1344shake, pem, - PrivateKeyInfo), - ENCODER_w_structure("p521_frodo1344shake", p521_frodo1344shake, der, - EncryptedPrivateKeyInfo), - ENCODER_w_structure("p521_frodo1344shake", p521_frodo1344shake, pem, - EncryptedPrivateKeyInfo), - ENCODER_w_structure("p521_frodo1344shake", p521_frodo1344shake, der, - SubjectPublicKeyInfo), - ENCODER_w_structure("p521_frodo1344shake", p521_frodo1344shake, pem, - SubjectPublicKeyInfo), - ENCODER_TEXT("p521_frodo1344shake", p521_frodo1344shake), -# endif -# ifdef OQS_ENABLE_KEM_kyber_512 - ENCODER_w_structure("kyber512", kyber512, der, PrivateKeyInfo), - ENCODER_w_structure("kyber512", kyber512, pem, PrivateKeyInfo), - ENCODER_w_structure("kyber512", kyber512, der, EncryptedPrivateKeyInfo), - ENCODER_w_structure("kyber512", kyber512, pem, EncryptedPrivateKeyInfo), - ENCODER_w_structure("kyber512", kyber512, der, SubjectPublicKeyInfo), - ENCODER_w_structure("kyber512", kyber512, pem, SubjectPublicKeyInfo), - ENCODER_TEXT("kyber512", kyber512), - ENCODER_w_structure("p256_kyber512", p256_kyber512, der, PrivateKeyInfo), - ENCODER_w_structure("p256_kyber512", p256_kyber512, pem, PrivateKeyInfo), - ENCODER_w_structure("p256_kyber512", p256_kyber512, der, - EncryptedPrivateKeyInfo), - ENCODER_w_structure("p256_kyber512", p256_kyber512, pem, - EncryptedPrivateKeyInfo), - ENCODER_w_structure("p256_kyber512", p256_kyber512, der, - SubjectPublicKeyInfo), - ENCODER_w_structure("p256_kyber512", p256_kyber512, pem, - SubjectPublicKeyInfo), - ENCODER_TEXT("p256_kyber512", p256_kyber512), - ENCODER_w_structure("x25519_kyber512", x25519_kyber512, der, - PrivateKeyInfo), - ENCODER_w_structure("x25519_kyber512", x25519_kyber512, pem, - PrivateKeyInfo), - ENCODER_w_structure("x25519_kyber512", x25519_kyber512, der, - EncryptedPrivateKeyInfo), - ENCODER_w_structure("x25519_kyber512", x25519_kyber512, pem, - EncryptedPrivateKeyInfo), - ENCODER_w_structure("x25519_kyber512", x25519_kyber512, der, - SubjectPublicKeyInfo), - ENCODER_w_structure("x25519_kyber512", x25519_kyber512, pem, - SubjectPublicKeyInfo), - ENCODER_TEXT("x25519_kyber512", x25519_kyber512), -# endif -# ifdef OQS_ENABLE_KEM_kyber_768 - ENCODER_w_structure("kyber768", kyber768, der, PrivateKeyInfo), - ENCODER_w_structure("kyber768", kyber768, pem, PrivateKeyInfo), - ENCODER_w_structure("kyber768", kyber768, der, EncryptedPrivateKeyInfo), - ENCODER_w_structure("kyber768", kyber768, pem, EncryptedPrivateKeyInfo), - ENCODER_w_structure("kyber768", kyber768, der, SubjectPublicKeyInfo), - ENCODER_w_structure("kyber768", kyber768, pem, SubjectPublicKeyInfo), - ENCODER_TEXT("kyber768", kyber768), - ENCODER_w_structure("p384_kyber768", p384_kyber768, der, PrivateKeyInfo), - ENCODER_w_structure("p384_kyber768", p384_kyber768, pem, PrivateKeyInfo), - ENCODER_w_structure("p384_kyber768", p384_kyber768, der, - EncryptedPrivateKeyInfo), - ENCODER_w_structure("p384_kyber768", p384_kyber768, pem, - EncryptedPrivateKeyInfo), - ENCODER_w_structure("p384_kyber768", p384_kyber768, der, - SubjectPublicKeyInfo), - ENCODER_w_structure("p384_kyber768", p384_kyber768, pem, - SubjectPublicKeyInfo), - ENCODER_TEXT("p384_kyber768", p384_kyber768), - ENCODER_w_structure("x448_kyber768", x448_kyber768, der, PrivateKeyInfo), - ENCODER_w_structure("x448_kyber768", x448_kyber768, pem, PrivateKeyInfo), - ENCODER_w_structure("x448_kyber768", x448_kyber768, der, - EncryptedPrivateKeyInfo), - ENCODER_w_structure("x448_kyber768", x448_kyber768, pem, - EncryptedPrivateKeyInfo), - ENCODER_w_structure("x448_kyber768", x448_kyber768, der, - SubjectPublicKeyInfo), - ENCODER_w_structure("x448_kyber768", x448_kyber768, pem, - SubjectPublicKeyInfo), - ENCODER_TEXT("x448_kyber768", x448_kyber768), - ENCODER_w_structure("x25519_kyber768", x25519_kyber768, der, - PrivateKeyInfo), - ENCODER_w_structure("x25519_kyber768", x25519_kyber768, pem, - PrivateKeyInfo), - ENCODER_w_structure("x25519_kyber768", x25519_kyber768, der, - EncryptedPrivateKeyInfo), - ENCODER_w_structure("x25519_kyber768", x25519_kyber768, pem, - EncryptedPrivateKeyInfo), - ENCODER_w_structure("x25519_kyber768", x25519_kyber768, der, - SubjectPublicKeyInfo), - ENCODER_w_structure("x25519_kyber768", x25519_kyber768, pem, - SubjectPublicKeyInfo), - ENCODER_TEXT("x25519_kyber768", x25519_kyber768), - ENCODER_w_structure("p256_kyber768", p256_kyber768, der, PrivateKeyInfo), - ENCODER_w_structure("p256_kyber768", p256_kyber768, pem, PrivateKeyInfo), - ENCODER_w_structure("p256_kyber768", p256_kyber768, der, - EncryptedPrivateKeyInfo), - ENCODER_w_structure("p256_kyber768", p256_kyber768, pem, - EncryptedPrivateKeyInfo), - ENCODER_w_structure("p256_kyber768", p256_kyber768, der, - SubjectPublicKeyInfo), - ENCODER_w_structure("p256_kyber768", p256_kyber768, pem, - SubjectPublicKeyInfo), - ENCODER_TEXT("p256_kyber768", p256_kyber768), -# endif -# ifdef OQS_ENABLE_KEM_kyber_1024 - ENCODER_w_structure("kyber1024", kyber1024, der, PrivateKeyInfo), - ENCODER_w_structure("kyber1024", kyber1024, pem, PrivateKeyInfo), - ENCODER_w_structure("kyber1024", kyber1024, der, EncryptedPrivateKeyInfo), - ENCODER_w_structure("kyber1024", kyber1024, pem, EncryptedPrivateKeyInfo), - ENCODER_w_structure("kyber1024", kyber1024, der, SubjectPublicKeyInfo), - ENCODER_w_structure("kyber1024", kyber1024, pem, SubjectPublicKeyInfo), - ENCODER_TEXT("kyber1024", kyber1024), - ENCODER_w_structure("p521_kyber1024", p521_kyber1024, der, PrivateKeyInfo), - ENCODER_w_structure("p521_kyber1024", p521_kyber1024, pem, PrivateKeyInfo), - ENCODER_w_structure("p521_kyber1024", p521_kyber1024, der, - EncryptedPrivateKeyInfo), - ENCODER_w_structure("p521_kyber1024", p521_kyber1024, pem, - EncryptedPrivateKeyInfo), - ENCODER_w_structure("p521_kyber1024", p521_kyber1024, der, - SubjectPublicKeyInfo), - ENCODER_w_structure("p521_kyber1024", p521_kyber1024, pem, - SubjectPublicKeyInfo), - ENCODER_TEXT("p521_kyber1024", p521_kyber1024), -# endif -# ifdef OQS_ENABLE_KEM_ml_kem_512 - ENCODER_w_structure("mlkem512", mlkem512, der, PrivateKeyInfo), - ENCODER_w_structure("mlkem512", mlkem512, pem, PrivateKeyInfo), - ENCODER_w_structure("mlkem512", mlkem512, der, EncryptedPrivateKeyInfo), - ENCODER_w_structure("mlkem512", mlkem512, pem, EncryptedPrivateKeyInfo), - ENCODER_w_structure("mlkem512", mlkem512, der, SubjectPublicKeyInfo), - ENCODER_w_structure("mlkem512", mlkem512, pem, SubjectPublicKeyInfo), - ENCODER_TEXT("mlkem512", mlkem512), - ENCODER_w_structure("p256_mlkem512", p256_mlkem512, der, PrivateKeyInfo), - ENCODER_w_structure("p256_mlkem512", p256_mlkem512, pem, PrivateKeyInfo), - ENCODER_w_structure("p256_mlkem512", p256_mlkem512, der, - EncryptedPrivateKeyInfo), - ENCODER_w_structure("p256_mlkem512", p256_mlkem512, pem, - EncryptedPrivateKeyInfo), - ENCODER_w_structure("p256_mlkem512", p256_mlkem512, der, - SubjectPublicKeyInfo), - ENCODER_w_structure("p256_mlkem512", p256_mlkem512, pem, - SubjectPublicKeyInfo), - ENCODER_TEXT("p256_mlkem512", p256_mlkem512), - ENCODER_w_structure("x25519_mlkem512", x25519_mlkem512, der, - PrivateKeyInfo), - ENCODER_w_structure("x25519_mlkem512", x25519_mlkem512, pem, - PrivateKeyInfo), - ENCODER_w_structure("x25519_mlkem512", x25519_mlkem512, der, - EncryptedPrivateKeyInfo), - ENCODER_w_structure("x25519_mlkem512", x25519_mlkem512, pem, - EncryptedPrivateKeyInfo), - ENCODER_w_structure("x25519_mlkem512", x25519_mlkem512, der, - SubjectPublicKeyInfo), - ENCODER_w_structure("x25519_mlkem512", x25519_mlkem512, pem, - SubjectPublicKeyInfo), - ENCODER_TEXT("x25519_mlkem512", x25519_mlkem512), -# endif -# ifdef OQS_ENABLE_KEM_ml_kem_768 - ENCODER_w_structure("mlkem768", mlkem768, der, PrivateKeyInfo), - ENCODER_w_structure("mlkem768", mlkem768, pem, PrivateKeyInfo), - ENCODER_w_structure("mlkem768", mlkem768, der, EncryptedPrivateKeyInfo), - ENCODER_w_structure("mlkem768", mlkem768, pem, EncryptedPrivateKeyInfo), - ENCODER_w_structure("mlkem768", mlkem768, der, SubjectPublicKeyInfo), - ENCODER_w_structure("mlkem768", mlkem768, pem, SubjectPublicKeyInfo), - ENCODER_TEXT("mlkem768", mlkem768), - ENCODER_w_structure("p384_mlkem768", p384_mlkem768, der, PrivateKeyInfo), - ENCODER_w_structure("p384_mlkem768", p384_mlkem768, pem, PrivateKeyInfo), - ENCODER_w_structure("p384_mlkem768", p384_mlkem768, der, - EncryptedPrivateKeyInfo), - ENCODER_w_structure("p384_mlkem768", p384_mlkem768, pem, - EncryptedPrivateKeyInfo), - ENCODER_w_structure("p384_mlkem768", p384_mlkem768, der, - SubjectPublicKeyInfo), - ENCODER_w_structure("p384_mlkem768", p384_mlkem768, pem, - SubjectPublicKeyInfo), - ENCODER_TEXT("p384_mlkem768", p384_mlkem768), - ENCODER_w_structure("x448_mlkem768", x448_mlkem768, der, PrivateKeyInfo), - ENCODER_w_structure("x448_mlkem768", x448_mlkem768, pem, PrivateKeyInfo), - ENCODER_w_structure("x448_mlkem768", x448_mlkem768, der, - EncryptedPrivateKeyInfo), - ENCODER_w_structure("x448_mlkem768", x448_mlkem768, pem, - EncryptedPrivateKeyInfo), - ENCODER_w_structure("x448_mlkem768", x448_mlkem768, der, - SubjectPublicKeyInfo), - ENCODER_w_structure("x448_mlkem768", x448_mlkem768, pem, - SubjectPublicKeyInfo), - ENCODER_TEXT("x448_mlkem768", x448_mlkem768), - ENCODER_w_structure("x25519_mlkem768", x25519_mlkem768, der, - PrivateKeyInfo), - ENCODER_w_structure("x25519_mlkem768", x25519_mlkem768, pem, - PrivateKeyInfo), - ENCODER_w_structure("x25519_mlkem768", x25519_mlkem768, der, - EncryptedPrivateKeyInfo), - ENCODER_w_structure("x25519_mlkem768", x25519_mlkem768, pem, - EncryptedPrivateKeyInfo), - ENCODER_w_structure("x25519_mlkem768", x25519_mlkem768, der, - SubjectPublicKeyInfo), - ENCODER_w_structure("x25519_mlkem768", x25519_mlkem768, pem, - SubjectPublicKeyInfo), - ENCODER_TEXT("x25519_mlkem768", x25519_mlkem768), - ENCODER_w_structure("p256_mlkem768", p256_mlkem768, der, PrivateKeyInfo), - ENCODER_w_structure("p256_mlkem768", p256_mlkem768, pem, PrivateKeyInfo), - ENCODER_w_structure("p256_mlkem768", p256_mlkem768, der, - EncryptedPrivateKeyInfo), - ENCODER_w_structure("p256_mlkem768", p256_mlkem768, pem, - EncryptedPrivateKeyInfo), - ENCODER_w_structure("p256_mlkem768", p256_mlkem768, der, - SubjectPublicKeyInfo), - ENCODER_w_structure("p256_mlkem768", p256_mlkem768, pem, - SubjectPublicKeyInfo), - ENCODER_TEXT("p256_mlkem768", p256_mlkem768), -# endif -# ifdef OQS_ENABLE_KEM_ml_kem_1024 - ENCODER_w_structure("mlkem1024", mlkem1024, der, PrivateKeyInfo), - ENCODER_w_structure("mlkem1024", mlkem1024, pem, PrivateKeyInfo), - ENCODER_w_structure("mlkem1024", mlkem1024, der, EncryptedPrivateKeyInfo), - ENCODER_w_structure("mlkem1024", mlkem1024, pem, EncryptedPrivateKeyInfo), - ENCODER_w_structure("mlkem1024", mlkem1024, der, SubjectPublicKeyInfo), - ENCODER_w_structure("mlkem1024", mlkem1024, pem, SubjectPublicKeyInfo), - ENCODER_TEXT("mlkem1024", mlkem1024), - ENCODER_w_structure("p521_mlkem1024", p521_mlkem1024, der, PrivateKeyInfo), - ENCODER_w_structure("p521_mlkem1024", p521_mlkem1024, pem, PrivateKeyInfo), - ENCODER_w_structure("p521_mlkem1024", p521_mlkem1024, der, - EncryptedPrivateKeyInfo), - ENCODER_w_structure("p521_mlkem1024", p521_mlkem1024, pem, - EncryptedPrivateKeyInfo), - ENCODER_w_structure("p521_mlkem1024", p521_mlkem1024, der, - SubjectPublicKeyInfo), - ENCODER_w_structure("p521_mlkem1024", p521_mlkem1024, pem, - SubjectPublicKeyInfo), - ENCODER_TEXT("p521_mlkem1024", p521_mlkem1024), - ENCODER_w_structure("p384_mlkem1024", p384_mlkem1024, der, PrivateKeyInfo), - ENCODER_w_structure("p384_mlkem1024", p384_mlkem1024, pem, PrivateKeyInfo), - ENCODER_w_structure("p384_mlkem1024", p384_mlkem1024, der, - EncryptedPrivateKeyInfo), - ENCODER_w_structure("p384_mlkem1024", p384_mlkem1024, pem, - EncryptedPrivateKeyInfo), - ENCODER_w_structure("p384_mlkem1024", p384_mlkem1024, der, - SubjectPublicKeyInfo), - ENCODER_w_structure("p384_mlkem1024", p384_mlkem1024, pem, - SubjectPublicKeyInfo), - ENCODER_TEXT("p384_mlkem1024", p384_mlkem1024), -# endif -# ifdef OQS_ENABLE_KEM_bike_l1 - ENCODER_w_structure("bikel1", bikel1, der, PrivateKeyInfo), - ENCODER_w_structure("bikel1", bikel1, pem, PrivateKeyInfo), - ENCODER_w_structure("bikel1", bikel1, der, EncryptedPrivateKeyInfo), - ENCODER_w_structure("bikel1", bikel1, pem, EncryptedPrivateKeyInfo), - ENCODER_w_structure("bikel1", bikel1, der, SubjectPublicKeyInfo), - ENCODER_w_structure("bikel1", bikel1, pem, SubjectPublicKeyInfo), - ENCODER_TEXT("bikel1", bikel1), - ENCODER_w_structure("p256_bikel1", p256_bikel1, der, PrivateKeyInfo), - ENCODER_w_structure("p256_bikel1", p256_bikel1, pem, PrivateKeyInfo), - ENCODER_w_structure("p256_bikel1", p256_bikel1, der, - EncryptedPrivateKeyInfo), - ENCODER_w_structure("p256_bikel1", p256_bikel1, pem, - EncryptedPrivateKeyInfo), - ENCODER_w_structure("p256_bikel1", p256_bikel1, der, SubjectPublicKeyInfo), - ENCODER_w_structure("p256_bikel1", p256_bikel1, pem, SubjectPublicKeyInfo), - ENCODER_TEXT("p256_bikel1", p256_bikel1), - ENCODER_w_structure("x25519_bikel1", x25519_bikel1, der, PrivateKeyInfo), - ENCODER_w_structure("x25519_bikel1", x25519_bikel1, pem, PrivateKeyInfo), - ENCODER_w_structure("x25519_bikel1", x25519_bikel1, der, - EncryptedPrivateKeyInfo), - ENCODER_w_structure("x25519_bikel1", x25519_bikel1, pem, - EncryptedPrivateKeyInfo), - ENCODER_w_structure("x25519_bikel1", x25519_bikel1, der, - SubjectPublicKeyInfo), - ENCODER_w_structure("x25519_bikel1", x25519_bikel1, pem, - SubjectPublicKeyInfo), - ENCODER_TEXT("x25519_bikel1", x25519_bikel1), -# endif -# ifdef OQS_ENABLE_KEM_bike_l3 - ENCODER_w_structure("bikel3", bikel3, der, PrivateKeyInfo), - ENCODER_w_structure("bikel3", bikel3, pem, PrivateKeyInfo), - ENCODER_w_structure("bikel3", bikel3, der, EncryptedPrivateKeyInfo), - ENCODER_w_structure("bikel3", bikel3, pem, EncryptedPrivateKeyInfo), - ENCODER_w_structure("bikel3", bikel3, der, SubjectPublicKeyInfo), - ENCODER_w_structure("bikel3", bikel3, pem, SubjectPublicKeyInfo), - ENCODER_TEXT("bikel3", bikel3), - ENCODER_w_structure("p384_bikel3", p384_bikel3, der, PrivateKeyInfo), - ENCODER_w_structure("p384_bikel3", p384_bikel3, pem, PrivateKeyInfo), - ENCODER_w_structure("p384_bikel3", p384_bikel3, der, - EncryptedPrivateKeyInfo), - ENCODER_w_structure("p384_bikel3", p384_bikel3, pem, - EncryptedPrivateKeyInfo), - ENCODER_w_structure("p384_bikel3", p384_bikel3, der, SubjectPublicKeyInfo), - ENCODER_w_structure("p384_bikel3", p384_bikel3, pem, SubjectPublicKeyInfo), - ENCODER_TEXT("p384_bikel3", p384_bikel3), - ENCODER_w_structure("x448_bikel3", x448_bikel3, der, PrivateKeyInfo), - ENCODER_w_structure("x448_bikel3", x448_bikel3, pem, PrivateKeyInfo), - ENCODER_w_structure("x448_bikel3", x448_bikel3, der, - EncryptedPrivateKeyInfo), - ENCODER_w_structure("x448_bikel3", x448_bikel3, pem, - EncryptedPrivateKeyInfo), - ENCODER_w_structure("x448_bikel3", x448_bikel3, der, SubjectPublicKeyInfo), - ENCODER_w_structure("x448_bikel3", x448_bikel3, pem, SubjectPublicKeyInfo), - ENCODER_TEXT("x448_bikel3", x448_bikel3), -# endif -# ifdef OQS_ENABLE_KEM_bike_l5 - ENCODER_w_structure("bikel5", bikel5, der, PrivateKeyInfo), - ENCODER_w_structure("bikel5", bikel5, pem, PrivateKeyInfo), - ENCODER_w_structure("bikel5", bikel5, der, EncryptedPrivateKeyInfo), - ENCODER_w_structure("bikel5", bikel5, pem, EncryptedPrivateKeyInfo), - ENCODER_w_structure("bikel5", bikel5, der, SubjectPublicKeyInfo), - ENCODER_w_structure("bikel5", bikel5, pem, SubjectPublicKeyInfo), - ENCODER_TEXT("bikel5", bikel5), - ENCODER_w_structure("p521_bikel5", p521_bikel5, der, PrivateKeyInfo), - ENCODER_w_structure("p521_bikel5", p521_bikel5, pem, PrivateKeyInfo), - ENCODER_w_structure("p521_bikel5", p521_bikel5, der, - EncryptedPrivateKeyInfo), - ENCODER_w_structure("p521_bikel5", p521_bikel5, pem, - EncryptedPrivateKeyInfo), - ENCODER_w_structure("p521_bikel5", p521_bikel5, der, SubjectPublicKeyInfo), - ENCODER_w_structure("p521_bikel5", p521_bikel5, pem, SubjectPublicKeyInfo), - ENCODER_TEXT("p521_bikel5", p521_bikel5), -# endif -# ifdef OQS_ENABLE_KEM_hqc_128 - ENCODER_w_structure("hqc128", hqc128, der, PrivateKeyInfo), - ENCODER_w_structure("hqc128", hqc128, pem, PrivateKeyInfo), - ENCODER_w_structure("hqc128", hqc128, der, EncryptedPrivateKeyInfo), - ENCODER_w_structure("hqc128", hqc128, pem, EncryptedPrivateKeyInfo), - ENCODER_w_structure("hqc128", hqc128, der, SubjectPublicKeyInfo), - ENCODER_w_structure("hqc128", hqc128, pem, SubjectPublicKeyInfo), - ENCODER_TEXT("hqc128", hqc128), - ENCODER_w_structure("p256_hqc128", p256_hqc128, der, PrivateKeyInfo), - ENCODER_w_structure("p256_hqc128", p256_hqc128, pem, PrivateKeyInfo), - ENCODER_w_structure("p256_hqc128", p256_hqc128, der, - EncryptedPrivateKeyInfo), - ENCODER_w_structure("p256_hqc128", p256_hqc128, pem, - EncryptedPrivateKeyInfo), - ENCODER_w_structure("p256_hqc128", p256_hqc128, der, SubjectPublicKeyInfo), - ENCODER_w_structure("p256_hqc128", p256_hqc128, pem, SubjectPublicKeyInfo), - ENCODER_TEXT("p256_hqc128", p256_hqc128), - ENCODER_w_structure("x25519_hqc128", x25519_hqc128, der, PrivateKeyInfo), - ENCODER_w_structure("x25519_hqc128", x25519_hqc128, pem, PrivateKeyInfo), - ENCODER_w_structure("x25519_hqc128", x25519_hqc128, der, - EncryptedPrivateKeyInfo), - ENCODER_w_structure("x25519_hqc128", x25519_hqc128, pem, - EncryptedPrivateKeyInfo), - ENCODER_w_structure("x25519_hqc128", x25519_hqc128, der, - SubjectPublicKeyInfo), - ENCODER_w_structure("x25519_hqc128", x25519_hqc128, pem, - SubjectPublicKeyInfo), - ENCODER_TEXT("x25519_hqc128", x25519_hqc128), -# endif -# ifdef OQS_ENABLE_KEM_hqc_192 - ENCODER_w_structure("hqc192", hqc192, der, PrivateKeyInfo), - ENCODER_w_structure("hqc192", hqc192, pem, PrivateKeyInfo), - ENCODER_w_structure("hqc192", hqc192, der, EncryptedPrivateKeyInfo), - ENCODER_w_structure("hqc192", hqc192, pem, EncryptedPrivateKeyInfo), - ENCODER_w_structure("hqc192", hqc192, der, SubjectPublicKeyInfo), - ENCODER_w_structure("hqc192", hqc192, pem, SubjectPublicKeyInfo), - ENCODER_TEXT("hqc192", hqc192), - ENCODER_w_structure("p384_hqc192", p384_hqc192, der, PrivateKeyInfo), - ENCODER_w_structure("p384_hqc192", p384_hqc192, pem, PrivateKeyInfo), - ENCODER_w_structure("p384_hqc192", p384_hqc192, der, - EncryptedPrivateKeyInfo), - ENCODER_w_structure("p384_hqc192", p384_hqc192, pem, - EncryptedPrivateKeyInfo), - ENCODER_w_structure("p384_hqc192", p384_hqc192, der, SubjectPublicKeyInfo), - ENCODER_w_structure("p384_hqc192", p384_hqc192, pem, SubjectPublicKeyInfo), - ENCODER_TEXT("p384_hqc192", p384_hqc192), - ENCODER_w_structure("x448_hqc192", x448_hqc192, der, PrivateKeyInfo), - ENCODER_w_structure("x448_hqc192", x448_hqc192, pem, PrivateKeyInfo), - ENCODER_w_structure("x448_hqc192", x448_hqc192, der, - EncryptedPrivateKeyInfo), - ENCODER_w_structure("x448_hqc192", x448_hqc192, pem, - EncryptedPrivateKeyInfo), - ENCODER_w_structure("x448_hqc192", x448_hqc192, der, SubjectPublicKeyInfo), - ENCODER_w_structure("x448_hqc192", x448_hqc192, pem, SubjectPublicKeyInfo), - ENCODER_TEXT("x448_hqc192", x448_hqc192), -# endif -# ifdef OQS_ENABLE_KEM_hqc_256 - ENCODER_w_structure("hqc256", hqc256, der, PrivateKeyInfo), - ENCODER_w_structure("hqc256", hqc256, pem, PrivateKeyInfo), - ENCODER_w_structure("hqc256", hqc256, der, EncryptedPrivateKeyInfo), - ENCODER_w_structure("hqc256", hqc256, pem, EncryptedPrivateKeyInfo), - ENCODER_w_structure("hqc256", hqc256, der, SubjectPublicKeyInfo), - ENCODER_w_structure("hqc256", hqc256, pem, SubjectPublicKeyInfo), - ENCODER_TEXT("hqc256", hqc256), - ENCODER_w_structure("p521_hqc256", p521_hqc256, der, PrivateKeyInfo), - ENCODER_w_structure("p521_hqc256", p521_hqc256, pem, PrivateKeyInfo), - ENCODER_w_structure("p521_hqc256", p521_hqc256, der, - EncryptedPrivateKeyInfo), - ENCODER_w_structure("p521_hqc256", p521_hqc256, pem, - EncryptedPrivateKeyInfo), - ENCODER_w_structure("p521_hqc256", p521_hqc256, der, SubjectPublicKeyInfo), - ENCODER_w_structure("p521_hqc256", p521_hqc256, pem, SubjectPublicKeyInfo), - ENCODER_TEXT("p521_hqc256", p521_hqc256), -# endif - -#endif /* OQS_KEM_ENCODERS */ - #ifdef OQS_ENABLE_SIG_dilithium_2 - ENCODER_w_structure("dilithium2", dilithium2, der, PrivateKeyInfo), ENCODER_w_structure("dilithium2", dilithium2, der, PrivateKeyInfo), ENCODER_w_structure("dilithium2", dilithium2, pem, PrivateKeyInfo), ENCODER_w_structure("dilithium2", dilithium2, der, EncryptedPrivateKeyInfo), @@ -1629,47 +1044,6 @@ ENCODER_w_structure("frodo640aes", frodo640aes, der, PrivateKeyInfo), SubjectPublicKeyInfo), ENCODER_TEXT("rsa3072_falconpadded512", rsa3072_falconpadded512), #endif -#ifdef OQS_ENABLE_SIG_falcon_padded_512 - ENCODER_w_structure("falconpadded512", falconpadded512, der, - PrivateKeyInfo), - ENCODER_w_structure("falconpadded512", falconpadded512, pem, - PrivateKeyInfo), - ENCODER_w_structure("falconpadded512", falconpadded512, der, - EncryptedPrivateKeyInfo), - ENCODER_w_structure("falconpadded512", falconpadded512, pem, - EncryptedPrivateKeyInfo), - ENCODER_w_structure("falconpadded512", falconpadded512, der, - SubjectPublicKeyInfo), - ENCODER_w_structure("falconpadded512", falconpadded512, pem, - SubjectPublicKeyInfo), - ENCODER_TEXT("falconpadded512", falconpadded512), - ENCODER_w_structure("p256_falconpadded512", p256_falconpadded512, der, - PrivateKeyInfo), - ENCODER_w_structure("p256_falconpadded512", p256_falconpadded512, pem, - PrivateKeyInfo), - ENCODER_w_structure("p256_falconpadded512", p256_falconpadded512, der, - EncryptedPrivateKeyInfo), - ENCODER_w_structure("p256_falconpadded512", p256_falconpadded512, pem, - EncryptedPrivateKeyInfo), - ENCODER_w_structure("p256_falconpadded512", p256_falconpadded512, der, - SubjectPublicKeyInfo), - ENCODER_w_structure("p256_falconpadded512", p256_falconpadded512, pem, - SubjectPublicKeyInfo), - ENCODER_TEXT("p256_falconpadded512", p256_falconpadded512), - ENCODER_w_structure("rsa3072_falconpadded512", rsa3072_falconpadded512, der, - PrivateKeyInfo), - ENCODER_w_structure("rsa3072_falconpadded512", rsa3072_falconpadded512, pem, - PrivateKeyInfo), - ENCODER_w_structure("rsa3072_falconpadded512", rsa3072_falconpadded512, der, - EncryptedPrivateKeyInfo), - ENCODER_w_structure("rsa3072_falconpadded512", rsa3072_falconpadded512, pem, - EncryptedPrivateKeyInfo), - ENCODER_w_structure("rsa3072_falconpadded512", rsa3072_falconpadded512, der, - SubjectPublicKeyInfo), - ENCODER_w_structure("rsa3072_falconpadded512", rsa3072_falconpadded512, pem, - SubjectPublicKeyInfo), - ENCODER_TEXT("rsa3072_falconpadded512", rsa3072_falconpadded512), -#endif #ifdef OQS_ENABLE_SIG_falcon_1024 ENCODER_w_structure("falcon1024", falcon1024, der, PrivateKeyInfo), ENCODER_w_structure("falcon1024", falcon1024, pem, PrivateKeyInfo), @@ -1720,34 +1094,6 @@ ENCODER_w_structure("frodo640aes", frodo640aes, der, PrivateKeyInfo), SubjectPublicKeyInfo), ENCODER_TEXT("p521_falconpadded1024", p521_falconpadded1024), #endif -#ifdef OQS_ENABLE_SIG_falcon_padded_1024 - ENCODER_w_structure("falconpadded1024", falconpadded1024, der, - PrivateKeyInfo), - ENCODER_w_structure("falconpadded1024", falconpadded1024, pem, - PrivateKeyInfo), - ENCODER_w_structure("falconpadded1024", falconpadded1024, der, - EncryptedPrivateKeyInfo), - ENCODER_w_structure("falconpadded1024", falconpadded1024, pem, - EncryptedPrivateKeyInfo), - ENCODER_w_structure("falconpadded1024", falconpadded1024, der, - SubjectPublicKeyInfo), - ENCODER_w_structure("falconpadded1024", falconpadded1024, pem, - SubjectPublicKeyInfo), - ENCODER_TEXT("falconpadded1024", falconpadded1024), - ENCODER_w_structure("p521_falconpadded1024", p521_falconpadded1024, der, - PrivateKeyInfo), - ENCODER_w_structure("p521_falconpadded1024", p521_falconpadded1024, pem, - PrivateKeyInfo), - ENCODER_w_structure("p521_falconpadded1024", p521_falconpadded1024, der, - EncryptedPrivateKeyInfo), - ENCODER_w_structure("p521_falconpadded1024", p521_falconpadded1024, pem, - EncryptedPrivateKeyInfo), - ENCODER_w_structure("p521_falconpadded1024", p521_falconpadded1024, der, - SubjectPublicKeyInfo), - ENCODER_w_structure("p521_falconpadded1024", p521_falconpadded1024, pem, - SubjectPublicKeyInfo), - ENCODER_TEXT("p521_falconpadded1024", p521_falconpadded1024), -#endif #ifdef OQS_ENABLE_SIG_sphincs_sha2_128f_simple ENCODER_w_structure("sphincssha2128fsimple", sphincssha2128fsimple, der, PrivateKeyInfo), diff --git a/oqsprov/oqsprov.c b/oqsprov/oqsprov.c index 895fc3cb..ef494b93 100644 --- a/oqsprov/oqsprov.c +++ b/oqsprov/oqsprov.c @@ -165,118 +165,6 @@ const char *oqs_oid_alg_list[OQS_OID_CNT] = { "1.3.9999.99.43", "p521_hqc256", -#endif /* OQS_KEM_ENCODERS */ - - -#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", - #endif /* OQS_KEM_ENCODERS */ "1.3.6.1.4.1.2.267.7.4.4", @@ -336,10 +224,8 @@ const char *oqs_oid_alg_list[OQS_OID_CNT] = { "1.3.9999.3.11", "falcon512", "1.3.9999.3.12", - "1.3.9999.3.12", "p256_falcon512", "1.3.9999.3.13", - "1.3.9999.3.13", "rsa3072_falcon512", "1.3.9999.3.16", "falconpadded512", @@ -348,25 +234,13 @@ const char *oqs_oid_alg_list[OQS_OID_CNT] = { "1.3.9999.3.18", "rsa3072_falconpadded512", "1.3.9999.3.14", - "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", - "1.3.9999.3.15", "p521_falcon1024", "1.3.9999.3.19", "falconpadded1024", "1.3.9999.3.20", "p521_falconpadded1024", - "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", @@ -523,166 +397,25 @@ int oqs_patch_oids(void) if (getenv("OQS_OID_P521_HQC256")) oqs_oid_alg_list[104] = getenv("OQS_OID_P521_HQC256"); -# define OQS_KEMOID_CNT 104 + 2 -#else -# define OQS_KEMOID_CNT 0 -#endif /* OQS_KEM_ENCODERS */ - -#ifdef OQS_KEM_ENCODERS - - if (getenv("OQS_OID_FRODO640AES")) - oqs_oid_alg_list[0] = getenv("OQS_OID_FRODO640AES"); - - if (getenv("OQS_OID_P256_FRODO640AES")) - oqs_oid_alg_list[2] = getenv("OQS_OID_P256_FRODO640AES"); - if (getenv("OQS_OID_X25519_FRODO640AES")) - oqs_oid_alg_list[4] = getenv("OQS_OID_X25519_FRODO640AES"); - if (getenv("OQS_OID_FRODO640SHAKE")) - oqs_oid_alg_list[6] = getenv("OQS_OID_FRODO640SHAKE"); - - if (getenv("OQS_OID_P256_FRODO640SHAKE")) - oqs_oid_alg_list[8] = getenv("OQS_OID_P256_FRODO640SHAKE"); - if (getenv("OQS_OID_X25519_FRODO640SHAKE")) - oqs_oid_alg_list[10] = getenv("OQS_OID_X25519_FRODO640SHAKE"); - if (getenv("OQS_OID_FRODO976AES")) - oqs_oid_alg_list[12] = getenv("OQS_OID_FRODO976AES"); - - if (getenv("OQS_OID_P384_FRODO976AES")) - oqs_oid_alg_list[14] = getenv("OQS_OID_P384_FRODO976AES"); - if (getenv("OQS_OID_X448_FRODO976AES")) - oqs_oid_alg_list[16] = getenv("OQS_OID_X448_FRODO976AES"); - if (getenv("OQS_OID_FRODO976SHAKE")) - oqs_oid_alg_list[18] = getenv("OQS_OID_FRODO976SHAKE"); - - if (getenv("OQS_OID_P384_FRODO976SHAKE")) - oqs_oid_alg_list[20] = getenv("OQS_OID_P384_FRODO976SHAKE"); - if (getenv("OQS_OID_X448_FRODO976SHAKE")) - oqs_oid_alg_list[22] = getenv("OQS_OID_X448_FRODO976SHAKE"); - if (getenv("OQS_OID_FRODO1344AES")) - oqs_oid_alg_list[24] = getenv("OQS_OID_FRODO1344AES"); - - if (getenv("OQS_OID_P521_FRODO1344AES")) - oqs_oid_alg_list[26] = getenv("OQS_OID_P521_FRODO1344AES"); - if (getenv("OQS_OID_FRODO1344SHAKE")) - oqs_oid_alg_list[28] = getenv("OQS_OID_FRODO1344SHAKE"); - - if (getenv("OQS_OID_P521_FRODO1344SHAKE")) - oqs_oid_alg_list[30] = getenv("OQS_OID_P521_FRODO1344SHAKE"); - if (getenv("OQS_OID_KYBER512")) - oqs_oid_alg_list[32] = getenv("OQS_OID_KYBER512"); - - if (getenv("OQS_OID_P256_KYBER512")) - oqs_oid_alg_list[34] = getenv("OQS_OID_P256_KYBER512"); - if (getenv("OQS_OID_X25519_KYBER512")) - oqs_oid_alg_list[36] = getenv("OQS_OID_X25519_KYBER512"); - if (getenv("OQS_OID_KYBER768")) - oqs_oid_alg_list[38] = getenv("OQS_OID_KYBER768"); - - if (getenv("OQS_OID_P384_KYBER768")) - oqs_oid_alg_list[40] = getenv("OQS_OID_P384_KYBER768"); - if (getenv("OQS_OID_X448_KYBER768")) - oqs_oid_alg_list[42] = getenv("OQS_OID_X448_KYBER768"); - if (getenv("OQS_OID_X25519_KYBER768")) - oqs_oid_alg_list[44] = getenv("OQS_OID_X25519_KYBER768"); - if (getenv("OQS_OID_P256_KYBER768")) - oqs_oid_alg_list[46] = getenv("OQS_OID_P256_KYBER768"); - if (getenv("OQS_OID_KYBER1024")) - oqs_oid_alg_list[48] = getenv("OQS_OID_KYBER1024"); - - if (getenv("OQS_OID_P521_KYBER1024")) - oqs_oid_alg_list[50] = getenv("OQS_OID_P521_KYBER1024"); - if (getenv("OQS_OID_MLKEM512")) - oqs_oid_alg_list[52] = getenv("OQS_OID_MLKEM512"); - - if (getenv("OQS_OID_P256_MLKEM512")) - oqs_oid_alg_list[54] = getenv("OQS_OID_P256_MLKEM512"); - if (getenv("OQS_OID_X25519_MLKEM512")) - oqs_oid_alg_list[56] = getenv("OQS_OID_X25519_MLKEM512"); - if (getenv("OQS_OID_MLKEM768")) - oqs_oid_alg_list[58] = getenv("OQS_OID_MLKEM768"); - - if (getenv("OQS_OID_P384_MLKEM768")) - oqs_oid_alg_list[60] = getenv("OQS_OID_P384_MLKEM768"); - if (getenv("OQS_OID_X448_MLKEM768")) - oqs_oid_alg_list[62] = getenv("OQS_OID_X448_MLKEM768"); - if (getenv("OQS_OID_X25519_MLKEM768")) - oqs_oid_alg_list[64] = getenv("OQS_OID_X25519_MLKEM768"); - if (getenv("OQS_OID_P256_MLKEM768")) - oqs_oid_alg_list[66] = getenv("OQS_OID_P256_MLKEM768"); - if (getenv("OQS_OID_MLKEM1024")) - oqs_oid_alg_list[68] = getenv("OQS_OID_MLKEM1024"); - - if (getenv("OQS_OID_P521_MLKEM1024")) - oqs_oid_alg_list[70] = getenv("OQS_OID_P521_MLKEM1024"); - if (getenv("OQS_OID_P384_MLKEM1024")) - oqs_oid_alg_list[72] = getenv("OQS_OID_P384_MLKEM1024"); - if (getenv("OQS_OID_BIKEL1")) - oqs_oid_alg_list[74] = getenv("OQS_OID_BIKEL1"); - - if (getenv("OQS_OID_P256_BIKEL1")) - oqs_oid_alg_list[76] = getenv("OQS_OID_P256_BIKEL1"); - if (getenv("OQS_OID_X25519_BIKEL1")) - oqs_oid_alg_list[78] = getenv("OQS_OID_X25519_BIKEL1"); - if (getenv("OQS_OID_BIKEL3")) - oqs_oid_alg_list[80] = getenv("OQS_OID_BIKEL3"); - - if (getenv("OQS_OID_P384_BIKEL3")) - oqs_oid_alg_list[82] = getenv("OQS_OID_P384_BIKEL3"); - if (getenv("OQS_OID_X448_BIKEL3")) - oqs_oid_alg_list[84] = getenv("OQS_OID_X448_BIKEL3"); - if (getenv("OQS_OID_BIKEL5")) - oqs_oid_alg_list[86] = getenv("OQS_OID_BIKEL5"); - - if (getenv("OQS_OID_P521_BIKEL5")) - oqs_oid_alg_list[88] = getenv("OQS_OID_P521_BIKEL5"); - if (getenv("OQS_OID_HQC128")) - oqs_oid_alg_list[90] = getenv("OQS_OID_HQC128"); - - if (getenv("OQS_OID_P256_HQC128")) - oqs_oid_alg_list[92] = getenv("OQS_OID_P256_HQC128"); - if (getenv("OQS_OID_X25519_HQC128")) - oqs_oid_alg_list[94] = getenv("OQS_OID_X25519_HQC128"); - if (getenv("OQS_OID_HQC192")) - oqs_oid_alg_list[96] = getenv("OQS_OID_HQC192"); - - if (getenv("OQS_OID_P384_HQC192")) - oqs_oid_alg_list[98] = getenv("OQS_OID_P384_HQC192"); - if (getenv("OQS_OID_X448_HQC192")) - oqs_oid_alg_list[100] = getenv("OQS_OID_X448_HQC192"); - if (getenv("OQS_OID_HQC256")) - oqs_oid_alg_list[102] = getenv("OQS_OID_HQC256"); - - if (getenv("OQS_OID_P521_HQC256")) - oqs_oid_alg_list[104] = getenv("OQS_OID_P521_HQC256"); - # define OQS_KEMOID_CNT 104 + 2 #else # define OQS_KEMOID_CNT 0 #endif /* OQS_KEM_ENCODERS */ if (getenv("OQS_OID_DILITHIUM2")) oqs_oid_alg_list[0 + OQS_KEMOID_CNT] = getenv("OQS_OID_DILITHIUM2"); - oqs_oid_alg_list[0 + OQS_KEMOID_CNT] = getenv("OQS_OID_DILITHIUM2"); if (getenv("OQS_OID_P256_DILITHIUM2")) oqs_oid_alg_list[2 + OQS_KEMOID_CNT] = getenv("OQS_OID_P256_DILITHIUM2"); - oqs_oid_alg_list[2 + OQS_KEMOID_CNT] - = getenv("OQS_OID_P256_DILITHIUM2"); if (getenv("OQS_OID_RSA3072_DILITHIUM2")) oqs_oid_alg_list[4 + OQS_KEMOID_CNT] = getenv("OQS_OID_RSA3072_DILITHIUM2"); - oqs_oid_alg_list[4 + OQS_KEMOID_CNT] - = getenv("OQS_OID_RSA3072_DILITHIUM2"); if (getenv("OQS_OID_DILITHIUM3")) oqs_oid_alg_list[6 + OQS_KEMOID_CNT] = getenv("OQS_OID_DILITHIUM3"); - oqs_oid_alg_list[6 + OQS_KEMOID_CNT] = getenv("OQS_OID_DILITHIUM3"); if (getenv("OQS_OID_P384_DILITHIUM3")) oqs_oid_alg_list[8 + OQS_KEMOID_CNT] = getenv("OQS_OID_P384_DILITHIUM3"); - oqs_oid_alg_list[8 + OQS_KEMOID_CNT] - = getenv("OQS_OID_P384_DILITHIUM3"); if (getenv("OQS_OID_DILITHIUM5")) oqs_oid_alg_list[10 + OQS_KEMOID_CNT] = getenv("OQS_OID_DILITHIUM5"); - oqs_oid_alg_list[10 + OQS_KEMOID_CNT] = getenv("OQS_OID_DILITHIUM5"); if (getenv("OQS_OID_P521_DILITHIUM5")) oqs_oid_alg_list[12 + OQS_KEMOID_CNT] = getenv("OQS_OID_P521_DILITHIUM5"); @@ -699,33 +432,13 @@ int oqs_patch_oids(void) oqs_oid_alg_list[22 + OQS_KEMOID_CNT] = getenv("OQS_OID_P384_MLDSA65"); if (getenv("OQS_OID_MLDSA87")) oqs_oid_alg_list[24 + OQS_KEMOID_CNT] = getenv("OQS_OID_MLDSA87"); - if (getenv("OQS_OID_P521_MLDSA87")) - oqs_oid_alg_list[26 + OQS_KEMOID_CNT] = getenv("OQS_OID_P521_MLDSA87"); - oqs_oid_alg_list[12 + OQS_KEMOID_CNT] - = getenv("OQS_OID_P521_DILITHIUM5"); - if (getenv("OQS_OID_MLDSA44")) - oqs_oid_alg_list[14 + OQS_KEMOID_CNT] = getenv("OQS_OID_MLDSA44"); - if (getenv("OQS_OID_P256_MLDSA44")) - oqs_oid_alg_list[16 + OQS_KEMOID_CNT] = getenv("OQS_OID_P256_MLDSA44"); - if (getenv("OQS_OID_RSA3072_MLDSA44")) - oqs_oid_alg_list[18 + OQS_KEMOID_CNT] - = getenv("OQS_OID_RSA3072_MLDSA44"); - if (getenv("OQS_OID_MLDSA65")) - oqs_oid_alg_list[20 + OQS_KEMOID_CNT] = getenv("OQS_OID_MLDSA65"); - if (getenv("OQS_OID_P384_MLDSA65")) - oqs_oid_alg_list[22 + OQS_KEMOID_CNT] = getenv("OQS_OID_P384_MLDSA65"); - if (getenv("OQS_OID_MLDSA87")) - oqs_oid_alg_list[24 + OQS_KEMOID_CNT] = getenv("OQS_OID_MLDSA87"); if (getenv("OQS_OID_P521_MLDSA87")) oqs_oid_alg_list[26 + OQS_KEMOID_CNT] = getenv("OQS_OID_P521_MLDSA87"); if (getenv("OQS_OID_FALCON512")) oqs_oid_alg_list[28 + OQS_KEMOID_CNT] = getenv("OQS_OID_FALCON512"); - oqs_oid_alg_list[28 + OQS_KEMOID_CNT] = getenv("OQS_OID_FALCON512"); if (getenv("OQS_OID_P256_FALCON512")) oqs_oid_alg_list[30 + OQS_KEMOID_CNT] = getenv("OQS_OID_P256_FALCON512"); - oqs_oid_alg_list[30 + OQS_KEMOID_CNT] - = getenv("OQS_OID_P256_FALCON512"); if (getenv("OQS_OID_RSA3072_FALCON512")) oqs_oid_alg_list[32 + OQS_KEMOID_CNT] = getenv("OQS_OID_RSA3072_FALCON512"); @@ -735,95 +448,53 @@ int oqs_patch_oids(void) if (getenv("OQS_OID_P256_FALCONPADDED512")) oqs_oid_alg_list[36 + OQS_KEMOID_CNT] = getenv("OQS_OID_P256_FALCONPADDED512"); - if (getenv("OQS_OID_RSA3072_FALCONPADDED512")) - oqs_oid_alg_list[38 + OQS_KEMOID_CNT] - = getenv("OQS_OID_RSA3072_FALCONPADDED512"); - oqs_oid_alg_list[32 + OQS_KEMOID_CNT] - = getenv("OQS_OID_RSA3072_FALCON512"); - if (getenv("OQS_OID_FALCONPADDED512")) - oqs_oid_alg_list[34 + OQS_KEMOID_CNT] - = getenv("OQS_OID_FALCONPADDED512"); - if (getenv("OQS_OID_P256_FALCONPADDED512")) - oqs_oid_alg_list[36 + OQS_KEMOID_CNT] - = getenv("OQS_OID_P256_FALCONPADDED512"); if (getenv("OQS_OID_RSA3072_FALCONPADDED512")) oqs_oid_alg_list[38 + OQS_KEMOID_CNT] = getenv("OQS_OID_RSA3072_FALCONPADDED512"); if (getenv("OQS_OID_FALCON1024")) oqs_oid_alg_list[40 + OQS_KEMOID_CNT] = getenv("OQS_OID_FALCON1024"); - oqs_oid_alg_list[40 + OQS_KEMOID_CNT] = getenv("OQS_OID_FALCON1024"); if (getenv("OQS_OID_P521_FALCON1024")) oqs_oid_alg_list[42 + OQS_KEMOID_CNT] = getenv("OQS_OID_P521_FALCON1024"); if (getenv("OQS_OID_FALCONPADDED1024")) oqs_oid_alg_list[44 + OQS_KEMOID_CNT] = getenv("OQS_OID_FALCONPADDED1024"); - if (getenv("OQS_OID_P521_FALCONPADDED1024")) - oqs_oid_alg_list[46 + OQS_KEMOID_CNT] - = getenv("OQS_OID_P521_FALCONPADDED1024"); - oqs_oid_alg_list[42 + OQS_KEMOID_CNT] - = getenv("OQS_OID_P521_FALCON1024"); - if (getenv("OQS_OID_FALCONPADDED1024")) - oqs_oid_alg_list[44 + OQS_KEMOID_CNT] - = getenv("OQS_OID_FALCONPADDED1024"); if (getenv("OQS_OID_P521_FALCONPADDED1024")) oqs_oid_alg_list[46 + OQS_KEMOID_CNT] = getenv("OQS_OID_P521_FALCONPADDED1024"); if (getenv("OQS_OID_SPHINCSSHA2128FSIMPLE")) oqs_oid_alg_list[48 + OQS_KEMOID_CNT] = getenv("OQS_OID_SPHINCSSHA2128FSIMPLE"); - oqs_oid_alg_list[48 + OQS_KEMOID_CNT] - = getenv("OQS_OID_SPHINCSSHA2128FSIMPLE"); if (getenv("OQS_OID_P256_SPHINCSSHA2128FSIMPLE")) oqs_oid_alg_list[50 + OQS_KEMOID_CNT] = getenv("OQS_OID_P256_SPHINCSSHA2128FSIMPLE"); - oqs_oid_alg_list[50 + OQS_KEMOID_CNT] - = getenv("OQS_OID_P256_SPHINCSSHA2128FSIMPLE"); if (getenv("OQS_OID_RSA3072_SPHINCSSHA2128FSIMPLE")) oqs_oid_alg_list[52 + OQS_KEMOID_CNT] = getenv("OQS_OID_RSA3072_SPHINCSSHA2128FSIMPLE"); - oqs_oid_alg_list[52 + OQS_KEMOID_CNT] - = getenv("OQS_OID_RSA3072_SPHINCSSHA2128FSIMPLE"); if (getenv("OQS_OID_SPHINCSSHA2128SSIMPLE")) oqs_oid_alg_list[54 + OQS_KEMOID_CNT] = getenv("OQS_OID_SPHINCSSHA2128SSIMPLE"); - oqs_oid_alg_list[54 + OQS_KEMOID_CNT] - = getenv("OQS_OID_SPHINCSSHA2128SSIMPLE"); if (getenv("OQS_OID_P256_SPHINCSSHA2128SSIMPLE")) oqs_oid_alg_list[56 + OQS_KEMOID_CNT] = getenv("OQS_OID_P256_SPHINCSSHA2128SSIMPLE"); - oqs_oid_alg_list[56 + OQS_KEMOID_CNT] - = getenv("OQS_OID_P256_SPHINCSSHA2128SSIMPLE"); if (getenv("OQS_OID_RSA3072_SPHINCSSHA2128SSIMPLE")) oqs_oid_alg_list[58 + OQS_KEMOID_CNT] = getenv("OQS_OID_RSA3072_SPHINCSSHA2128SSIMPLE"); - oqs_oid_alg_list[58 + OQS_KEMOID_CNT] - = getenv("OQS_OID_RSA3072_SPHINCSSHA2128SSIMPLE"); if (getenv("OQS_OID_SPHINCSSHA2192FSIMPLE")) oqs_oid_alg_list[60 + OQS_KEMOID_CNT] = getenv("OQS_OID_SPHINCSSHA2192FSIMPLE"); - oqs_oid_alg_list[60 + OQS_KEMOID_CNT] - = getenv("OQS_OID_SPHINCSSHA2192FSIMPLE"); if (getenv("OQS_OID_P384_SPHINCSSHA2192FSIMPLE")) oqs_oid_alg_list[62 + OQS_KEMOID_CNT] = getenv("OQS_OID_P384_SPHINCSSHA2192FSIMPLE"); - oqs_oid_alg_list[62 + OQS_KEMOID_CNT] - = getenv("OQS_OID_P384_SPHINCSSHA2192FSIMPLE"); if (getenv("OQS_OID_SPHINCSSHAKE128FSIMPLE")) oqs_oid_alg_list[64 + OQS_KEMOID_CNT] = getenv("OQS_OID_SPHINCSSHAKE128FSIMPLE"); - oqs_oid_alg_list[64 + OQS_KEMOID_CNT] - = getenv("OQS_OID_SPHINCSSHAKE128FSIMPLE"); if (getenv("OQS_OID_P256_SPHINCSSHAKE128FSIMPLE")) oqs_oid_alg_list[66 + OQS_KEMOID_CNT] = getenv("OQS_OID_P256_SPHINCSSHAKE128FSIMPLE"); - oqs_oid_alg_list[66 + OQS_KEMOID_CNT] - = getenv("OQS_OID_P256_SPHINCSSHAKE128FSIMPLE"); if (getenv("OQS_OID_RSA3072_SPHINCSSHAKE128FSIMPLE")) oqs_oid_alg_list[68 + OQS_KEMOID_CNT] = getenv("OQS_OID_RSA3072_SPHINCSSHAKE128FSIMPLE"); - oqs_oid_alg_list[68 + OQS_KEMOID_CNT] - = getenv("OQS_OID_RSA3072_SPHINCSSHAKE128FSIMPLE"); ///// OQS_TEMPLATE_FRAGMENT_OID_PATCHING_END return 1; } @@ -1166,11 +837,6 @@ static const OSSL_ALGORITHM oqsprovider_signatures[] = { SIGALG("p256_falconpadded512", 128, oqs_signature_functions), SIGALG("rsa3072_falconpadded512", 128, oqs_signature_functions), #endif -#ifdef OQS_ENABLE_SIG_falcon_padded_512 - SIGALG("falconpadded512", 128, oqs_signature_functions), - SIGALG("p256_falconpadded512", 128, oqs_signature_functions), - SIGALG("rsa3072_falconpadded512", 128, oqs_signature_functions), -#endif #ifdef OQS_ENABLE_SIG_falcon_1024 SIGALG("falcon1024", 256, oqs_signature_functions), SIGALG("p521_falcon1024", 256, oqs_signature_functions), @@ -1179,10 +845,6 @@ static const OSSL_ALGORITHM oqsprovider_signatures[] = { SIGALG("falconpadded1024", 256, oqs_signature_functions), SIGALG("p521_falconpadded1024", 256, oqs_signature_functions), #endif -#ifdef OQS_ENABLE_SIG_falcon_padded_1024 - SIGALG("falconpadded1024", 256, oqs_signature_functions), - SIGALG("p521_falconpadded1024", 256, oqs_signature_functions), -#endif #ifdef OQS_ENABLE_SIG_sphincs_sha2_128f_simple SIGALG("sphincssha2128fsimple", 128, oqs_signature_functions), SIGALG("p256_sphincssha2128fsimple", 128, oqs_signature_functions), @@ -1269,23 +931,6 @@ static const OSSL_ALGORITHM oqsprovider_asym_kems[] = { KEMHYBALG(p521_mlkem1024, 256) KEMHYBALG(p384_mlkem1024, 192) #endif -#ifdef OQS_ENABLE_KEM_ml_kem_512 - KEMBASEALG(mlkem512, 128) - KEMHYBALG(p256_mlkem512, 128) - KEMHYBALG(x25519_mlkem512, 128) -#endif -#ifdef OQS_ENABLE_KEM_ml_kem_768 - KEMBASEALG(mlkem768, 192) - KEMHYBALG(p384_mlkem768, 192) - KEMHYBALG(x448_mlkem768, 192) - KEMHYBALG(x25519_mlkem768, 128) - KEMHYBALG(p256_mlkem768, 128) -#endif -#ifdef OQS_ENABLE_KEM_ml_kem_1024 - KEMBASEALG(mlkem1024, 256) - KEMHYBALG(p521_mlkem1024, 256) - KEMHYBALG(p384_mlkem1024, 192) -#endif #ifdef OQS_ENABLE_KEM_bike_l1 KEMBASEALG(bikel1, 128) KEMHYBALG(p256_bikel1, 128) @@ -1318,8 +963,6 @@ static const OSSL_ALGORITHM oqsprovider_asym_kems[] = { ///// 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 @@ -1374,11 +1017,6 @@ static const OSSL_ALGORITHM oqsprovider_keymgmt[] SIGALG("p256_falconpadded512", 128, oqs_p256_falconpadded512_keymgmt_functions), SIGALG("rsa3072_falconpadded512", 128, oqs_rsa3072_falconpadded512_keymgmt_functions), #endif -#ifdef OQS_ENABLE_SIG_falcon_padded_512 - SIGALG("falconpadded512", 128, oqs_falconpadded512_keymgmt_functions), - SIGALG("p256_falconpadded512", 128, oqs_p256_falconpadded512_keymgmt_functions), - SIGALG("rsa3072_falconpadded512", 128, oqs_rsa3072_falconpadded512_keymgmt_functions), -#endif #ifdef OQS_ENABLE_SIG_falcon_1024 SIGALG("falcon1024", 256, oqs_falcon1024_keymgmt_functions), SIGALG("p521_falcon1024", 256, oqs_p521_falcon1024_keymgmt_functions), @@ -1387,10 +1025,6 @@ static const OSSL_ALGORITHM oqsprovider_keymgmt[] SIGALG("falconpadded1024", 256, oqs_falconpadded1024_keymgmt_functions), SIGALG("p521_falconpadded1024", 256, oqs_p521_falconpadded1024_keymgmt_functions), #endif -#ifdef OQS_ENABLE_SIG_falcon_padded_1024 - SIGALG("falconpadded1024", 256, oqs_falconpadded1024_keymgmt_functions), - SIGALG("p521_falconpadded1024", 256, oqs_p521_falconpadded1024_keymgmt_functions), -#endif #ifdef OQS_ENABLE_SIG_sphincs_sha2_128f_simple SIGALG("sphincssha2128fsimple", 128, oqs_sphincssha2128fsimple_keymgmt_functions), SIGALG("p256_sphincssha2128fsimple", 128, oqs_p256_sphincssha2128fsimple_keymgmt_functions), @@ -1484,26 +1118,6 @@ static const OSSL_ALGORITHM oqsprovider_keymgmt[] KEMKMHYBALG(p521_mlkem1024, 256, ecp) KEMKMHYBALG(p384_mlkem1024, 192, ecp) #endif -#ifdef OQS_ENABLE_KEM_ml_kem_512 - KEMKMALG(mlkem512, 128) - - KEMKMHYBALG(p256_mlkem512, 128, ecp) - KEMKMHYBALG(x25519_mlkem512, 128, ecx) -#endif -#ifdef OQS_ENABLE_KEM_ml_kem_768 - KEMKMALG(mlkem768, 192) - - KEMKMHYBALG(p384_mlkem768, 192, ecp) - KEMKMHYBALG(x448_mlkem768, 192, ecx) - KEMKMHYBALG(x25519_mlkem768, 128, ecx) - KEMKMHYBALG(p256_mlkem768, 128, ecp) -#endif -#ifdef OQS_ENABLE_KEM_ml_kem_1024 - KEMKMALG(mlkem1024, 256) - - KEMKMHYBALG(p521_mlkem1024, 256, ecp) - KEMKMHYBALG(p384_mlkem1024, 192, ecp) -#endif #ifdef OQS_ENABLE_KEM_bike_l1 KEMKMALG(bikel1, 128) @@ -1541,9 +1155,6 @@ static const OSSL_ALGORITHM oqsprovider_keymgmt[] // 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" @@ -1619,7 +1230,6 @@ static int oqsprovider_get_params(void *provctx, OSSL_PARAM params[]) if (p != NULL && !OSSL_PARAM_set_int(p, 1)) // provider is always running return 0; // not passing in params to respond to is no error; response is empty then - // not passing in params to respond to is no error; response is empty then return 1; } diff --git a/oqsprov/oqsprov_keys.c b/oqsprov/oqsprov_keys.c index 141203c8..23e95267 100644 --- a/oqsprov/oqsprov_keys.c +++ b/oqsprov/oqsprov_keys.c @@ -126,73 +126,6 @@ static oqs_nid_name_t nid_names[NID_TABLE_LEN] = { {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 */ -#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}, - #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}, @@ -225,11 +158,6 @@ static oqs_nid_name_t nid_names[NID_TABLE_LEN] = { {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, "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, @@ -237,9 +165,6 @@ static oqs_nid_name_t nid_names[NID_TABLE_LEN] = { {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, "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, @@ -685,7 +610,6 @@ static OQSX_KEY *oqsx_key_op(const X509_ALGOR *palg, const unsigned char *p, return 0; } OQS_KEY_PRINTF2("OQSX KEY: Recreated OQSX key %s\n", key->tls_name); - OQS_KEY_PRINTF2("OQSX KEY: Recreated OQSX key %s\n", key->tls_name); if (op == KEY_OP_PUBLIC) { #ifdef USE_ENCODING_LIB @@ -697,12 +621,10 @@ static OQSX_KEY *oqsx_key_op(const X509_ALGOR *palg, const unsigned char *p, != plen) { ERR_raise(ERR_LIB_USER, OQSPROV_R_INVALID_ENCODING); goto err_key_op; - goto err_key_op; } if (oqsx_key_allocate_keymaterial(key, 0)) { ERR_raise(ERR_LIB_USER, ERR_R_MALLOC_FAILURE); goto err_key_op; - goto err_key_op; } if (qsc_decode(key->oqsx_encoding_ctx.encoding_ctx, key->oqsx_encoding_ctx.encoding_impl, p, @@ -710,19 +632,16 @@ static OQSX_KEY *oqsx_key_op(const X509_ALGOR *palg, const unsigned char *p, != QSC_ENC_OK) { ERR_raise(ERR_LIB_USER, OQSPROV_R_INVALID_ENCODING); goto err_key_op; - goto err_key_op; } } else { #endif if (key->pubkeylen != plen) { ERR_raise(ERR_LIB_USER, OQSPROV_R_INVALID_ENCODING); goto err_key_op; - goto err_key_op; } if (oqsx_key_allocate_keymaterial(key, 0)) { ERR_raise(ERR_LIB_USER, ERR_R_MALLOC_FAILURE); goto err_key_op; - goto err_key_op; } memcpy(key->pubkey, p, plen); #ifdef USE_ENCODING_LIB @@ -938,11 +857,9 @@ static OQSX_KEY *oqsx_key_op(const X509_ALGOR *palg, const unsigned char *p, #endif if (!oqsx_key_set_composites(key) || !oqsx_key_recreate_classickey(key, op)) goto err_key_op; - goto err_key_op; return key; -err_key_op: err_key_op: oqsx_key_free(key); return NULL; @@ -1384,8 +1301,6 @@ 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 OQSX_KEY *ret = OPENSSL_zalloc( sizeof(*ret)); // ensure all component pointers are NULL OQSX_EVP_CTX *evp_ctx = NULL; @@ -1397,7 +1312,6 @@ OQSX_KEY *oqsx_key_new(OSSL_LIB_CTX *libctx, char *oqs_name, char *tls_name, #ifdef OQS_PROVIDER_NOATOMIC ret->lock = CRYPTO_THREAD_lock_new(); ON_ERR_GOTO(!ret->lock, err); - ON_ERR_GOTO(!ret->lock, err); #endif if (oqs_name == NULL) { @@ -1492,7 +1406,6 @@ 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); - 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 @@ -1504,7 +1417,6 @@ OQSX_KEY *oqsx_key_new(OSSL_LIB_CTX *libctx, char *oqs_name, char *tls_name, ret->oqsx_provider_ctx.oqsx_evp_ctx = evp_ctx; ret->keytype = primitive; ret->evp_info = evp_ctx->evp_info; - ret->evp_info = evp_ctx->evp_info; break; case KEY_TYPE_HYB_SIG: ret->oqsx_provider_ctx.oqsx_qs_ctx.sig = OQS_SIG_new(oqs_name); @@ -1525,7 +1437,6 @@ 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); - 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 @@ -1596,18 +1507,13 @@ OQSX_KEY *oqsx_key_new(OSSL_LIB_CTX *libctx, char *oqs_name, char *tls_name, ret->references = 1; ret->tls_name = OPENSSL_strdup(tls_name); ON_ERR_GOTO(!ret->tls_name, err); - ON_ERR_GOTO(!ret->tls_name, err); ret->bit_security = bit_security; if (propq != NULL) { ret->propq = OPENSSL_strdup(propq); ON_ERR_GOTO(!ret->propq, err); - ON_ERR_GOTO(!ret->propq, err); } - OQS_KEY_PRINTF2("OQSX_KEY: new key created: %s\n", ret->tls_name); - OQS_KEY_PRINTF3("OQSX_KEY: new key created: %p (type: %d)\n", ret, - ret->keytype); OQS_KEY_PRINTF2("OQSX_KEY: new key created: %s\n", ret->tls_name); OQS_KEY_PRINTF3("OQSX_KEY: new key created: %p (type: %d)\n", ret, ret->keytype); @@ -1617,14 +1523,6 @@ OQSX_KEY *oqsx_key_new(OSSL_LIB_CTX *libctx, char *oqs_name, char *tls_name, #ifdef OQS_PROVIDER_NOATOMIC if (ret->lock) CRYPTO_THREAD_lock_free(ret->lock); -#endif - OPENSSL_free(ret->tls_name); - OPENSSL_free(ret->propq); - OPENSSL_free(ret->comp_privkey); - OPENSSL_free(ret->comp_pubkey); -#ifdef OQS_PROVIDER_NOATOMIC - if (ret->lock) - CRYPTO_THREAD_lock_free(ret->lock); #endif OPENSSL_free(ret->tls_name); OPENSSL_free(ret->propq); @@ -1720,9 +1618,7 @@ int oqsx_key_allocate_keymaterial(OQSX_KEY *key, int include_private) if (!key->pubkey && !include_private) { key->pubkey = OPENSSL_secure_zalloc(key->pubkeylen); ON_ERR_SET_GOTO(!key->pubkey, ret, 1, err_alloc); - ON_ERR_SET_GOTO(!key->pubkey, ret, 1, err_alloc); } -err_alloc: err_alloc: return ret; } @@ -1731,7 +1627,6 @@ int oqsx_key_fromdata(OQSX_KEY *key, const OSSL_PARAM params[], int include_private) { const OSSL_PARAM *pp1, *pp2; - const OSSL_PARAM *pp1, *pp2; OQS_KEY_PRINTF("OQSX Key from data called\n"); pp1 = OSSL_PARAM_locate_const(params, OSSL_PKEY_PARAM_PRIV_KEY); @@ -1741,58 +1636,39 @@ int oqsx_key_fromdata(OQSX_KEY *key, const OSSL_PARAM params[], ERR_raise(ERR_LIB_USER, OQSPROV_R_WRONG_PARAMETERS); return 0; } - if (pp1 != NULL) { - if (pp1->data_type != OSSL_PARAM_OCTET_STRING) { - pp1 = OSSL_PARAM_locate_const(params, OSSL_PKEY_PARAM_PRIV_KEY); - pp2 = OSSL_PARAM_locate_const(params, OSSL_PKEY_PARAM_PUB_KEY); - // at least one parameter must be given - if (pp1 == NULL && pp2 == NULL) { - ERR_raise(ERR_LIB_USER, OQSPROV_R_WRONG_PARAMETERS); - return 0; - } if (pp1 != NULL) { if (pp1->data_type != OSSL_PARAM_OCTET_STRING) { ERR_raise(ERR_LIB_USER, OQSPROV_R_INVALID_ENCODING); return 0; } - if (key->privkeylen != pp1->data_size) { if (key->privkeylen != pp1->data_size) { ERR_raise(ERR_LIB_USER, OQSPROV_R_INVALID_SIZE); return 0; } OPENSSL_secure_clear_free(key->privkey, pp1->data_size); key->privkey = OPENSSL_secure_malloc(pp1->data_size); - OPENSSL_secure_clear_free(key->privkey, pp1->data_size); - key->privkey = OPENSSL_secure_malloc(pp1->data_size); if (key->privkey == NULL) { ERR_raise(ERR_LIB_USER, ERR_R_MALLOC_FAILURE); return 0; } memcpy(key->privkey, pp1->data, pp1->data_size); - memcpy(key->privkey, pp1->data, pp1->data_size); } - if (pp2 != NULL) { - if (pp2->data_type != OSSL_PARAM_OCTET_STRING) { if (pp2 != NULL) { if (pp2->data_type != OSSL_PARAM_OCTET_STRING) { OQS_KEY_PRINTF("invalid data type\n"); return 0; } - if (key->pubkeylen != pp2->data_size) { if (key->pubkeylen != pp2->data_size) { ERR_raise(ERR_LIB_USER, OQSPROV_R_INVALID_SIZE); return 0; } OPENSSL_secure_clear_free(key->pubkey, pp2->data_size); key->pubkey = OPENSSL_secure_malloc(pp2->data_size); - OPENSSL_secure_clear_free(key->pubkey, pp2->data_size); - key->pubkey = OPENSSL_secure_malloc(pp2->data_size); if (key->pubkey == NULL) { ERR_raise(ERR_LIB_USER, ERR_R_MALLOC_FAILURE); return 0; } memcpy(key->pubkey, pp2->data, pp2->data_size); - memcpy(key->pubkey, pp2->data, pp2->data_size); } if (!oqsx_key_set_composites(key) || !oqsx_key_recreate_classickey( @@ -1913,7 +1789,6 @@ static EVP_PKEY *oqsx_key_gen_evp_key(OQSX_EVP_CTX *ctx, unsigned char *pubkey, return NULL; } -/* allocates OQS and classical keys */ /* allocates OQS and classical keys */ int oqsx_key_gen(OQSX_KEY *key) { @@ -1924,13 +1799,11 @@ int oqsx_key_gen(OQSX_KEY *key) ret = oqsx_key_allocate_keymaterial(key, 0) || oqsx_key_allocate_keymaterial(key, 1); ON_ERR_GOTO(ret, err_gen); - ON_ERR_GOTO(ret, err_gen); } if (key->keytype == KEY_TYPE_KEM) { ret = !oqsx_key_set_composites(key); ON_ERR_GOTO(ret, err_gen); - 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 @@ -1940,7 +1813,6 @@ int oqsx_key_gen(OQSX_KEY *key) ON_ERR_GOTO(pkey == NULL, err_gen); ret = !oqsx_key_set_composites(key); ON_ERR_GOTO(ret, err_gen); - ON_ERR_GOTO(ret, err_gen); OQS_KEY_PRINTF3("OQSKM: OQSX_KEY privkeylen %ld & pubkeylen: %ld\n", key->privkeylen, key->pubkeylen); @@ -1973,12 +1845,10 @@ int oqsx_key_gen(OQSX_KEY *key) } else if (key->keytype == KEY_TYPE_SIG) { ret = !oqsx_key_set_composites(key); ON_ERR_GOTO(ret, err_gen); - ON_ERR_GOTO(ret, err_gen); ret = oqsx_key_gen_oqs(key, 0); } else { ret = 1; } -err_gen: err_gen: if (ret) { EVP_PKEY_free(pkey);