diff --git a/oqs-template/generate.yml b/oqs-template/generate.yml index 099d36ed..a78a9843 100644 --- a/oqs-template/generate.yml +++ b/oqs-template/generate.yml @@ -382,7 +382,21 @@ sigs: # 'pretty_name': 'RSA3072', # 'oid': '1.3.9999.1.3', # 'code_point': '0xfe02'}] + # composite:[{'name': 'p256', + # 'pretty_name': 'ECDSA p256', + # 'security': '128', + # 'oid': '2.16.840.1.114027.80.1.8'}] - + # OID scheme for composite variants: + # (2) + # (16) + # (840) + # (1) + # (114027) + # (80) + # (7) + # (1) + # - # OID scheme for hybrid variants of Dilithium: # iso (1) # identified-organization (3) @@ -398,6 +412,8 @@ sigs: # IBM (2) # qsc (267) # Dilithium-r3 (7) + + family: 'CRYSTALS-Dilithium' variants: - @@ -416,6 +432,26 @@ sigs: 'pretty_name': 'RSA3072', 'oid': '1.3.9999.2.7.2', 'code_point': '0xfea2'}] + composite: [{'name': 'pss2048', + 'pretty_name': 'RSA PSS 2048', + 'security': '112', + 'oid': '2.16.840.1.114027.80.7.1.1'}, + {'name': 'rsa2048', + 'pretty_name': 'RSA2028', + 'security': '112', + 'oid': '2.16.840.1.114027.80.7.1.2'}, + {'name': 'ed25519', + 'pretty_name': 'ED25519', + 'security': '128', + 'oid': '2.16.840.1.114027.80.7.1.3'}, + {'name': 'p256', + 'pretty_name': 'ECDSA p256', + 'security': '128', + 'oid': '2.16.840.1.114027.80.7.1.4'}, + {'name': 'bp256', + 'pretty_name': 'ECDSA brainpoolP256r1', + 'security': '256', + 'oid': '2.16.840.1.114027.80.7.1.5'}] - name: 'dilithium3' pretty_name: 'Dilithium3' @@ -428,6 +464,26 @@ sigs: 'pretty_name': 'ECDSA p384', 'oid': '1.3.9999.2.7.3', 'code_point': '0xfea4'}] + composite: [{'name': 'pss3072', + 'pretty_name': 'RSA PSS 3072', + 'security': '128', + 'oid': '2.16.840.1.114027.80.7.1.6'}, + {'name': 'rsa3072', + 'pretty_name': 'RSA 3072', + 'security': '128', + 'oid': '2.16.840.1.114027.80.7.1.7'}, + {'name': 'p256', + 'pretty_name': 'ECDSA p256', + 'security': '128', + 'oid': '2.16.840.1.114027.80.7.1.8'}, + {'name': 'bp256', + 'pretty_name': 'ECDSA brainpoolP256r1', + 'security': '256', + 'oid': '2.16.840.1.114027.80.7.1.9'}, + {'name': 'ed25519', + 'pretty_name': 'ED25519', + 'security': '128', + 'oid': '2.16.840.1.114027.80.7.1.10'}] - name: 'dilithium5' pretty_name: 'Dilithium5' @@ -440,6 +496,18 @@ sigs: 'pretty_name': 'ECDSA p521', 'oid': '1.3.9999.2.7.4', 'code_point': '0xfea6'}] + composite: [{'name': 'p384', + 'pretty_name': 'ECDSA p384', + 'security': '192', + 'oid': '2.16.840.1.114027.80.7.1.11'}, + {'name': 'bp384', + 'pretty_name': 'ECDSA brainpoolP384r1', + 'security': '384', + 'oid': '2.16.840.1.114027.80.7.1.12'}, + {'name': 'ed448', + 'pretty_name': 'ED448', + 'security': '192', + 'oid': '2.16.840.1.114027.80.7.1.13'}] - name: 'dilithium2_aes' pretty_name: 'Dilithium2_AES' @@ -512,6 +580,18 @@ sigs: 'pretty_name': 'RSA3072', 'oid': '1.3.9999.3.8', 'code_point': '0xfeb0'}] + composite: [{'name': 'p256', + 'pretty_name': 'ECDSA p256', + 'security': '128', + 'oid': '2.16.840.1.114027.80.7.1.14'}, + {'name': 'bp256', + 'pretty_name': 'ECDSA brainpoolP256r1', + 'security': '256', + 'oid': '2.16.840.1.114027.80.7.1.15'}, + {'name': 'ed25519', + 'pretty_name': 'ED25519', + 'security': '128', + 'oid': '2.16.840.1.114027.80.7.1.16'}] extra_nids: old: - implementation_version: NIST Round 3 submission diff --git a/oqs-template/oqsprov/oqs_decode_der2key.c/decoder_make.fragment b/oqs-template/oqsprov/oqs_decode_der2key.c/decoder_make.fragment index be39a93e..e99a82b2 100644 --- a/oqs-template/oqsprov/oqs_decode_der2key.c/decoder_make.fragment +++ b/oqs-template/oqsprov/oqs_decode_der2key.c/decoder_make.fragment @@ -19,6 +19,10 @@ MAKE_DECODER(, "{{ variant['name'] }}", {{ variant['name'] }}, oqsx, SubjectPubl MAKE_DECODER(, "{{ classical_alg['name'] }}_{{ variant['name'] }}", {{ classical_alg['name'] }}_{{ variant['name'] }}, oqsx, PrivateKeyInfo); MAKE_DECODER(, "{{ classical_alg['name'] }}_{{ variant['name'] }}", {{ classical_alg['name'] }}_{{ variant['name'] }}, oqsx, SubjectPublicKeyInfo); {%- endfor -%} + {%- for composite_alg in variant['composite'] %} +MAKE_DECODER(, "{{ variant['name'] }}_{{ composite_alg['name'] }}", {{ variant['name'] }}_{{ composite_alg['name'] }}, oqsx, PrivateKeyInfo); +MAKE_DECODER(, "{{ variant['name'] }}_{{ composite_alg['name'] }}", {{ variant['name'] }}_{{ composite_alg['name'] }}, oqsx, SubjectPublicKeyInfo); + {%- endfor -%} {%- endfor %} {%- endfor %} diff --git a/oqs-template/oqsprov/oqs_encode_key2any.c/encoder_make.fragment b/oqs-template/oqsprov/oqs_encode_key2any.c/encoder_make.fragment index edc87530..f05a36b9 100644 --- a/oqs-template/oqsprov/oqs_encode_key2any.c/encoder_make.fragment +++ b/oqs-template/oqsprov/oqs_encode_key2any.c/encoder_make.fragment @@ -38,6 +38,15 @@ MAKE_ENCODER(, {{ classical_alg['name'] }}_{{ variant['name'] }}, oqsx, SubjectP MAKE_ENCODER(, {{ classical_alg['name'] }}_{{ variant['name'] }}, oqsx, SubjectPublicKeyInfo, pem); MAKE_TEXT_ENCODER(, {{ classical_alg['name'] }}_{{ variant['name'] }}); {%- endfor -%} + {%- for composite_alg in variant['composite'] %} +MAKE_ENCODER(, {{ variant['name'] }}_{{ composite_alg['name'] }}, oqsx, EncryptedPrivateKeyInfo, der); +MAKE_ENCODER(, {{ variant['name'] }}_{{ composite_alg['name'] }}, oqsx, EncryptedPrivateKeyInfo, pem); +MAKE_ENCODER(, {{ variant['name'] }}_{{ composite_alg['name'] }}, oqsx, PrivateKeyInfo, der); +MAKE_ENCODER(, {{ variant['name'] }}_{{ composite_alg['name'] }}, oqsx, PrivateKeyInfo, pem); +MAKE_ENCODER(, {{ variant['name'] }}_{{ composite_alg['name'] }}, oqsx, SubjectPublicKeyInfo, der); +MAKE_ENCODER(, {{ variant['name'] }}_{{ composite_alg['name'] }}, oqsx, SubjectPublicKeyInfo, pem); +MAKE_TEXT_ENCODER(, {{ variant['name'] }}_{{ composite_alg['name'] }}); + {%- endfor -%} {%- endfor %} {%- endfor %} diff --git a/oqs-template/oqsprov/oqs_kmgmt.c/keymgmt_constructors.fragment b/oqs-template/oqsprov/oqs_kmgmt.c/keymgmt_constructors.fragment index df892142..847eff8d 100644 --- a/oqs-template/oqsprov/oqs_kmgmt.c/keymgmt_constructors.fragment +++ b/oqs-template/oqsprov/oqs_kmgmt.c/keymgmt_constructors.fragment @@ -24,6 +24,19 @@ static void *{{ classical_alg['name'] }}_{{variant['name']}}_gen_init(void *prov return oqsx_gen_init(provctx, selection, {{variant['oqs_meth']}}, "{{ classical_alg['name'] }}_{{variant['name']}}", KEY_TYPE_HYB_SIG, {{variant['security']}}, {{ count.val }}); } + {%- endfor -%} + {%- for composite_alg in variant['composite'] %} + {%- set count.val = count.val + 1 %} +static void *{{ variant['name'] }}_{{ composite_alg['name'] }}_new_key(void *provctx) +{ + return oqsx_key_new(PROV_OQS_LIBCTX_OF(provctx), {{variant['oqs_meth']}}, "{{ variant['name'] }}_{{ composite_alg['name'] }}", KEY_TYPE_CMP_SIG, NULL, {{composite_alg['security']}}, {{ count.val }}); +} + +static void *{{ variant['name'] }}_{{ composite_alg['name'] }}_gen_init(void *provctx, int selection) +{ + return oqsx_gen_init(provctx, selection, {{variant['oqs_meth']}}, "{{ variant['name'] }}_{{ composite_alg['name'] }}", KEY_TYPE_CMP_SIG, {{composite_alg['security']}}, {{ count.val }}); +} + {%- endfor -%} {%- endfor %} {% endfor %} diff --git a/oqs-template/oqsprov/oqs_kmgmt.c/keymgmt_functions.fragment b/oqs-template/oqsprov/oqs_kmgmt.c/keymgmt_functions.fragment index 93e6dbb8..8c0bc153 100644 --- a/oqs-template/oqsprov/oqs_kmgmt.c/keymgmt_functions.fragment +++ b/oqs-template/oqsprov/oqs_kmgmt.c/keymgmt_functions.fragment @@ -4,6 +4,9 @@ MAKE_SIG_KEYMGMT_FUNCTIONS({{variant['name']}}) {%- for classical_alg in variant['mix_with'] %} MAKE_SIG_KEYMGMT_FUNCTIONS({{ classical_alg['name'] }}_{{variant['name']}}) {%- endfor -%} + {%- for composite_alg in variant['composite'] %} +MAKE_SIG_KEYMGMT_FUNCTIONS({{variant['name']}}_{{ composite_alg['name'] }}) + {%- endfor -%} {%- endfor %} {%- endfor %} {% for kem in config['kems'] %} diff --git a/oqs-template/oqsprov/oqs_prov.h/alg_functions.fragment b/oqs-template/oqsprov/oqs_prov.h/alg_functions.fragment index e18eb388..acc8e86c 100644 --- a/oqs-template/oqsprov/oqs_prov.h/alg_functions.fragment +++ b/oqs-template/oqsprov/oqs_prov.h/alg_functions.fragment @@ -4,6 +4,9 @@ extern const OSSL_DISPATCH oqs_{{ variant['name'] }}_keymgmt_functions[]; {%- for classical_alg in variant['mix_with'] -%} extern const OSSL_DISPATCH oqs_{{ classical_alg['name'] }}_{{ variant['name'] }}_keymgmt_functions[]; {%- endfor -%} + {%- for composite_alg in variant['composite'] -%} +extern const OSSL_DISPATCH oqs_{{ variant['name'] }}_{{ composite_alg['name'] }}_keymgmt_functions[]; + {%- endfor -%} {%- endfor %} {%- endfor %} {% for kem in config['kems'] %} diff --git a/oqs-template/oqsprov/oqs_prov.h/endecoder_functions.fragment b/oqs-template/oqsprov/oqs_prov.h/endecoder_functions.fragment index 43f1c3b0..85a71b8a 100644 --- a/oqs-template/oqsprov/oqs_prov.h/endecoder_functions.fragment +++ b/oqs-template/oqsprov/oqs_prov.h/endecoder_functions.fragment @@ -48,6 +48,17 @@ extern const OSSL_DISPATCH oqs_{{ classical_alg['name'] }}_{{ variant['name'] }} extern const OSSL_DISPATCH oqs_PrivateKeyInfo_der_to_{{ classical_alg['name'] }}_{{ variant['name'] }}_decoder_functions[]; extern const OSSL_DISPATCH oqs_SubjectPublicKeyInfo_der_to_{{ classical_alg['name'] }}_{{ variant['name'] }}_decoder_functions[]; {%- endfor -%} + {%- for composite_alg in variant['composite'] -%} +extern const OSSL_DISPATCH oqs_{{ variant['name'] }}_{{ composite_alg['name'] }}_to_PrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH oqs_{{ variant['name'] }}_{{ composite_alg['name'] }}_to_PrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH oqs_{{ variant['name'] }}_{{ composite_alg['name'] }}_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH oqs_{{ variant['name'] }}_{{ composite_alg['name'] }}_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH oqs_{{ variant['name'] }}_{{ composite_alg['name'] }}_to_SubjectPublicKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH oqs_{{ variant['name'] }}_{{ composite_alg['name'] }}_to_SubjectPublicKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH oqs_{{ variant['name'] }}_{{ composite_alg['name'] }}_to_text_encoder_functions[]; +extern const OSSL_DISPATCH oqs_PrivateKeyInfo_der_to_{{ variant['name'] }}_{{ composite_alg['name'] }}_decoder_functions[]; +extern const OSSL_DISPATCH oqs_SubjectPublicKeyInfo_der_to_{{ variant['name'] }}_{{ composite_alg['name'] }}_decoder_functions[]; + {%- endfor -%} {%- endfor %} {%- endfor %} diff --git a/oqs-template/oqsprov/oqsdecoders.inc/make.fragment b/oqs-template/oqsprov/oqsdecoders.inc/make.fragment index a2d28c45..8d1c26e7 100644 --- a/oqs-template/oqsprov/oqsdecoders.inc/make.fragment +++ b/oqs-template/oqsprov/oqsdecoders.inc/make.fragment @@ -22,6 +22,10 @@ DECODER_w_structure("{{ variant['name'] }}", der, SubjectPublicKeyInfo, {{ varia DECODER_w_structure("{{ classical_alg['name'] }}_{{ variant['name'] }}", der, PrivateKeyInfo, {{ classical_alg['name'] }}_{{ variant['name'] }}), DECODER_w_structure("{{ classical_alg['name'] }}_{{ variant['name'] }}", der, SubjectPublicKeyInfo, {{ classical_alg['name'] }}_{{ variant['name'] }}), {%- endfor %} + {%- for composite_alg in variant['composite'] -%} +DECODER_w_structure("{{ variant['name'] }}_{{ composite_alg['name'] }}", der, PrivateKeyInfo, {{ variant['name'] }}_{{ composite_alg['name'] }}), +DECODER_w_structure("{{ variant['name'] }}_{{ composite_alg['name'] }}", der, SubjectPublicKeyInfo, {{ variant['name'] }}_{{ composite_alg['name'] }}), + {%- endfor %} #endif {%- endfor %} {%- endfor %} diff --git a/oqs-template/oqsprov/oqsencoders.inc/make.fragment b/oqs-template/oqsprov/oqsencoders.inc/make.fragment index 90464d6d..06509616 100644 --- a/oqs-template/oqsprov/oqsencoders.inc/make.fragment +++ b/oqs-template/oqsprov/oqsencoders.inc/make.fragment @@ -43,6 +43,15 @@ ENCODER_w_structure("{{ classical_alg['name'] }}_{{ variant['name'] }}", {{ clas ENCODER_w_structure("{{ classical_alg['name'] }}_{{ variant['name'] }}", {{ classical_alg['name'] }}_{{ variant['name'] }}, pem, SubjectPublicKeyInfo), ENCODER_TEXT("{{ classical_alg['name'] }}_{{ variant['name'] }}", {{ classical_alg['name'] }}_{{ variant['name'] }}), {% endfor -%} +{% for composite_alg in variant['composite'] -%} +ENCODER_w_structure("{{ variant['name'] }}_{{ composite_alg['name'] }}", {{ variant['name'] }}_{{ composite_alg['name'] }}, der, PrivateKeyInfo), +ENCODER_w_structure("{{ variant['name'] }}_{{ composite_alg['name'] }}", {{ variant['name'] }}_{{ composite_alg['name'] }}, pem, PrivateKeyInfo), +ENCODER_w_structure("{{ variant['name'] }}_{{ composite_alg['name'] }}", {{ variant['name'] }}_{{ composite_alg['name'] }}, der, EncryptedPrivateKeyInfo), +ENCODER_w_structure("{{ variant['name'] }}_{{ composite_alg['name'] }}", {{ variant['name'] }}_{{ composite_alg['name'] }}, pem, EncryptedPrivateKeyInfo), +ENCODER_w_structure("{{ variant['name'] }}_{{ composite_alg['name'] }}", {{ variant['name'] }}_{{ composite_alg['name'] }}, der, SubjectPublicKeyInfo), +ENCODER_w_structure("{{ variant['name'] }}_{{ composite_alg['name'] }}", {{ variant['name'] }}_{{ composite_alg['name'] }}, pem, SubjectPublicKeyInfo), +ENCODER_TEXT("{{ variant['name'] }}_{{ composite_alg['name'] }}", {{ variant['name'] }}_{{ composite_alg['name'] }}), +{% endfor -%} #endif {%- endfor %} {%- endfor %} diff --git a/oqs-template/oqsprov/oqsprov.c/assign_sig_oids.fragment b/oqs-template/oqsprov/oqsprov.c/assign_sig_oids.fragment index bb0c6e00..21af9c85 100644 --- a/oqs-template/oqsprov/oqsprov.c/assign_sig_oids.fragment +++ b/oqs-template/oqsprov/oqsprov.c/assign_sig_oids.fragment @@ -11,6 +11,9 @@ {%- for variant in sig['variants'] %} {%- set count.val = count.val + 1 -%} {%- for classical_alg in variant['mix_with'] %} +{%- set count.val = count.val + 1 -%} + {%- endfor %} + {%- for composite_alg in variant['composite'] %} {%- set count.val = count.val + 1 -%} {%- endfor %} {%- endfor %} @@ -40,6 +43,9 @@ const char* oqs_oid_alg_list[OQS_OID_CNT] = {%- for classical_alg in variant['mix_with'] %} "{{ classical_alg['oid'] }}" , "{{ classical_alg['name'] }}_{{ variant['name'] }}", {%- endfor %} + {%- for composite_alg in variant['composite'] %} +"{{ composite_alg['oid'] }}" , "{{ variant['name'] }}_{{ composite_alg['name'] }}", + {%- endfor %} {%- endfor %} {%- endfor %} diff --git a/oqs-template/oqsprov/oqsprov.c/encoding_patching.fragment b/oqs-template/oqsprov/oqsprov.c/encoding_patching.fragment index 3531db2f..f629b840 100644 --- a/oqs-template/oqsprov/oqsprov.c/encoding_patching.fragment +++ b/oqs-template/oqsprov/oqsprov.c/encoding_patching.fragment @@ -9,6 +9,11 @@ if (getenv("OQS_ENCODING_{{ classical_alg['name']|upper }}_{{variant['name']|upper}}")) oqs_alg_encoding_list[{{ cnt.val }}] = getenv("OQS_ENCODING_{{ classical_alg['name']|upper }}_{{variant['name']|upper}}"); if (getenv("OQS_ENCODING_{{ classical_alg['name']|upper }}_{{variant['name']|upper}}_ALGNAME")) oqs_alg_encoding_list[{{ cnt.val + 1 }}] = getenv("OQS_ENCODING_{{ classical_alg['name']|upper }}_{{variant['name']|upper}}_ALGNAME"); {%- endfor %} + {%- for composite_alg in variant['composite'] %} + {%- set cnt.val = cnt.val + 2 %} + if (getenv("OQS_ENCODING_{{variant['name']|upper}}_{{ composite_alg['name']|upper }}")) oqs_alg_encoding_list[{{ cnt.val }}] = getenv("OQS_ENCODING_{{variant['name']|upper}}_{{ composite_alg['name']|upper }}"); + if (getenv("OQS_ENCODING_{{variant['name']|upper}}_{{ composite_alg['name']|upper }}_ALGNAME")) oqs_alg_encoding_list[{{ cnt.val + 1 }}] = getenv("OQS_ENCODING_{{variant['name']|upper}}_{{ composite_alg['name']|upper }}_ALGNAME"); + {%- endfor %} {%- endfor %} {%- endfor %} diff --git a/oqs-template/oqsprov/oqsprov.c/keymgmt_functions.fragment b/oqs-template/oqsprov/oqsprov.c/keymgmt_functions.fragment index ad49db2a..f98a4341 100644 --- a/oqs-template/oqsprov/oqsprov.c/keymgmt_functions.fragment +++ b/oqs-template/oqsprov/oqsprov.c/keymgmt_functions.fragment @@ -7,6 +7,9 @@ {%- for classical_alg in variant['mix_with'] %} SIGALG("{{ classical_alg['name'] }}_{{variant['name']}}", {{variant['security']}}, oqs_{{ classical_alg['name'] }}_{{ variant['name'] }}_keymgmt_functions), {%- endfor %} + {%- for composite_alg in variant['composite'] %} + SIGALG("{{variant['name']}}_{{ composite_alg['name'] }}", {{composite_alg['security']}}, oqs_{{variant['name']}}_{{ composite_alg['name'] }}_keymgmt_functions), + {%- endfor %} #endif {%- endfor %} {%- endfor %} diff --git a/oqs-template/oqsprov/oqsprov.c/sig_functions.fragment b/oqs-template/oqsprov/oqsprov.c/sig_functions.fragment index 1dbc8be9..92a5c0a4 100644 --- a/oqs-template/oqsprov/oqsprov.c/sig_functions.fragment +++ b/oqs-template/oqsprov/oqsprov.c/sig_functions.fragment @@ -5,6 +5,9 @@ {%- for classical_alg in variant['mix_with'] %} SIGALG("{{ classical_alg['name'] }}_{{variant['name']}}", {{variant['security']}}, oqs_signature_functions), {%- endfor %} + {%- for composite_alg in variant['composite'] %} + SIGALG("{{variant['name']}}_{{ composite_alg['name'] }}", {{composite_alg['security']}}, oqs_signature_functions), + {%- endfor %} #endif {%- endfor %} {%- endfor %} diff --git a/oqs-template/oqsprov/oqsprov_keys.c/oqsnames.fragment b/oqs-template/oqsprov/oqsprov_keys.c/oqsnames.fragment index c452b649..142cb2aa 100644 --- a/oqs-template/oqsprov/oqsprov_keys.c/oqsnames.fragment +++ b/oqs-template/oqsprov/oqsprov_keys.c/oqsnames.fragment @@ -15,6 +15,9 @@ {%- for classical_alg in variant['mix_with'] %} {%- set count.val = count.val + 1 -%} {%- endfor -%} +{%- for composite_alg in variant['composite'] %} +{%- set count.val = count.val + 1 -%} +{%- endfor -%} {%- endfor -%} {%- endfor %} @@ -41,6 +44,9 @@ static oqs_nid_name_t nid_names[NID_TABLE_LEN] = { {%- for classical_alg in variant['mix_with'] %} { 0, "{{ classical_alg['name'] }}_{{variant['name']}}", {{variant['oqs_meth']}}, KEY_TYPE_HYB_SIG, {{variant['security']}} }, {%- endfor %} + {%- for composite_alg in variant['composite'] %} + { 0, "{{variant['name']}}_{{ composite_alg['name'] }}", {{variant['oqs_meth']}}, KEY_TYPE_CMP_SIG, {{composite_alg['security']}} }, + {%- endfor %} {%- endfor %} {%- endfor %} diff --git a/oqs-template/scripts/common.py/sig_algs.fragment b/oqs-template/scripts/common.py/sig_algs.fragment index 2541638a..d3839008 100644 --- a/oqs-template/scripts/common.py/sig_algs.fragment +++ b/oqs-template/scripts/common.py/sig_algs.fragment @@ -9,4 +9,10 @@ '{{ classical_alg['name'] }}_{{ variant['name'] }}', {%- endfor -%} {%- endfor %} {%- endfor %} - + # post-quantum + classical signatures (COMPOSITE) + {% for sig in config['sigs'] -%} + {%- for variant in sig['variants'] -%} + {%- for composite_alg in variant['composite'] -%} + '{{ variant['name'] }}_{{ composite_alg['name'] }}', + {%- endfor -%} + {%- endfor %} {%- endfor %} diff --git a/oqsprov/oqs_decode_der2key.c b/oqsprov/oqs_decode_der2key.c index 8a0629c8..180dc7f4 100644 --- a/oqsprov/oqs_decode_der2key.c +++ b/oqsprov/oqs_decode_der2key.c @@ -667,14 +667,50 @@ MAKE_DECODER(, "p256_dilithium2", p256_dilithium2, oqsx, SubjectPublicKeyInfo); MAKE_DECODER(, "rsa3072_dilithium2", rsa3072_dilithium2, oqsx, PrivateKeyInfo); MAKE_DECODER(, "rsa3072_dilithium2", rsa3072_dilithium2, oqsx, SubjectPublicKeyInfo); +MAKE_DECODER(, "dilithium2_pss2048", dilithium2_pss2048, oqsx, PrivateKeyInfo); +MAKE_DECODER(, "dilithium2_pss2048", dilithium2_pss2048, oqsx, + SubjectPublicKeyInfo); +MAKE_DECODER(, "dilithium2_rsa2048", dilithium2_rsa2048, oqsx, PrivateKeyInfo); +MAKE_DECODER(, "dilithium2_rsa2048", dilithium2_rsa2048, oqsx, + SubjectPublicKeyInfo); +MAKE_DECODER(, "dilithium2_ed25519", dilithium2_ed25519, oqsx, PrivateKeyInfo); +MAKE_DECODER(, "dilithium2_ed25519", dilithium2_ed25519, oqsx, + SubjectPublicKeyInfo); +MAKE_DECODER(, "dilithium2_p256", dilithium2_p256, oqsx, PrivateKeyInfo); +MAKE_DECODER(, "dilithium2_p256", dilithium2_p256, oqsx, SubjectPublicKeyInfo); +MAKE_DECODER(, "dilithium2_bp256", dilithium2_bp256, oqsx, PrivateKeyInfo); +MAKE_DECODER(, "dilithium2_bp256", dilithium2_bp256, oqsx, + SubjectPublicKeyInfo); MAKE_DECODER(, "dilithium3", dilithium3, oqsx, PrivateKeyInfo); MAKE_DECODER(, "dilithium3", dilithium3, oqsx, SubjectPublicKeyInfo); MAKE_DECODER(, "p384_dilithium3", p384_dilithium3, oqsx, PrivateKeyInfo); MAKE_DECODER(, "p384_dilithium3", p384_dilithium3, oqsx, SubjectPublicKeyInfo); +MAKE_DECODER(, "dilithium3_pss3072", dilithium3_pss3072, oqsx, PrivateKeyInfo); +MAKE_DECODER(, "dilithium3_pss3072", dilithium3_pss3072, oqsx, + SubjectPublicKeyInfo); +MAKE_DECODER(, "dilithium3_rsa3072", dilithium3_rsa3072, oqsx, PrivateKeyInfo); +MAKE_DECODER(, "dilithium3_rsa3072", dilithium3_rsa3072, oqsx, + SubjectPublicKeyInfo); +MAKE_DECODER(, "dilithium3_p256", dilithium3_p256, oqsx, PrivateKeyInfo); +MAKE_DECODER(, "dilithium3_p256", dilithium3_p256, oqsx, SubjectPublicKeyInfo); +MAKE_DECODER(, "dilithium3_bp256", dilithium3_bp256, oqsx, PrivateKeyInfo); +MAKE_DECODER(, "dilithium3_bp256", dilithium3_bp256, oqsx, + SubjectPublicKeyInfo); +MAKE_DECODER(, "dilithium3_ed25519", dilithium3_ed25519, oqsx, PrivateKeyInfo); +MAKE_DECODER(, "dilithium3_ed25519", dilithium3_ed25519, oqsx, + SubjectPublicKeyInfo); MAKE_DECODER(, "dilithium5", dilithium5, oqsx, PrivateKeyInfo); MAKE_DECODER(, "dilithium5", dilithium5, oqsx, SubjectPublicKeyInfo); MAKE_DECODER(, "p521_dilithium5", p521_dilithium5, oqsx, PrivateKeyInfo); MAKE_DECODER(, "p521_dilithium5", p521_dilithium5, oqsx, SubjectPublicKeyInfo); +MAKE_DECODER(, "dilithium5_p384", dilithium5_p384, oqsx, PrivateKeyInfo); +MAKE_DECODER(, "dilithium5_p384", dilithium5_p384, oqsx, SubjectPublicKeyInfo); +MAKE_DECODER(, "dilithium5_bp384", dilithium5_bp384, oqsx, PrivateKeyInfo); +MAKE_DECODER(, "dilithium5_bp384", dilithium5_bp384, oqsx, + SubjectPublicKeyInfo); +MAKE_DECODER(, "dilithium5_ed448", dilithium5_ed448, oqsx, PrivateKeyInfo); +MAKE_DECODER(, "dilithium5_ed448", dilithium5_ed448, oqsx, + SubjectPublicKeyInfo); MAKE_DECODER(, "falcon512", falcon512, oqsx, PrivateKeyInfo); MAKE_DECODER(, "falcon512", falcon512, oqsx, SubjectPublicKeyInfo); MAKE_DECODER(, "p256_falcon512", p256_falcon512, oqsx, PrivateKeyInfo); @@ -682,6 +718,13 @@ MAKE_DECODER(, "p256_falcon512", p256_falcon512, oqsx, SubjectPublicKeyInfo); MAKE_DECODER(, "rsa3072_falcon512", rsa3072_falcon512, oqsx, PrivateKeyInfo); MAKE_DECODER(, "rsa3072_falcon512", rsa3072_falcon512, oqsx, SubjectPublicKeyInfo); +MAKE_DECODER(, "falcon512_p256", falcon512_p256, oqsx, PrivateKeyInfo); +MAKE_DECODER(, "falcon512_p256", falcon512_p256, oqsx, SubjectPublicKeyInfo); +MAKE_DECODER(, "falcon512_bp256", falcon512_bp256, oqsx, PrivateKeyInfo); +MAKE_DECODER(, "falcon512_bp256", falcon512_bp256, oqsx, SubjectPublicKeyInfo); +MAKE_DECODER(, "falcon512_ed25519", falcon512_ed25519, oqsx, PrivateKeyInfo); +MAKE_DECODER(, "falcon512_ed25519", falcon512_ed25519, oqsx, + SubjectPublicKeyInfo); MAKE_DECODER(, "falcon1024", falcon1024, oqsx, PrivateKeyInfo); MAKE_DECODER(, "falcon1024", falcon1024, oqsx, SubjectPublicKeyInfo); MAKE_DECODER(, "p521_falcon1024", p521_falcon1024, oqsx, PrivateKeyInfo); @@ -730,48 +773,4 @@ MAKE_DECODER(, "rsa3072_sphincsshake128fsimple", rsa3072_sphincsshake128fsimple, oqsx, PrivateKeyInfo); MAKE_DECODER(, "rsa3072_sphincsshake128fsimple", rsa3072_sphincsshake128fsimple, oqsx, SubjectPublicKeyInfo); - -MAKE_DECODER(, "dilithium3_rsa3072", dilithium3_rsa3072, oqsx, PrivateKeyInfo); -MAKE_DECODER(, "dilithium3_rsa3072", dilithium3_rsa3072, oqsx, - SubjectPublicKeyInfo); -MAKE_DECODER(, "dilithium3_p256", dilithium3_p256, oqsx, PrivateKeyInfo); -MAKE_DECODER(, "dilithium3_p256", dilithium3_p256, oqsx, SubjectPublicKeyInfo); -MAKE_DECODER(, "falcon512_p256", falcon512_p256, oqsx, PrivateKeyInfo); -MAKE_DECODER(, "falcon512_p256", falcon512_p256, oqsx, SubjectPublicKeyInfo); -MAKE_DECODER(, "dilithium5_p384", dilithium5_p384, oqsx, PrivateKeyInfo); -MAKE_DECODER(, "dilithium5_p384", dilithium5_p384, oqsx, SubjectPublicKeyInfo); -MAKE_DECODER(, "dilithium3_bp256", dilithium3_bp256, oqsx, PrivateKeyInfo); -MAKE_DECODER(, "dilithium3_bp256", dilithium3_bp256, oqsx, - SubjectPublicKeyInfo); -MAKE_DECODER(, "dilithium3_ed25519", dilithium3_ed25519, oqsx, PrivateKeyInfo); -MAKE_DECODER(, "dilithium3_ed25519", dilithium3_ed25519, oqsx, - SubjectPublicKeyInfo); -MAKE_DECODER(, "dilithium5_bp384", dilithium5_bp384, oqsx, PrivateKeyInfo); -MAKE_DECODER(, "dilithium5_bp384", dilithium5_bp384, oqsx, - SubjectPublicKeyInfo); -MAKE_DECODER(, "dilithium5_ed448", dilithium5_ed448, oqsx, PrivateKeyInfo); -MAKE_DECODER(, "dilithium5_ed448", dilithium5_ed448, oqsx, - SubjectPublicKeyInfo); -MAKE_DECODER(, "falcon512_bp256", falcon512_bp256, oqsx, PrivateKeyInfo); -MAKE_DECODER(, "falcon512_bp256", falcon512_bp256, oqsx, SubjectPublicKeyInfo); -MAKE_DECODER(, "falcon512_ed25519", falcon512_ed25519, oqsx, PrivateKeyInfo); -MAKE_DECODER(, "falcon512_ed25519", falcon512_ed25519, oqsx, - SubjectPublicKeyInfo); -MAKE_DECODER(, "dilithium3_pss3072", dilithium3_pss3072, oqsx, PrivateKeyInfo); -MAKE_DECODER(, "dilithium3_pss3072", dilithium3_pss3072, oqsx, - SubjectPublicKeyInfo); -MAKE_DECODER(, "dilithium2_pss2048", dilithium2_pss2048, oqsx, PrivateKeyInfo); -MAKE_DECODER(, "dilithium2_pss2048", dilithium2_pss2048, oqsx, - SubjectPublicKeyInfo); -MAKE_DECODER(, "dilithium2_rsa2048", dilithium2_rsa2048, oqsx, PrivateKeyInfo); -MAKE_DECODER(, "dilithium2_rsa2048", dilithium2_rsa2048, oqsx, - SubjectPublicKeyInfo); -MAKE_DECODER(, "dilithium2_ed25519", dilithium2_ed25519, oqsx, PrivateKeyInfo); -MAKE_DECODER(, "dilithium2_ed25519", dilithium2_ed25519, oqsx, - SubjectPublicKeyInfo); -MAKE_DECODER(, "dilithium2_p256", dilithium2_p256, oqsx, PrivateKeyInfo); -MAKE_DECODER(, "dilithium2_p256", dilithium2_p256, oqsx, SubjectPublicKeyInfo); -MAKE_DECODER(, "dilithium2_bp256", dilithium2_bp256, oqsx, PrivateKeyInfo); -MAKE_DECODER(, "dilithium2_bp256", dilithium2_bp256, oqsx, - SubjectPublicKeyInfo); ///// OQS_TEMPLATE_FRAGMENT_DECODER_MAKE_END diff --git a/oqsprov/oqs_encode_key2any.c b/oqsprov/oqs_encode_key2any.c index 6d424017..a54834eb 100644 --- a/oqsprov/oqs_encode_key2any.c +++ b/oqsprov/oqs_encode_key2any.c @@ -966,18 +966,57 @@ static int oqsx_pki_priv_to_der(const void *vxkey, unsigned char **pder) #define rsa3072_dilithium2_evp_type 0 #define rsa3072_dilithium2_input_type "rsa3072_dilithium2" #define rsa3072_dilithium2_pem_type "rsa3072_dilithium2" +#define dilithium2_pss2048_evp_type 0 +#define dilithium2_pss2048_input_type "dilithium2_pss2048" +#define dilithium2_pss2048_pem_type "dilithium2_pss2048" +#define dilithium2_rsa2048_evp_type 0 +#define dilithium2_rsa2048_input_type "dilithium2_rsa2048" +#define dilithium2_rsa2048_pem_type "dilithium2_rsa2048" +#define dilithium2_ed25519_evp_type 0 +#define dilithium2_ed25519_input_type "dilithium2_ed25519" +#define dilithium2_ed25519_pem_type "dilithium2_ed25519" +#define dilithium2_p256_evp_type 0 +#define dilithium2_p256_input_type "dilithium2_p256" +#define dilithium2_p256_pem_type "dilithium2_p256" +#define dilithium2_bp256_evp_type 0 +#define dilithium2_bp256_input_type "dilithium2_bp256" +#define dilithium2_bp256_pem_type "dilithium2_bp256" #define dilithium3_evp_type 0 #define dilithium3_input_type "dilithium3" #define dilithium3_pem_type "dilithium3" #define p384_dilithium3_evp_type 0 #define p384_dilithium3_input_type "p384_dilithium3" #define p384_dilithium3_pem_type "p384_dilithium3" +#define dilithium3_pss3072_evp_type 0 +#define dilithium3_pss3072_input_type "dilithium3_pss3072" +#define dilithium3_pss3072_pem_type "dilithium3_pss3072" +#define dilithium3_rsa3072_evp_type 0 +#define dilithium3_rsa3072_input_type "dilithium3_rsa3072" +#define dilithium3_rsa3072_pem_type "dilithium3_rsa3072" +#define dilithium3_p256_evp_type 0 +#define dilithium3_p256_input_type "dilithium3_p256" +#define dilithium3_p256_pem_type "dilithium3_p256" +#define dilithium3_bp256_evp_type 0 +#define dilithium3_bp256_input_type "dilithium3_bp256" +#define dilithium3_bp256_pem_type "dilithium3_bp256" +#define dilithium3_ed25519_evp_type 0 +#define dilithium3_ed25519_input_type "dilithium3_ed25519" +#define dilithium3_ed25519_pem_type "dilithium3_ed25519" #define dilithium5_evp_type 0 #define dilithium5_input_type "dilithium5" #define dilithium5_pem_type "dilithium5" #define p521_dilithium5_evp_type 0 #define p521_dilithium5_input_type "p521_dilithium5" #define p521_dilithium5_pem_type "p521_dilithium5" +#define dilithium5_p384_evp_type 0 +#define dilithium5_p384_input_type "dilithium5_p384" +#define dilithium5_p384_pem_type "dilithium5_p384" +#define dilithium5_bp384_evp_type 0 +#define dilithium5_bp384_input_type "dilithium5_bp384" +#define dilithium5_bp384_pem_type "dilithium5_bp384" +#define dilithium5_ed448_evp_type 0 +#define dilithium5_ed448_input_type "dilithium5_ed448" +#define dilithium5_ed448_pem_type "dilithium5_ed448" #define falcon512_evp_type 0 #define falcon512_input_type "falcon512" #define falcon512_pem_type "falcon512" @@ -987,6 +1026,15 @@ static int oqsx_pki_priv_to_der(const void *vxkey, unsigned char **pder) #define rsa3072_falcon512_evp_type 0 #define rsa3072_falcon512_input_type "rsa3072_falcon512" #define rsa3072_falcon512_pem_type "rsa3072_falcon512" +#define falcon512_p256_evp_type 0 +#define falcon512_p256_input_type "falcon512_p256" +#define falcon512_p256_pem_type "falcon512_p256" +#define falcon512_bp256_evp_type 0 +#define falcon512_bp256_input_type "falcon512_bp256" +#define falcon512_bp256_pem_type "falcon512_bp256" +#define falcon512_ed25519_evp_type 0 +#define falcon512_ed25519_input_type "falcon512_ed25519" +#define falcon512_ed25519_pem_type "falcon512_ed25519" #define falcon1024_evp_type 0 #define falcon1024_input_type "falcon1024" #define falcon1024_pem_type "falcon1024" @@ -1027,54 +1075,6 @@ static int oqsx_pki_priv_to_der(const void *vxkey, unsigned char **pder) #define rsa3072_sphincsshake128fsimple_input_type \ "rsa3072_sphincsshake128fsimple" #define rsa3072_sphincsshake128fsimple_pem_type "rsa3072_sphincsshake128fsimple" -#define dilithium2_pss2048_evp_type 0 -#define dilithium2_pss2048_input_type "dilithium2_pss2048" -#define dilithium2_pss2048_pem_type "dilithium2_pss2048" -#define dilithium2_rsa2048_evp_type 0 -#define dilithium2_rsa2048_input_type "dilithium2_rsa2048" -#define dilithium2_rsa2048_pem_type "dilithium2_rsa2048" -#define dilithium2_ed25519_evp_type 0 -#define dilithium2_ed25519_input_type "dilithium2_ed25519" -#define dilithium2_ed25519_pem_type "dilithium2_ed25519" -#define dilithium2_p256_evp_type 0 -#define dilithium2_p256_input_type "dilithium2_p256" -#define dilithium2_p256_pem_type "dilithium2_p256" -#define dilithium2_bp256_evp_type 0 -#define dilithium2_bp256_input_type "dilithium2_bp256" -#define dilithium2_bp256_pem_type "dilithium2_bp256" -#define dilithium3_rsa2048_evp_type 0 -#define dilithium3_rsa3072_input_type "dilithium3_rsa3072" -#define dilithium3_rsa3072_pem_type "dilithium3_rsa3072" -#define dilithium3_p256_evp_type 0 -#define dilithium3_p256_input_type "dilithium3_p256" -#define dilithium3_p256_pem_type "dilithium3_p256" -#define falcon512_p256_evp_type 0 -#define falcon512_p256_input_type "falcon512_p256" -#define falcon512_p256_pem_type "falcon512_p256" -#define dilithium5_p384_evp_type 0 -#define dilithium5_p384_input_type "dilithium5_p384" -#define dilithium5_p384_pem_type "dilithium5_p384" -#define dilithium3_bp256_evp_type 0 -#define dilithium3_bp256_input_type "dilithium3_bp256" -#define dilithium3_bp256_pem_type "dilithium3_bp256" -#define dilithium3_ed25519_evp_type 0 -#define dilithium3_ed25519_input_type "dilithium3_ed25519" -#define dilithium3_ed25519_pem_type "dilithium3_ed25519" -#define dilithium3_pss3072_evp_type 0 -#define dilithium3_pss3072_input_type "dilithium3_pss3072" -#define dilithium3_pss3072_pem_type "dilithium3_pss3072" -#define dilithium5_bp384_evp_type 0 -#define dilithium5_bp384_input_type "dilithium5_bp384" -#define dilithium5_bp384_pem_type "dilithium5_bp384" -#define dilithium5_ed448_evp_type 0 -#define dilithium5_ed448_input_type "dilithium5_ed448" -#define dilithium5_ed448_pem_type "dilithium5_ed448" -#define falcon512_bp256_evp_type 0 -#define falcon512_bp256_input_type "falcon512_bp256" -#define falcon512_bp256_pem_type "falcon512_bp256" -#define falcon512_ed25519_evp_type 0 -#define falcon512_ed25519_input_type "falcon512_ed25519" -#define falcon512_ed25519_pem_type "falcon512_ed25519" ///// OQS_TEMPLATE_FRAGMENT_ENCODER_DEFINES_END /* ---------------------------------------------------------------------- */ @@ -2055,6 +2055,41 @@ MAKE_ENCODER(, rsa3072_dilithium2, oqsx, PrivateKeyInfo, pem); MAKE_ENCODER(, rsa3072_dilithium2, oqsx, SubjectPublicKeyInfo, der); MAKE_ENCODER(, rsa3072_dilithium2, oqsx, SubjectPublicKeyInfo, pem); MAKE_TEXT_ENCODER(, rsa3072_dilithium2); +MAKE_ENCODER(, dilithium2_pss2048, oqsx, EncryptedPrivateKeyInfo, der); +MAKE_ENCODER(, dilithium2_pss2048, oqsx, EncryptedPrivateKeyInfo, pem); +MAKE_ENCODER(, dilithium2_pss2048, oqsx, PrivateKeyInfo, der); +MAKE_ENCODER(, dilithium2_pss2048, oqsx, PrivateKeyInfo, pem); +MAKE_ENCODER(, dilithium2_pss2048, oqsx, SubjectPublicKeyInfo, der); +MAKE_ENCODER(, dilithium2_pss2048, oqsx, SubjectPublicKeyInfo, pem); +MAKE_TEXT_ENCODER(, dilithium2_pss2048); +MAKE_ENCODER(, dilithium2_rsa2048, oqsx, EncryptedPrivateKeyInfo, der); +MAKE_ENCODER(, dilithium2_rsa2048, oqsx, EncryptedPrivateKeyInfo, pem); +MAKE_ENCODER(, dilithium2_rsa2048, oqsx, PrivateKeyInfo, der); +MAKE_ENCODER(, dilithium2_rsa2048, oqsx, PrivateKeyInfo, pem); +MAKE_ENCODER(, dilithium2_rsa2048, oqsx, SubjectPublicKeyInfo, der); +MAKE_ENCODER(, dilithium2_rsa2048, oqsx, SubjectPublicKeyInfo, pem); +MAKE_TEXT_ENCODER(, dilithium2_rsa2048); +MAKE_ENCODER(, dilithium2_ed25519, oqsx, EncryptedPrivateKeyInfo, der); +MAKE_ENCODER(, dilithium2_ed25519, oqsx, EncryptedPrivateKeyInfo, pem); +MAKE_ENCODER(, dilithium2_ed25519, oqsx, PrivateKeyInfo, der); +MAKE_ENCODER(, dilithium2_ed25519, oqsx, PrivateKeyInfo, pem); +MAKE_ENCODER(, dilithium2_ed25519, oqsx, SubjectPublicKeyInfo, der); +MAKE_ENCODER(, dilithium2_ed25519, oqsx, SubjectPublicKeyInfo, pem); +MAKE_TEXT_ENCODER(, dilithium2_ed25519); +MAKE_ENCODER(, dilithium2_p256, oqsx, EncryptedPrivateKeyInfo, der); +MAKE_ENCODER(, dilithium2_p256, oqsx, EncryptedPrivateKeyInfo, pem); +MAKE_ENCODER(, dilithium2_p256, oqsx, PrivateKeyInfo, der); +MAKE_ENCODER(, dilithium2_p256, oqsx, PrivateKeyInfo, pem); +MAKE_ENCODER(, dilithium2_p256, oqsx, SubjectPublicKeyInfo, der); +MAKE_ENCODER(, dilithium2_p256, oqsx, SubjectPublicKeyInfo, pem); +MAKE_TEXT_ENCODER(, dilithium2_p256); +MAKE_ENCODER(, dilithium2_bp256, oqsx, EncryptedPrivateKeyInfo, der); +MAKE_ENCODER(, dilithium2_bp256, oqsx, EncryptedPrivateKeyInfo, pem); +MAKE_ENCODER(, dilithium2_bp256, oqsx, PrivateKeyInfo, der); +MAKE_ENCODER(, dilithium2_bp256, oqsx, PrivateKeyInfo, pem); +MAKE_ENCODER(, dilithium2_bp256, oqsx, SubjectPublicKeyInfo, der); +MAKE_ENCODER(, dilithium2_bp256, oqsx, SubjectPublicKeyInfo, pem); +MAKE_TEXT_ENCODER(, dilithium2_bp256); MAKE_ENCODER(, dilithium3, oqsx, EncryptedPrivateKeyInfo, der); MAKE_ENCODER(, dilithium3, oqsx, EncryptedPrivateKeyInfo, pem); MAKE_ENCODER(, dilithium3, oqsx, PrivateKeyInfo, der); @@ -2069,6 +2104,41 @@ MAKE_ENCODER(, p384_dilithium3, oqsx, PrivateKeyInfo, pem); MAKE_ENCODER(, p384_dilithium3, oqsx, SubjectPublicKeyInfo, der); MAKE_ENCODER(, p384_dilithium3, oqsx, SubjectPublicKeyInfo, pem); MAKE_TEXT_ENCODER(, p384_dilithium3); +MAKE_ENCODER(, dilithium3_pss3072, oqsx, EncryptedPrivateKeyInfo, der); +MAKE_ENCODER(, dilithium3_pss3072, oqsx, EncryptedPrivateKeyInfo, pem); +MAKE_ENCODER(, dilithium3_pss3072, oqsx, PrivateKeyInfo, der); +MAKE_ENCODER(, dilithium3_pss3072, oqsx, PrivateKeyInfo, pem); +MAKE_ENCODER(, dilithium3_pss3072, oqsx, SubjectPublicKeyInfo, der); +MAKE_ENCODER(, dilithium3_pss3072, oqsx, SubjectPublicKeyInfo, pem); +MAKE_TEXT_ENCODER(, dilithium3_pss3072); +MAKE_ENCODER(, dilithium3_rsa3072, oqsx, EncryptedPrivateKeyInfo, der); +MAKE_ENCODER(, dilithium3_rsa3072, oqsx, EncryptedPrivateKeyInfo, pem); +MAKE_ENCODER(, dilithium3_rsa3072, oqsx, PrivateKeyInfo, der); +MAKE_ENCODER(, dilithium3_rsa3072, oqsx, PrivateKeyInfo, pem); +MAKE_ENCODER(, dilithium3_rsa3072, oqsx, SubjectPublicKeyInfo, der); +MAKE_ENCODER(, dilithium3_rsa3072, oqsx, SubjectPublicKeyInfo, pem); +MAKE_TEXT_ENCODER(, dilithium3_rsa3072); +MAKE_ENCODER(, dilithium3_p256, oqsx, EncryptedPrivateKeyInfo, der); +MAKE_ENCODER(, dilithium3_p256, oqsx, EncryptedPrivateKeyInfo, pem); +MAKE_ENCODER(, dilithium3_p256, oqsx, PrivateKeyInfo, der); +MAKE_ENCODER(, dilithium3_p256, oqsx, PrivateKeyInfo, pem); +MAKE_ENCODER(, dilithium3_p256, oqsx, SubjectPublicKeyInfo, der); +MAKE_ENCODER(, dilithium3_p256, oqsx, SubjectPublicKeyInfo, pem); +MAKE_TEXT_ENCODER(, dilithium3_p256); +MAKE_ENCODER(, dilithium3_bp256, oqsx, EncryptedPrivateKeyInfo, der); +MAKE_ENCODER(, dilithium3_bp256, oqsx, EncryptedPrivateKeyInfo, pem); +MAKE_ENCODER(, dilithium3_bp256, oqsx, PrivateKeyInfo, der); +MAKE_ENCODER(, dilithium3_bp256, oqsx, PrivateKeyInfo, pem); +MAKE_ENCODER(, dilithium3_bp256, oqsx, SubjectPublicKeyInfo, der); +MAKE_ENCODER(, dilithium3_bp256, oqsx, SubjectPublicKeyInfo, pem); +MAKE_TEXT_ENCODER(, dilithium3_bp256); +MAKE_ENCODER(, dilithium3_ed25519, oqsx, EncryptedPrivateKeyInfo, der); +MAKE_ENCODER(, dilithium3_ed25519, oqsx, EncryptedPrivateKeyInfo, pem); +MAKE_ENCODER(, dilithium3_ed25519, oqsx, PrivateKeyInfo, der); +MAKE_ENCODER(, dilithium3_ed25519, oqsx, PrivateKeyInfo, pem); +MAKE_ENCODER(, dilithium3_ed25519, oqsx, SubjectPublicKeyInfo, der); +MAKE_ENCODER(, dilithium3_ed25519, oqsx, SubjectPublicKeyInfo, pem); +MAKE_TEXT_ENCODER(, dilithium3_ed25519); MAKE_ENCODER(, dilithium5, oqsx, EncryptedPrivateKeyInfo, der); MAKE_ENCODER(, dilithium5, oqsx, EncryptedPrivateKeyInfo, pem); MAKE_ENCODER(, dilithium5, oqsx, PrivateKeyInfo, der); @@ -2083,6 +2153,27 @@ MAKE_ENCODER(, p521_dilithium5, oqsx, PrivateKeyInfo, pem); MAKE_ENCODER(, p521_dilithium5, oqsx, SubjectPublicKeyInfo, der); MAKE_ENCODER(, p521_dilithium5, oqsx, SubjectPublicKeyInfo, pem); MAKE_TEXT_ENCODER(, p521_dilithium5); +MAKE_ENCODER(, dilithium5_p384, oqsx, EncryptedPrivateKeyInfo, der); +MAKE_ENCODER(, dilithium5_p384, oqsx, EncryptedPrivateKeyInfo, pem); +MAKE_ENCODER(, dilithium5_p384, oqsx, PrivateKeyInfo, der); +MAKE_ENCODER(, dilithium5_p384, oqsx, PrivateKeyInfo, pem); +MAKE_ENCODER(, dilithium5_p384, oqsx, SubjectPublicKeyInfo, der); +MAKE_ENCODER(, dilithium5_p384, oqsx, SubjectPublicKeyInfo, pem); +MAKE_TEXT_ENCODER(, dilithium5_p384); +MAKE_ENCODER(, dilithium5_bp384, oqsx, EncryptedPrivateKeyInfo, der); +MAKE_ENCODER(, dilithium5_bp384, oqsx, EncryptedPrivateKeyInfo, pem); +MAKE_ENCODER(, dilithium5_bp384, oqsx, PrivateKeyInfo, der); +MAKE_ENCODER(, dilithium5_bp384, oqsx, PrivateKeyInfo, pem); +MAKE_ENCODER(, dilithium5_bp384, oqsx, SubjectPublicKeyInfo, der); +MAKE_ENCODER(, dilithium5_bp384, oqsx, SubjectPublicKeyInfo, pem); +MAKE_TEXT_ENCODER(, dilithium5_bp384); +MAKE_ENCODER(, dilithium5_ed448, oqsx, EncryptedPrivateKeyInfo, der); +MAKE_ENCODER(, dilithium5_ed448, oqsx, EncryptedPrivateKeyInfo, pem); +MAKE_ENCODER(, dilithium5_ed448, oqsx, PrivateKeyInfo, der); +MAKE_ENCODER(, dilithium5_ed448, oqsx, PrivateKeyInfo, pem); +MAKE_ENCODER(, dilithium5_ed448, oqsx, SubjectPublicKeyInfo, der); +MAKE_ENCODER(, dilithium5_ed448, oqsx, SubjectPublicKeyInfo, pem); +MAKE_TEXT_ENCODER(, dilithium5_ed448); MAKE_ENCODER(, falcon512, oqsx, EncryptedPrivateKeyInfo, der); MAKE_ENCODER(, falcon512, oqsx, EncryptedPrivateKeyInfo, pem); MAKE_ENCODER(, falcon512, oqsx, PrivateKeyInfo, der); @@ -2104,6 +2195,27 @@ MAKE_ENCODER(, rsa3072_falcon512, oqsx, PrivateKeyInfo, pem); MAKE_ENCODER(, rsa3072_falcon512, oqsx, SubjectPublicKeyInfo, der); MAKE_ENCODER(, rsa3072_falcon512, oqsx, SubjectPublicKeyInfo, pem); MAKE_TEXT_ENCODER(, rsa3072_falcon512); +MAKE_ENCODER(, falcon512_p256, oqsx, EncryptedPrivateKeyInfo, der); +MAKE_ENCODER(, falcon512_p256, oqsx, EncryptedPrivateKeyInfo, pem); +MAKE_ENCODER(, falcon512_p256, oqsx, PrivateKeyInfo, der); +MAKE_ENCODER(, falcon512_p256, oqsx, PrivateKeyInfo, pem); +MAKE_ENCODER(, falcon512_p256, oqsx, SubjectPublicKeyInfo, der); +MAKE_ENCODER(, falcon512_p256, oqsx, SubjectPublicKeyInfo, pem); +MAKE_TEXT_ENCODER(, falcon512_p256); +MAKE_ENCODER(, falcon512_bp256, oqsx, EncryptedPrivateKeyInfo, der); +MAKE_ENCODER(, falcon512_bp256, oqsx, EncryptedPrivateKeyInfo, pem); +MAKE_ENCODER(, falcon512_bp256, oqsx, PrivateKeyInfo, der); +MAKE_ENCODER(, falcon512_bp256, oqsx, PrivateKeyInfo, pem); +MAKE_ENCODER(, falcon512_bp256, oqsx, SubjectPublicKeyInfo, der); +MAKE_ENCODER(, falcon512_bp256, oqsx, SubjectPublicKeyInfo, pem); +MAKE_TEXT_ENCODER(, falcon512_bp256); +MAKE_ENCODER(, falcon512_ed25519, oqsx, EncryptedPrivateKeyInfo, der); +MAKE_ENCODER(, falcon512_ed25519, oqsx, EncryptedPrivateKeyInfo, pem); +MAKE_ENCODER(, falcon512_ed25519, oqsx, PrivateKeyInfo, der); +MAKE_ENCODER(, falcon512_ed25519, oqsx, PrivateKeyInfo, pem); +MAKE_ENCODER(, falcon512_ed25519, oqsx, SubjectPublicKeyInfo, der); +MAKE_ENCODER(, falcon512_ed25519, oqsx, SubjectPublicKeyInfo, pem); +MAKE_TEXT_ENCODER(, falcon512_ed25519); MAKE_ENCODER(, falcon1024, oqsx, EncryptedPrivateKeyInfo, der); MAKE_ENCODER(, falcon1024, oqsx, EncryptedPrivateKeyInfo, pem); MAKE_ENCODER(, falcon1024, oqsx, PrivateKeyInfo, der); @@ -2201,116 +2313,4 @@ MAKE_ENCODER(, rsa3072_sphincsshake128fsimple, oqsx, PrivateKeyInfo, pem); MAKE_ENCODER(, rsa3072_sphincsshake128fsimple, oqsx, SubjectPublicKeyInfo, der); MAKE_ENCODER(, rsa3072_sphincsshake128fsimple, oqsx, SubjectPublicKeyInfo, pem); MAKE_TEXT_ENCODER(, rsa3072_sphincsshake128fsimple); -MAKE_ENCODER(, dilithium3_rsa3072, oqsx, EncryptedPrivateKeyInfo, der); -MAKE_ENCODER(, dilithium3_rsa3072, oqsx, EncryptedPrivateKeyInfo, pem); -MAKE_ENCODER(, dilithium3_rsa3072, oqsx, PrivateKeyInfo, der); -MAKE_ENCODER(, dilithium3_rsa3072, oqsx, PrivateKeyInfo, pem); -MAKE_ENCODER(, dilithium3_rsa3072, oqsx, SubjectPublicKeyInfo, der); -MAKE_ENCODER(, dilithium3_rsa3072, oqsx, SubjectPublicKeyInfo, pem); -MAKE_TEXT_ENCODER(, dilithium3_rsa3072); -MAKE_ENCODER(, dilithium3_p256, oqsx, EncryptedPrivateKeyInfo, der); -MAKE_ENCODER(, dilithium3_p256, oqsx, EncryptedPrivateKeyInfo, pem); -MAKE_ENCODER(, dilithium3_p256, oqsx, PrivateKeyInfo, der); -MAKE_ENCODER(, dilithium3_p256, oqsx, PrivateKeyInfo, pem); -MAKE_ENCODER(, dilithium3_p256, oqsx, SubjectPublicKeyInfo, der); -MAKE_ENCODER(, dilithium3_p256, oqsx, SubjectPublicKeyInfo, pem); -MAKE_TEXT_ENCODER(, dilithium3_p256); -MAKE_ENCODER(, falcon512_p256, oqsx, EncryptedPrivateKeyInfo, der); -MAKE_ENCODER(, falcon512_p256, oqsx, EncryptedPrivateKeyInfo, pem); -MAKE_ENCODER(, falcon512_p256, oqsx, PrivateKeyInfo, der); -MAKE_ENCODER(, falcon512_p256, oqsx, PrivateKeyInfo, pem); -MAKE_ENCODER(, falcon512_p256, oqsx, SubjectPublicKeyInfo, der); -MAKE_ENCODER(, falcon512_p256, oqsx, SubjectPublicKeyInfo, pem); -MAKE_TEXT_ENCODER(, falcon512_p256); -MAKE_ENCODER(, dilithium5_p384, oqsx, EncryptedPrivateKeyInfo, der); -MAKE_ENCODER(, dilithium5_p384, oqsx, EncryptedPrivateKeyInfo, pem); -MAKE_ENCODER(, dilithium5_p384, oqsx, PrivateKeyInfo, der); -MAKE_ENCODER(, dilithium5_p384, oqsx, PrivateKeyInfo, pem); -MAKE_ENCODER(, dilithium5_p384, oqsx, SubjectPublicKeyInfo, der); -MAKE_ENCODER(, dilithium5_p384, oqsx, SubjectPublicKeyInfo, pem); -MAKE_TEXT_ENCODER(, dilithium5_p384); -MAKE_ENCODER(, dilithium3_bp256, oqsx, EncryptedPrivateKeyInfo, der); -MAKE_ENCODER(, dilithium3_bp256, oqsx, EncryptedPrivateKeyInfo, pem); -MAKE_ENCODER(, dilithium3_bp256, oqsx, PrivateKeyInfo, der); -MAKE_ENCODER(, dilithium3_bp256, oqsx, PrivateKeyInfo, pem); -MAKE_ENCODER(, dilithium3_bp256, oqsx, SubjectPublicKeyInfo, der); -MAKE_ENCODER(, dilithium3_bp256, oqsx, SubjectPublicKeyInfo, pem); -MAKE_TEXT_ENCODER(, dilithium3_bp256); -MAKE_ENCODER(, dilithium3_ed25519, oqsx, EncryptedPrivateKeyInfo, der); -MAKE_ENCODER(, dilithium3_ed25519, oqsx, EncryptedPrivateKeyInfo, pem); -MAKE_ENCODER(, dilithium3_ed25519, oqsx, PrivateKeyInfo, der); -MAKE_ENCODER(, dilithium3_ed25519, oqsx, PrivateKeyInfo, pem); -MAKE_ENCODER(, dilithium3_ed25519, oqsx, SubjectPublicKeyInfo, der); -MAKE_ENCODER(, dilithium3_ed25519, oqsx, SubjectPublicKeyInfo, pem); -MAKE_TEXT_ENCODER(, dilithium3_ed25519); -MAKE_ENCODER(, dilithium5_bp384, oqsx, EncryptedPrivateKeyInfo, der); -MAKE_ENCODER(, dilithium5_bp384, oqsx, EncryptedPrivateKeyInfo, pem); -MAKE_ENCODER(, dilithium5_bp384, oqsx, PrivateKeyInfo, der); -MAKE_ENCODER(, dilithium5_bp384, oqsx, PrivateKeyInfo, pem); -MAKE_ENCODER(, dilithium5_bp384, oqsx, SubjectPublicKeyInfo, der); -MAKE_ENCODER(, dilithium5_bp384, oqsx, SubjectPublicKeyInfo, pem); -MAKE_TEXT_ENCODER(, dilithium5_bp384); -MAKE_ENCODER(, dilithium5_ed448, oqsx, EncryptedPrivateKeyInfo, der); -MAKE_ENCODER(, dilithium5_ed448, oqsx, EncryptedPrivateKeyInfo, pem); -MAKE_ENCODER(, dilithium5_ed448, oqsx, PrivateKeyInfo, der); -MAKE_ENCODER(, dilithium5_ed448, oqsx, PrivateKeyInfo, pem); -MAKE_ENCODER(, dilithium5_ed448, oqsx, SubjectPublicKeyInfo, der); -MAKE_ENCODER(, dilithium5_ed448, oqsx, SubjectPublicKeyInfo, pem); -MAKE_TEXT_ENCODER(, dilithium5_ed448); -MAKE_ENCODER(, falcon512_bp256, oqsx, EncryptedPrivateKeyInfo, der); -MAKE_ENCODER(, falcon512_bp256, oqsx, EncryptedPrivateKeyInfo, pem); -MAKE_ENCODER(, falcon512_bp256, oqsx, PrivateKeyInfo, der); -MAKE_ENCODER(, falcon512_bp256, oqsx, PrivateKeyInfo, pem); -MAKE_ENCODER(, falcon512_bp256, oqsx, SubjectPublicKeyInfo, der); -MAKE_ENCODER(, falcon512_bp256, oqsx, SubjectPublicKeyInfo, pem); -MAKE_TEXT_ENCODER(, falcon512_bp256); -MAKE_ENCODER(, falcon512_ed25519, oqsx, EncryptedPrivateKeyInfo, der); -MAKE_ENCODER(, falcon512_ed25519, oqsx, EncryptedPrivateKeyInfo, pem); -MAKE_ENCODER(, falcon512_ed25519, oqsx, PrivateKeyInfo, der); -MAKE_ENCODER(, falcon512_ed25519, oqsx, PrivateKeyInfo, pem); -MAKE_ENCODER(, falcon512_ed25519, oqsx, SubjectPublicKeyInfo, der); -MAKE_ENCODER(, falcon512_ed25519, oqsx, SubjectPublicKeyInfo, pem); -MAKE_TEXT_ENCODER(, falcon512_ed25519); -MAKE_ENCODER(, dilithium3_pss3072, oqsx, EncryptedPrivateKeyInfo, der); -MAKE_ENCODER(, dilithium3_pss3072, oqsx, EncryptedPrivateKeyInfo, pem); -MAKE_ENCODER(, dilithium3_pss3072, oqsx, PrivateKeyInfo, der); -MAKE_ENCODER(, dilithium3_pss3072, oqsx, PrivateKeyInfo, pem); -MAKE_ENCODER(, dilithium3_pss3072, oqsx, SubjectPublicKeyInfo, der); -MAKE_ENCODER(, dilithium3_pss3072, oqsx, SubjectPublicKeyInfo, pem); -MAKE_TEXT_ENCODER(, dilithium3_pss3072); -MAKE_ENCODER(, dilithium2_pss2048, oqsx, EncryptedPrivateKeyInfo, der); -MAKE_ENCODER(, dilithium2_pss2048, oqsx, EncryptedPrivateKeyInfo, pem); -MAKE_ENCODER(, dilithium2_pss2048, oqsx, PrivateKeyInfo, der); -MAKE_ENCODER(, dilithium2_pss2048, oqsx, PrivateKeyInfo, pem); -MAKE_ENCODER(, dilithium2_pss2048, oqsx, SubjectPublicKeyInfo, der); -MAKE_ENCODER(, dilithium2_pss2048, oqsx, SubjectPublicKeyInfo, pem); -MAKE_TEXT_ENCODER(, dilithium2_pss2048); -MAKE_ENCODER(, dilithium2_rsa2048, oqsx, EncryptedPrivateKeyInfo, der); -MAKE_ENCODER(, dilithium2_rsa2048, oqsx, EncryptedPrivateKeyInfo, pem); -MAKE_ENCODER(, dilithium2_rsa2048, oqsx, PrivateKeyInfo, der); -MAKE_ENCODER(, dilithium2_rsa2048, oqsx, PrivateKeyInfo, pem); -MAKE_ENCODER(, dilithium2_rsa2048, oqsx, SubjectPublicKeyInfo, der); -MAKE_ENCODER(, dilithium2_rsa2048, oqsx, SubjectPublicKeyInfo, pem); -MAKE_TEXT_ENCODER(, dilithium2_rsa2048); -MAKE_ENCODER(, dilithium2_ed25519, oqsx, EncryptedPrivateKeyInfo, der); -MAKE_ENCODER(, dilithium2_ed25519, oqsx, EncryptedPrivateKeyInfo, pem); -MAKE_ENCODER(, dilithium2_ed25519, oqsx, PrivateKeyInfo, der); -MAKE_ENCODER(, dilithium2_ed25519, oqsx, PrivateKeyInfo, pem); -MAKE_ENCODER(, dilithium2_ed25519, oqsx, SubjectPublicKeyInfo, der); -MAKE_ENCODER(, dilithium2_ed25519, oqsx, SubjectPublicKeyInfo, pem); -MAKE_TEXT_ENCODER(, dilithium2_ed25519); -MAKE_ENCODER(, dilithium2_p256, oqsx, EncryptedPrivateKeyInfo, der); -MAKE_ENCODER(, dilithium2_p256, oqsx, EncryptedPrivateKeyInfo, pem); -MAKE_ENCODER(, dilithium2_p256, oqsx, PrivateKeyInfo, der); -MAKE_ENCODER(, dilithium2_p256, oqsx, PrivateKeyInfo, pem); -MAKE_ENCODER(, dilithium2_p256, oqsx, SubjectPublicKeyInfo, der); -MAKE_ENCODER(, dilithium2_p256, oqsx, SubjectPublicKeyInfo, pem); -MAKE_TEXT_ENCODER(, dilithium2_p256); -MAKE_ENCODER(, dilithium2_bp256, oqsx, EncryptedPrivateKeyInfo, der); -MAKE_ENCODER(, dilithium2_bp256, oqsx, EncryptedPrivateKeyInfo, pem); -MAKE_ENCODER(, dilithium2_bp256, oqsx, PrivateKeyInfo, der); -MAKE_ENCODER(, dilithium2_bp256, oqsx, PrivateKeyInfo, pem); -MAKE_ENCODER(, dilithium2_bp256, oqsx, SubjectPublicKeyInfo, der); -MAKE_ENCODER(, dilithium2_bp256, oqsx, SubjectPublicKeyInfo, pem); -MAKE_TEXT_ENCODER(, dilithium2_bp256); ///// OQS_TEMPLATE_FRAGMENT_ENCODER_MAKE_END diff --git a/oqsprov/oqs_kmgmt.c b/oqsprov/oqs_kmgmt.c index dcde2dbc..09bb2b31 100644 --- a/oqsprov/oqs_kmgmt.c +++ b/oqsprov/oqs_kmgmt.c @@ -614,138 +614,314 @@ static void *rsa3072_dilithium2_gen_init(void *provctx, int selection) return oqsx_gen_init(provctx, selection, OQS_SIG_alg_dilithium_2, "rsa3072_dilithium2", KEY_TYPE_HYB_SIG, 128, 2); } +static void *dilithium2_pss2048_new_key(void *provctx) +{ + return oqsx_key_new(PROV_OQS_LIBCTX_OF(provctx), OQS_SIG_alg_dilithium_2, + "dilithium2_pss2048", KEY_TYPE_CMP_SIG, NULL, 112, 3); +} + +static void *dilithium2_pss2048_gen_init(void *provctx, int selection) +{ + return oqsx_gen_init(provctx, selection, OQS_SIG_alg_dilithium_2, + "dilithium2_pss2048", KEY_TYPE_CMP_SIG, 112, 3); +} +static void *dilithium2_rsa2048_new_key(void *provctx) +{ + return oqsx_key_new(PROV_OQS_LIBCTX_OF(provctx), OQS_SIG_alg_dilithium_2, + "dilithium2_rsa2048", KEY_TYPE_CMP_SIG, NULL, 112, 4); +} + +static void *dilithium2_rsa2048_gen_init(void *provctx, int selection) +{ + return oqsx_gen_init(provctx, selection, OQS_SIG_alg_dilithium_2, + "dilithium2_rsa2048", KEY_TYPE_CMP_SIG, 112, 4); +} +static void *dilithium2_ed25519_new_key(void *provctx) +{ + return oqsx_key_new(PROV_OQS_LIBCTX_OF(provctx), OQS_SIG_alg_dilithium_2, + "dilithium2_ed25519", KEY_TYPE_CMP_SIG, NULL, 128, 5); +} + +static void *dilithium2_ed25519_gen_init(void *provctx, int selection) +{ + return oqsx_gen_init(provctx, selection, OQS_SIG_alg_dilithium_2, + "dilithium2_ed25519", KEY_TYPE_CMP_SIG, 128, 5); +} +static void *dilithium2_p256_new_key(void *provctx) +{ + return oqsx_key_new(PROV_OQS_LIBCTX_OF(provctx), OQS_SIG_alg_dilithium_2, + "dilithium2_p256", KEY_TYPE_CMP_SIG, NULL, 128, 6); +} + +static void *dilithium2_p256_gen_init(void *provctx, int selection) +{ + return oqsx_gen_init(provctx, selection, OQS_SIG_alg_dilithium_2, + "dilithium2_p256", KEY_TYPE_CMP_SIG, 128, 6); +} +static void *dilithium2_bp256_new_key(void *provctx) +{ + return oqsx_key_new(PROV_OQS_LIBCTX_OF(provctx), OQS_SIG_alg_dilithium_2, + "dilithium2_bp256", KEY_TYPE_CMP_SIG, NULL, 256, 7); +} + +static void *dilithium2_bp256_gen_init(void *provctx, int selection) +{ + return oqsx_gen_init(provctx, selection, OQS_SIG_alg_dilithium_2, + "dilithium2_bp256", KEY_TYPE_CMP_SIG, 256, 7); +} static void *dilithium3_new_key(void *provctx) { return oqsx_key_new(PROV_OQS_LIBCTX_OF(provctx), OQS_SIG_alg_dilithium_3, - "dilithium3", KEY_TYPE_SIG, NULL, 192, 3); + "dilithium3", KEY_TYPE_SIG, NULL, 192, 8); } static void *dilithium3_gen_init(void *provctx, int selection) { return oqsx_gen_init(provctx, selection, OQS_SIG_alg_dilithium_3, - "dilithium3", 0, 192, 3); + "dilithium3", 0, 192, 8); } static void *p384_dilithium3_new_key(void *provctx) { return oqsx_key_new(PROV_OQS_LIBCTX_OF(provctx), OQS_SIG_alg_dilithium_3, - "p384_dilithium3", KEY_TYPE_HYB_SIG, NULL, 192, 4); + "p384_dilithium3", KEY_TYPE_HYB_SIG, NULL, 192, 9); } static void *p384_dilithium3_gen_init(void *provctx, int selection) { return oqsx_gen_init(provctx, selection, OQS_SIG_alg_dilithium_3, - "p384_dilithium3", KEY_TYPE_HYB_SIG, 192, 4); + "p384_dilithium3", KEY_TYPE_HYB_SIG, 192, 9); +} +static void *dilithium3_pss3072_new_key(void *provctx) +{ + return oqsx_key_new(PROV_OQS_LIBCTX_OF(provctx), OQS_SIG_alg_dilithium_3, + "dilithium3_pss3072", KEY_TYPE_CMP_SIG, NULL, 128, 10); +} + +static void *dilithium3_pss3072_gen_init(void *provctx, int selection) +{ + return oqsx_gen_init(provctx, selection, OQS_SIG_alg_dilithium_3, + "dilithium3_pss3072", KEY_TYPE_CMP_SIG, 128, 10); +} +static void *dilithium3_rsa3072_new_key(void *provctx) +{ + return oqsx_key_new(PROV_OQS_LIBCTX_OF(provctx), OQS_SIG_alg_dilithium_3, + "dilithium3_rsa3072", KEY_TYPE_CMP_SIG, NULL, 128, 11); +} + +static void *dilithium3_rsa3072_gen_init(void *provctx, int selection) +{ + return oqsx_gen_init(provctx, selection, OQS_SIG_alg_dilithium_3, + "dilithium3_rsa3072", KEY_TYPE_CMP_SIG, 128, 11); +} +static void *dilithium3_p256_new_key(void *provctx) +{ + return oqsx_key_new(PROV_OQS_LIBCTX_OF(provctx), OQS_SIG_alg_dilithium_3, + "dilithium3_p256", KEY_TYPE_CMP_SIG, NULL, 128, 12); +} + +static void *dilithium3_p256_gen_init(void *provctx, int selection) +{ + return oqsx_gen_init(provctx, selection, OQS_SIG_alg_dilithium_3, + "dilithium3_p256", KEY_TYPE_CMP_SIG, 128, 12); +} +static void *dilithium3_bp256_new_key(void *provctx) +{ + return oqsx_key_new(PROV_OQS_LIBCTX_OF(provctx), OQS_SIG_alg_dilithium_3, + "dilithium3_bp256", KEY_TYPE_CMP_SIG, NULL, 256, 13); +} + +static void *dilithium3_bp256_gen_init(void *provctx, int selection) +{ + return oqsx_gen_init(provctx, selection, OQS_SIG_alg_dilithium_3, + "dilithium3_bp256", KEY_TYPE_CMP_SIG, 256, 13); +} +static void *dilithium3_ed25519_new_key(void *provctx) +{ + return oqsx_key_new(PROV_OQS_LIBCTX_OF(provctx), OQS_SIG_alg_dilithium_3, + "dilithium3_ed25519", KEY_TYPE_CMP_SIG, NULL, 128, 14); +} + +static void *dilithium3_ed25519_gen_init(void *provctx, int selection) +{ + return oqsx_gen_init(provctx, selection, OQS_SIG_alg_dilithium_3, + "dilithium3_ed25519", KEY_TYPE_CMP_SIG, 128, 14); } static void *dilithium5_new_key(void *provctx) { return oqsx_key_new(PROV_OQS_LIBCTX_OF(provctx), OQS_SIG_alg_dilithium_5, - "dilithium5", KEY_TYPE_SIG, NULL, 256, 5); + "dilithium5", KEY_TYPE_SIG, NULL, 256, 15); } static void *dilithium5_gen_init(void *provctx, int selection) { return oqsx_gen_init(provctx, selection, OQS_SIG_alg_dilithium_5, - "dilithium5", 0, 256, 5); + "dilithium5", 0, 256, 15); } static void *p521_dilithium5_new_key(void *provctx) { return oqsx_key_new(PROV_OQS_LIBCTX_OF(provctx), OQS_SIG_alg_dilithium_5, - "p521_dilithium5", KEY_TYPE_HYB_SIG, NULL, 256, 6); + "p521_dilithium5", KEY_TYPE_HYB_SIG, NULL, 256, 16); } static void *p521_dilithium5_gen_init(void *provctx, int selection) { return oqsx_gen_init(provctx, selection, OQS_SIG_alg_dilithium_5, - "p521_dilithium5", KEY_TYPE_HYB_SIG, 256, 6); + "p521_dilithium5", KEY_TYPE_HYB_SIG, 256, 16); +} +static void *dilithium5_p384_new_key(void *provctx) +{ + return oqsx_key_new(PROV_OQS_LIBCTX_OF(provctx), OQS_SIG_alg_dilithium_5, + "dilithium5_p384", KEY_TYPE_CMP_SIG, NULL, 192, 17); +} + +static void *dilithium5_p384_gen_init(void *provctx, int selection) +{ + return oqsx_gen_init(provctx, selection, OQS_SIG_alg_dilithium_5, + "dilithium5_p384", KEY_TYPE_CMP_SIG, 192, 17); +} +static void *dilithium5_bp384_new_key(void *provctx) +{ + return oqsx_key_new(PROV_OQS_LIBCTX_OF(provctx), OQS_SIG_alg_dilithium_5, + "dilithium5_bp384", KEY_TYPE_CMP_SIG, NULL, 384, 18); +} + +static void *dilithium5_bp384_gen_init(void *provctx, int selection) +{ + return oqsx_gen_init(provctx, selection, OQS_SIG_alg_dilithium_5, + "dilithium5_bp384", KEY_TYPE_CMP_SIG, 384, 18); +} +static void *dilithium5_ed448_new_key(void *provctx) +{ + return oqsx_key_new(PROV_OQS_LIBCTX_OF(provctx), OQS_SIG_alg_dilithium_5, + "dilithium5_ed448", KEY_TYPE_CMP_SIG, NULL, 192, 19); +} + +static void *dilithium5_ed448_gen_init(void *provctx, int selection) +{ + return oqsx_gen_init(provctx, selection, OQS_SIG_alg_dilithium_5, + "dilithium5_ed448", KEY_TYPE_CMP_SIG, 192, 19); } static void *falcon512_new_key(void *provctx) { return oqsx_key_new(PROV_OQS_LIBCTX_OF(provctx), OQS_SIG_alg_falcon_512, - "falcon512", KEY_TYPE_SIG, NULL, 128, 7); + "falcon512", KEY_TYPE_SIG, NULL, 128, 20); } static void *falcon512_gen_init(void *provctx, int selection) { return oqsx_gen_init(provctx, selection, OQS_SIG_alg_falcon_512, - "falcon512", 0, 128, 7); + "falcon512", 0, 128, 20); } static void *p256_falcon512_new_key(void *provctx) { return oqsx_key_new(PROV_OQS_LIBCTX_OF(provctx), OQS_SIG_alg_falcon_512, - "p256_falcon512", KEY_TYPE_HYB_SIG, NULL, 128, 8); + "p256_falcon512", KEY_TYPE_HYB_SIG, NULL, 128, 21); } static void *p256_falcon512_gen_init(void *provctx, int selection) { return oqsx_gen_init(provctx, selection, OQS_SIG_alg_falcon_512, - "p256_falcon512", KEY_TYPE_HYB_SIG, 128, 8); + "p256_falcon512", KEY_TYPE_HYB_SIG, 128, 21); } static void *rsa3072_falcon512_new_key(void *provctx) { return oqsx_key_new(PROV_OQS_LIBCTX_OF(provctx), OQS_SIG_alg_falcon_512, - "rsa3072_falcon512", KEY_TYPE_HYB_SIG, NULL, 128, 9); + "rsa3072_falcon512", KEY_TYPE_HYB_SIG, NULL, 128, 22); } static void *rsa3072_falcon512_gen_init(void *provctx, int selection) { return oqsx_gen_init(provctx, selection, OQS_SIG_alg_falcon_512, - "rsa3072_falcon512", KEY_TYPE_HYB_SIG, 128, 9); + "rsa3072_falcon512", KEY_TYPE_HYB_SIG, 128, 22); +} +static void *falcon512_p256_new_key(void *provctx) +{ + return oqsx_key_new(PROV_OQS_LIBCTX_OF(provctx), OQS_SIG_alg_falcon_512, + "falcon512_p256", KEY_TYPE_CMP_SIG, NULL, 128, 23); +} + +static void *falcon512_p256_gen_init(void *provctx, int selection) +{ + return oqsx_gen_init(provctx, selection, OQS_SIG_alg_falcon_512, + "falcon512_p256", KEY_TYPE_CMP_SIG, 128, 23); +} +static void *falcon512_bp256_new_key(void *provctx) +{ + return oqsx_key_new(PROV_OQS_LIBCTX_OF(provctx), OQS_SIG_alg_falcon_512, + "falcon512_bp256", KEY_TYPE_CMP_SIG, NULL, 256, 24); +} + +static void *falcon512_bp256_gen_init(void *provctx, int selection) +{ + return oqsx_gen_init(provctx, selection, OQS_SIG_alg_falcon_512, + "falcon512_bp256", KEY_TYPE_CMP_SIG, 256, 24); +} +static void *falcon512_ed25519_new_key(void *provctx) +{ + return oqsx_key_new(PROV_OQS_LIBCTX_OF(provctx), OQS_SIG_alg_falcon_512, + "falcon512_ed25519", KEY_TYPE_CMP_SIG, NULL, 128, 25); +} + +static void *falcon512_ed25519_gen_init(void *provctx, int selection) +{ + return oqsx_gen_init(provctx, selection, OQS_SIG_alg_falcon_512, + "falcon512_ed25519", KEY_TYPE_CMP_SIG, 128, 25); } static void *falcon1024_new_key(void *provctx) { return oqsx_key_new(PROV_OQS_LIBCTX_OF(provctx), OQS_SIG_alg_falcon_1024, - "falcon1024", KEY_TYPE_SIG, NULL, 256, 10); + "falcon1024", KEY_TYPE_SIG, NULL, 256, 26); } static void *falcon1024_gen_init(void *provctx, int selection) { return oqsx_gen_init(provctx, selection, OQS_SIG_alg_falcon_1024, - "falcon1024", 0, 256, 10); + "falcon1024", 0, 256, 26); } static void *p521_falcon1024_new_key(void *provctx) { return oqsx_key_new(PROV_OQS_LIBCTX_OF(provctx), OQS_SIG_alg_falcon_1024, - "p521_falcon1024", KEY_TYPE_HYB_SIG, NULL, 256, 11); + "p521_falcon1024", KEY_TYPE_HYB_SIG, NULL, 256, 27); } static void *p521_falcon1024_gen_init(void *provctx, int selection) { return oqsx_gen_init(provctx, selection, OQS_SIG_alg_falcon_1024, - "p521_falcon1024", KEY_TYPE_HYB_SIG, 256, 11); + "p521_falcon1024", KEY_TYPE_HYB_SIG, 256, 27); } static void *sphincssha2128fsimple_new_key(void *provctx) { return oqsx_key_new(PROV_OQS_LIBCTX_OF(provctx), OQS_SIG_alg_sphincs_sha2_128f_simple, - "sphincssha2128fsimple", KEY_TYPE_SIG, NULL, 128, 12); + "sphincssha2128fsimple", KEY_TYPE_SIG, NULL, 128, 28); } static void *sphincssha2128fsimple_gen_init(void *provctx, int selection) { return oqsx_gen_init(provctx, selection, OQS_SIG_alg_sphincs_sha2_128f_simple, - "sphincssha2128fsimple", 0, 128, 12); + "sphincssha2128fsimple", 0, 128, 28); } static void *p256_sphincssha2128fsimple_new_key(void *provctx) { return oqsx_key_new( PROV_OQS_LIBCTX_OF(provctx), OQS_SIG_alg_sphincs_sha2_128f_simple, - "p256_sphincssha2128fsimple", KEY_TYPE_HYB_SIG, NULL, 128, 13); + "p256_sphincssha2128fsimple", KEY_TYPE_HYB_SIG, NULL, 128, 29); } static void *p256_sphincssha2128fsimple_gen_init(void *provctx, int selection) { return oqsx_gen_init( provctx, selection, OQS_SIG_alg_sphincs_sha2_128f_simple, - "p256_sphincssha2128fsimple", KEY_TYPE_HYB_SIG, 128, 13); + "p256_sphincssha2128fsimple", KEY_TYPE_HYB_SIG, 128, 29); } static void *rsa3072_sphincssha2128fsimple_new_key(void *provctx) { return oqsx_key_new( PROV_OQS_LIBCTX_OF(provctx), OQS_SIG_alg_sphincs_sha2_128f_simple, - "rsa3072_sphincssha2128fsimple", KEY_TYPE_HYB_SIG, NULL, 128, 14); + "rsa3072_sphincssha2128fsimple", KEY_TYPE_HYB_SIG, NULL, 128, 30); } static void *rsa3072_sphincssha2128fsimple_gen_init(void *provctx, @@ -753,39 +929,39 @@ static void *rsa3072_sphincssha2128fsimple_gen_init(void *provctx, { return oqsx_gen_init( provctx, selection, OQS_SIG_alg_sphincs_sha2_128f_simple, - "rsa3072_sphincssha2128fsimple", KEY_TYPE_HYB_SIG, 128, 14); + "rsa3072_sphincssha2128fsimple", KEY_TYPE_HYB_SIG, 128, 30); } static void *sphincssha2128ssimple_new_key(void *provctx) { return oqsx_key_new(PROV_OQS_LIBCTX_OF(provctx), OQS_SIG_alg_sphincs_sha2_128s_simple, - "sphincssha2128ssimple", KEY_TYPE_SIG, NULL, 128, 15); + "sphincssha2128ssimple", KEY_TYPE_SIG, NULL, 128, 31); } static void *sphincssha2128ssimple_gen_init(void *provctx, int selection) { return oqsx_gen_init(provctx, selection, OQS_SIG_alg_sphincs_sha2_128s_simple, - "sphincssha2128ssimple", 0, 128, 15); + "sphincssha2128ssimple", 0, 128, 31); } static void *p256_sphincssha2128ssimple_new_key(void *provctx) { return oqsx_key_new( PROV_OQS_LIBCTX_OF(provctx), OQS_SIG_alg_sphincs_sha2_128s_simple, - "p256_sphincssha2128ssimple", KEY_TYPE_HYB_SIG, NULL, 128, 16); + "p256_sphincssha2128ssimple", KEY_TYPE_HYB_SIG, NULL, 128, 32); } static void *p256_sphincssha2128ssimple_gen_init(void *provctx, int selection) { return oqsx_gen_init( provctx, selection, OQS_SIG_alg_sphincs_sha2_128s_simple, - "p256_sphincssha2128ssimple", KEY_TYPE_HYB_SIG, 128, 16); + "p256_sphincssha2128ssimple", KEY_TYPE_HYB_SIG, 128, 32); } static void *rsa3072_sphincssha2128ssimple_new_key(void *provctx) { return oqsx_key_new( PROV_OQS_LIBCTX_OF(provctx), OQS_SIG_alg_sphincs_sha2_128s_simple, - "rsa3072_sphincssha2128ssimple", KEY_TYPE_HYB_SIG, NULL, 128, 17); + "rsa3072_sphincssha2128ssimple", KEY_TYPE_HYB_SIG, NULL, 128, 33); } static void *rsa3072_sphincssha2128ssimple_gen_init(void *provctx, @@ -793,66 +969,66 @@ static void *rsa3072_sphincssha2128ssimple_gen_init(void *provctx, { return oqsx_gen_init( provctx, selection, OQS_SIG_alg_sphincs_sha2_128s_simple, - "rsa3072_sphincssha2128ssimple", KEY_TYPE_HYB_SIG, 128, 17); + "rsa3072_sphincssha2128ssimple", KEY_TYPE_HYB_SIG, 128, 33); } static void *sphincssha2192fsimple_new_key(void *provctx) { return oqsx_key_new(PROV_OQS_LIBCTX_OF(provctx), OQS_SIG_alg_sphincs_sha2_192f_simple, - "sphincssha2192fsimple", KEY_TYPE_SIG, NULL, 192, 18); + "sphincssha2192fsimple", KEY_TYPE_SIG, NULL, 192, 34); } static void *sphincssha2192fsimple_gen_init(void *provctx, int selection) { return oqsx_gen_init(provctx, selection, OQS_SIG_alg_sphincs_sha2_192f_simple, - "sphincssha2192fsimple", 0, 192, 18); + "sphincssha2192fsimple", 0, 192, 34); } static void *p384_sphincssha2192fsimple_new_key(void *provctx) { return oqsx_key_new( PROV_OQS_LIBCTX_OF(provctx), OQS_SIG_alg_sphincs_sha2_192f_simple, - "p384_sphincssha2192fsimple", KEY_TYPE_HYB_SIG, NULL, 192, 19); + "p384_sphincssha2192fsimple", KEY_TYPE_HYB_SIG, NULL, 192, 35); } static void *p384_sphincssha2192fsimple_gen_init(void *provctx, int selection) { return oqsx_gen_init( provctx, selection, OQS_SIG_alg_sphincs_sha2_192f_simple, - "p384_sphincssha2192fsimple", KEY_TYPE_HYB_SIG, 192, 19); + "p384_sphincssha2192fsimple", KEY_TYPE_HYB_SIG, 192, 35); } static void *sphincsshake128fsimple_new_key(void *provctx) { return oqsx_key_new(PROV_OQS_LIBCTX_OF(provctx), OQS_SIG_alg_sphincs_shake_128f_simple, - "sphincsshake128fsimple", KEY_TYPE_SIG, NULL, 128, 20); + "sphincsshake128fsimple", KEY_TYPE_SIG, NULL, 128, 36); } static void *sphincsshake128fsimple_gen_init(void *provctx, int selection) { return oqsx_gen_init(provctx, selection, OQS_SIG_alg_sphincs_shake_128f_simple, - "sphincsshake128fsimple", 0, 128, 20); + "sphincsshake128fsimple", 0, 128, 36); } static void *p256_sphincsshake128fsimple_new_key(void *provctx) { return oqsx_key_new( PROV_OQS_LIBCTX_OF(provctx), OQS_SIG_alg_sphincs_shake_128f_simple, - "p256_sphincsshake128fsimple", KEY_TYPE_HYB_SIG, NULL, 128, 21); + "p256_sphincsshake128fsimple", KEY_TYPE_HYB_SIG, NULL, 128, 37); } static void *p256_sphincsshake128fsimple_gen_init(void *provctx, int selection) { return oqsx_gen_init( provctx, selection, OQS_SIG_alg_sphincs_shake_128f_simple, - "p256_sphincsshake128fsimple", KEY_TYPE_HYB_SIG, 128, 21); + "p256_sphincsshake128fsimple", KEY_TYPE_HYB_SIG, 128, 37); } static void *rsa3072_sphincsshake128fsimple_new_key(void *provctx) { return oqsx_key_new( PROV_OQS_LIBCTX_OF(provctx), OQS_SIG_alg_sphincs_shake_128f_simple, - "rsa3072_sphincsshake128fsimple", KEY_TYPE_HYB_SIG, NULL, 128, 22); + "rsa3072_sphincsshake128fsimple", KEY_TYPE_HYB_SIG, NULL, 128, 38); } static void *rsa3072_sphincsshake128fsimple_gen_init(void *provctx, @@ -860,200 +1036,9 @@ static void *rsa3072_sphincsshake128fsimple_gen_init(void *provctx, { return oqsx_gen_init( provctx, selection, OQS_SIG_alg_sphincs_shake_128f_simple, - "rsa3072_sphincsshake128fsimple", KEY_TYPE_HYB_SIG, 128, 22); -} - -static void *dilithium3_rsa3072_new_key(void *provctx) -{ - return oqsx_key_new(PROV_OQS_LIBCTX_OF(provctx), OQS_SIG_alg_dilithium_3, - "dilithium3_rsa3072", KEY_TYPE_CMP_SIG, NULL, 128, 23); + "rsa3072_sphincsshake128fsimple", KEY_TYPE_HYB_SIG, 128, 38); } -static void *dilithium3_rsa3072_gen_init(void *provctx, int selection) -{ - return oqsx_gen_init(provctx, selection, OQS_SIG_alg_dilithium_3, - "dilithium3_rsa3072", KEY_TYPE_CMP_SIG, 128, 23); -} - -static void *dilithium3_p256_new_key(void *provctx) -{ - return oqsx_key_new(PROV_OQS_LIBCTX_OF(provctx), OQS_SIG_alg_dilithium_3, - "dilithium3_p256", KEY_TYPE_CMP_SIG, NULL, 128, 24); -} - -static void *dilithium3_p256_gen_init(void *provctx, int selection) -{ - return oqsx_gen_init(provctx, selection, OQS_SIG_alg_dilithium_3, - "dilithium3_p256", KEY_TYPE_CMP_SIG, 128, 24); -} - -static void *falcon512_p256_new_key(void *provctx) -{ - return oqsx_key_new(PROV_OQS_LIBCTX_OF(provctx), OQS_SIG_alg_falcon_512, - "falcon512_p256", KEY_TYPE_CMP_SIG, NULL, 128, 25); -} - -static void *falcon512_p256_gen_init(void *provctx, int selection) -{ - return oqsx_gen_init(provctx, selection, OQS_SIG_alg_falcon_512, - "falcon512_p256", KEY_TYPE_CMP_SIG, 128, 25); -} - -static void *dilithium5_p384_new_key(void *provctx) -{ - return oqsx_key_new(PROV_OQS_LIBCTX_OF(provctx), OQS_SIG_alg_dilithium_5, - "dilithium5_p384", KEY_TYPE_CMP_SIG, NULL, 192, 26); -} - -static void *dilithium5_p384_gen_init(void *provctx, int selection) -{ - return oqsx_gen_init(provctx, selection, OQS_SIG_alg_dilithium_5, - "dilithium5_p384", KEY_TYPE_CMP_SIG, 192, 26); -} - -static void *dilithium3_bp256_new_key(void *provctx) -{ - return oqsx_key_new(PROV_OQS_LIBCTX_OF(provctx), OQS_SIG_alg_dilithium_3, - "dilithium3_bp256", KEY_TYPE_CMP_SIG, NULL, 256, 27); -} - -static void *dilithium3_bp256_gen_init(void *provctx, int selection) -{ - return oqsx_gen_init(provctx, selection, OQS_SIG_alg_dilithium_3, - "dilithium3_bp256", KEY_TYPE_CMP_SIG, 256, 27); -} - -static void *dilithium3_ed25519_new_key(void *provctx) -{ - return oqsx_key_new(PROV_OQS_LIBCTX_OF(provctx), OQS_SIG_alg_dilithium_3, - "dilithium3_ed25519", KEY_TYPE_CMP_SIG, NULL, 128, 28); -} - -static void *dilithium3_ed25519_gen_init(void *provctx, int selection) -{ - return oqsx_gen_init(provctx, selection, OQS_SIG_alg_dilithium_3, - "dilithium3_ed25519", KEY_TYPE_CMP_SIG, 128, 28); -} - -static void *dilithium5_bp384_new_key(void *provctx) -{ - return oqsx_key_new(PROV_OQS_LIBCTX_OF(provctx), OQS_SIG_alg_dilithium_5, - "dilithium5_bp384", KEY_TYPE_CMP_SIG, NULL, 384, 29); -} - -static void *dilithium5_bp384_gen_init(void *provctx, int selection) -{ - return oqsx_gen_init(provctx, selection, OQS_SIG_alg_dilithium_5, - "dilithium5_bp384", KEY_TYPE_CMP_SIG, 384, 29); -} - -static void *dilithium5_ed448_new_key(void *provctx) -{ - return oqsx_key_new(PROV_OQS_LIBCTX_OF(provctx), OQS_SIG_alg_dilithium_5, - "dilithium5_ed448", KEY_TYPE_CMP_SIG, NULL, 192, 30); -} - -static void *dilithium5_ed448_gen_init(void *provctx, int selection) -{ - return oqsx_gen_init(provctx, selection, OQS_SIG_alg_dilithium_5, - "dilithium5_ed448", KEY_TYPE_CMP_SIG, 192, 30); -} - -static void *falcon512_bp256_new_key(void *provctx) -{ - return oqsx_key_new(PROV_OQS_LIBCTX_OF(provctx), OQS_SIG_alg_falcon_512, - "falcon512_bp256", KEY_TYPE_CMP_SIG, NULL, 256, 31); -} - -static void *falcon512_bp256_gen_init(void *provctx, int selection) -{ - return oqsx_gen_init(provctx, selection, OQS_SIG_alg_falcon_512, - "falcon512_bp256", KEY_TYPE_CMP_SIG, 256, 31); -} - -static void *falcon512_ed25519_new_key(void *provctx) -{ - return oqsx_key_new(PROV_OQS_LIBCTX_OF(provctx), OQS_SIG_alg_falcon_512, - "falcon512_ed25519", KEY_TYPE_CMP_SIG, NULL, 128, 32); -} - -static void *falcon512_ed25519_gen_init(void *provctx, int selection) -{ - return oqsx_gen_init(provctx, selection, OQS_SIG_alg_falcon_512, - "falcon512_ed25519", KEY_TYPE_CMP_SIG, 128, 32); -} - -static void *dilithium3_pss3072_new_key(void *provctx) -{ - return oqsx_key_new(PROV_OQS_LIBCTX_OF(provctx), OQS_SIG_alg_dilithium_3, - "dilithium3_pss3072", KEY_TYPE_CMP_SIG, NULL, 128, 33); -} - -static void *dilithium3_pss3072_gen_init(void *provctx, int selection) -{ - return oqsx_gen_init(provctx, selection, OQS_SIG_alg_dilithium_3, - "dilithium3_pss3072", KEY_TYPE_CMP_SIG, 128, 33); -} - -static void *dilithium2_pss2048_new_key(void *provctx) -{ - return oqsx_key_new(PROV_OQS_LIBCTX_OF(provctx), OQS_SIG_alg_dilithium_2, - "dilithium2_pss2048", KEY_TYPE_CMP_SIG, NULL, 112, 34); -} - -static void *dilithium2_pss2048_gen_init(void *provctx, int selection) -{ - return oqsx_gen_init(provctx, selection, OQS_SIG_alg_dilithium_2, - "dilithium2_pss2048", KEY_TYPE_CMP_SIG, 112, 34); -} - -static void *dilithium2_rsa2048_new_key(void *provctx) -{ - return oqsx_key_new(PROV_OQS_LIBCTX_OF(provctx), OQS_SIG_alg_dilithium_2, - "dilithium2_rsa2048", KEY_TYPE_CMP_SIG, NULL, 112, 35); -} - -static void *dilithium2_rsa2048_gen_init(void *provctx, int selection) -{ - return oqsx_gen_init(provctx, selection, OQS_SIG_alg_dilithium_2, - "dilithium2_rsa2048", KEY_TYPE_CMP_SIG, 112, 35); -} - -static void *dilithium2_ed25519_new_key(void *provctx) -{ - return oqsx_key_new(PROV_OQS_LIBCTX_OF(provctx), OQS_SIG_alg_dilithium_2, - "dilithium2_ed25519", KEY_TYPE_CMP_SIG, NULL, 128, 36); -} - -static void *dilithium2_ed25519_gen_init(void *provctx, int selection) -{ - return oqsx_gen_init(provctx, selection, OQS_SIG_alg_dilithium_2, - "dilithium2_ed25519", KEY_TYPE_CMP_SIG, 128, 36); -} - -static void *dilithium2_p256_new_key(void *provctx) -{ - return oqsx_key_new(PROV_OQS_LIBCTX_OF(provctx), OQS_SIG_alg_dilithium_2, - "dilithium2_p256", KEY_TYPE_CMP_SIG, NULL, 128, 37); -} - -static void *dilithium2_p256_gen_init(void *provctx, int selection) -{ - return oqsx_gen_init(provctx, selection, OQS_SIG_alg_dilithium_2, - "dilithium2_p256", KEY_TYPE_CMP_SIG, 128, 37); -} - -static void *dilithium2_bp256_new_key(void *provctx) -{ - return oqsx_key_new(PROV_OQS_LIBCTX_OF(provctx), OQS_SIG_alg_dilithium_2, - "dilithium2_bp256", KEY_TYPE_CMP_SIG, NULL, 256, 38); -} - -static void *dilithium2_bp256_gen_init(void *provctx, int selection) -{ - return oqsx_gen_init(provctx, selection, OQS_SIG_alg_dilithium_2, - "dilithium2_bp256", KEY_TYPE_CMP_SIG, 256, 38); -} ///// OQS_TEMPLATE_FRAGMENT_KEYMGMT_CONSTRUCTORS_END #define MAKE_SIG_KEYMGMT_FUNCTIONS(alg) \ @@ -1206,13 +1191,29 @@ static void *dilithium2_bp256_gen_init(void *provctx, int selection) MAKE_SIG_KEYMGMT_FUNCTIONS(dilithium2) MAKE_SIG_KEYMGMT_FUNCTIONS(p256_dilithium2) MAKE_SIG_KEYMGMT_FUNCTIONS(rsa3072_dilithium2) +MAKE_SIG_KEYMGMT_FUNCTIONS(dilithium2_pss2048) +MAKE_SIG_KEYMGMT_FUNCTIONS(dilithium2_rsa2048) +MAKE_SIG_KEYMGMT_FUNCTIONS(dilithium2_ed25519) +MAKE_SIG_KEYMGMT_FUNCTIONS(dilithium2_p256) +MAKE_SIG_KEYMGMT_FUNCTIONS(dilithium2_bp256) MAKE_SIG_KEYMGMT_FUNCTIONS(dilithium3) MAKE_SIG_KEYMGMT_FUNCTIONS(p384_dilithium3) +MAKE_SIG_KEYMGMT_FUNCTIONS(dilithium3_pss3072) +MAKE_SIG_KEYMGMT_FUNCTIONS(dilithium3_rsa3072) +MAKE_SIG_KEYMGMT_FUNCTIONS(dilithium3_p256) +MAKE_SIG_KEYMGMT_FUNCTIONS(dilithium3_bp256) +MAKE_SIG_KEYMGMT_FUNCTIONS(dilithium3_ed25519) MAKE_SIG_KEYMGMT_FUNCTIONS(dilithium5) MAKE_SIG_KEYMGMT_FUNCTIONS(p521_dilithium5) +MAKE_SIG_KEYMGMT_FUNCTIONS(dilithium5_p384) +MAKE_SIG_KEYMGMT_FUNCTIONS(dilithium5_bp384) +MAKE_SIG_KEYMGMT_FUNCTIONS(dilithium5_ed448) MAKE_SIG_KEYMGMT_FUNCTIONS(falcon512) MAKE_SIG_KEYMGMT_FUNCTIONS(p256_falcon512) MAKE_SIG_KEYMGMT_FUNCTIONS(rsa3072_falcon512) +MAKE_SIG_KEYMGMT_FUNCTIONS(falcon512_p256) +MAKE_SIG_KEYMGMT_FUNCTIONS(falcon512_bp256) +MAKE_SIG_KEYMGMT_FUNCTIONS(falcon512_ed25519) MAKE_SIG_KEYMGMT_FUNCTIONS(falcon1024) MAKE_SIG_KEYMGMT_FUNCTIONS(p521_falcon1024) MAKE_SIG_KEYMGMT_FUNCTIONS(sphincssha2128fsimple) @@ -1226,22 +1227,6 @@ MAKE_SIG_KEYMGMT_FUNCTIONS(p384_sphincssha2192fsimple) MAKE_SIG_KEYMGMT_FUNCTIONS(sphincsshake128fsimple) MAKE_SIG_KEYMGMT_FUNCTIONS(p256_sphincsshake128fsimple) MAKE_SIG_KEYMGMT_FUNCTIONS(rsa3072_sphincsshake128fsimple) -MAKE_SIG_KEYMGMT_FUNCTIONS(dilithium3_rsa3072) -MAKE_SIG_KEYMGMT_FUNCTIONS(dilithium3_p256) -MAKE_SIG_KEYMGMT_FUNCTIONS(falcon512_p256) -MAKE_SIG_KEYMGMT_FUNCTIONS(dilithium5_p384) -MAKE_SIG_KEYMGMT_FUNCTIONS(dilithium3_bp256) -MAKE_SIG_KEYMGMT_FUNCTIONS(dilithium3_ed25519) -MAKE_SIG_KEYMGMT_FUNCTIONS(dilithium5_bp384) -MAKE_SIG_KEYMGMT_FUNCTIONS(dilithium5_ed448) -MAKE_SIG_KEYMGMT_FUNCTIONS(falcon512_bp256) -MAKE_SIG_KEYMGMT_FUNCTIONS(falcon512_ed25519) -MAKE_SIG_KEYMGMT_FUNCTIONS(dilithium3_pss3072) -MAKE_SIG_KEYMGMT_FUNCTIONS(dilithium2_pss2048) -MAKE_SIG_KEYMGMT_FUNCTIONS(dilithium2_rsa2048) -MAKE_SIG_KEYMGMT_FUNCTIONS(dilithium2_ed25519) -MAKE_SIG_KEYMGMT_FUNCTIONS(dilithium2_p256) -MAKE_SIG_KEYMGMT_FUNCTIONS(dilithium2_bp256) MAKE_KEM_KEYMGMT_FUNCTIONS(frodo640aes, OQS_KEM_alg_frodokem_640_aes, 128) diff --git a/oqsprov/oqs_prov.h b/oqsprov/oqs_prov.h index 79d5edaa..7192f60e 100644 --- a/oqsprov/oqs_prov.h +++ b/oqsprov/oqs_prov.h @@ -204,6 +204,7 @@ char *get_oqsname_fromtls(char *tlsname); char *get_oqsname(int nid); char *get_cmpname(int nid, int index); int get_oqsalg_idx(int nid); +int get_composite_idx(int idx); /* Register given NID with tlsname in OSSL3 registry */ int oqs_set_nid(char *tlsname, int nid); @@ -1007,6 +1008,91 @@ extern const OSSL_DISPATCH oqs_PrivateKeyInfo_der_to_rsa3072_dilithium2_decoder_functions[]; extern const OSSL_DISPATCH oqs_SubjectPublicKeyInfo_der_to_rsa3072_dilithium2_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_dilithium2_pss2048_to_PrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_dilithium2_pss2048_to_PrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_dilithium2_pss2048_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_dilithium2_pss2048_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_dilithium2_pss2048_to_SubjectPublicKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_dilithium2_pss2048_to_SubjectPublicKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH oqs_dilithium2_pss2048_to_text_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_PrivateKeyInfo_der_to_dilithium2_pss2048_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_SubjectPublicKeyInfo_der_to_dilithium2_pss2048_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_dilithium2_rsa2048_to_PrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_dilithium2_rsa2048_to_PrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_dilithium2_rsa2048_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_dilithium2_rsa2048_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_dilithium2_rsa2048_to_SubjectPublicKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_dilithium2_rsa2048_to_SubjectPublicKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH oqs_dilithium2_rsa2048_to_text_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_PrivateKeyInfo_der_to_dilithium2_rsa2048_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_SubjectPublicKeyInfo_der_to_dilithium2_rsa2048_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_dilithium2_ed25519_to_PrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_dilithium2_ed25519_to_PrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_dilithium2_ed25519_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_dilithium2_ed25519_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_dilithium2_ed25519_to_SubjectPublicKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_dilithium2_ed25519_to_SubjectPublicKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH oqs_dilithium2_ed25519_to_text_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_PrivateKeyInfo_der_to_dilithium2_ed25519_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_SubjectPublicKeyInfo_der_to_dilithium2_ed25519_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_dilithium2_p256_to_PrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_dilithium2_p256_to_PrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_dilithium2_p256_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_dilithium2_p256_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_dilithium2_p256_to_SubjectPublicKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_dilithium2_p256_to_SubjectPublicKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH oqs_dilithium2_p256_to_text_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_PrivateKeyInfo_der_to_dilithium2_p256_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_SubjectPublicKeyInfo_der_to_dilithium2_p256_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_dilithium2_bp256_to_PrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_dilithium2_bp256_to_PrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_dilithium2_bp256_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_dilithium2_bp256_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_dilithium2_bp256_to_SubjectPublicKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_dilithium2_bp256_to_SubjectPublicKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH oqs_dilithium2_bp256_to_text_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_PrivateKeyInfo_der_to_dilithium2_bp256_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_SubjectPublicKeyInfo_der_to_dilithium2_bp256_decoder_functions[]; extern const OSSL_DISPATCH oqs_dilithium3_to_PrivateKeyInfo_der_encoder_functions[]; extern const OSSL_DISPATCH @@ -1041,6 +1127,91 @@ extern const OSSL_DISPATCH oqs_PrivateKeyInfo_der_to_p384_dilithium3_decoder_functions[]; extern const OSSL_DISPATCH oqs_SubjectPublicKeyInfo_der_to_p384_dilithium3_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_dilithium3_pss3072_to_PrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_dilithium3_pss3072_to_PrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_dilithium3_pss3072_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_dilithium3_pss3072_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_dilithium3_pss3072_to_SubjectPublicKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_dilithium3_pss3072_to_SubjectPublicKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH oqs_dilithium3_pss3072_to_text_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_PrivateKeyInfo_der_to_dilithium3_pss3072_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_SubjectPublicKeyInfo_der_to_dilithium3_pss3072_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_dilithium3_rsa3072_to_PrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_dilithium3_rsa3072_to_PrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_dilithium3_rsa3072_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_dilithium3_rsa3072_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_dilithium3_rsa3072_to_SubjectPublicKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_dilithium3_rsa3072_to_SubjectPublicKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH oqs_dilithium3_rsa3072_to_text_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_PrivateKeyInfo_der_to_dilithium3_rsa3072_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_SubjectPublicKeyInfo_der_to_dilithium3_rsa3072_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_dilithium3_p256_to_PrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_dilithium3_p256_to_PrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_dilithium3_p256_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_dilithium3_p256_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_dilithium3_p256_to_SubjectPublicKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_dilithium3_p256_to_SubjectPublicKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH oqs_dilithium3_p256_to_text_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_PrivateKeyInfo_der_to_dilithium3_p256_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_SubjectPublicKeyInfo_der_to_dilithium3_p256_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_dilithium3_bp256_to_PrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_dilithium3_bp256_to_PrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_dilithium3_bp256_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_dilithium3_bp256_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_dilithium3_bp256_to_SubjectPublicKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_dilithium3_bp256_to_SubjectPublicKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH oqs_dilithium3_bp256_to_text_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_PrivateKeyInfo_der_to_dilithium3_bp256_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_SubjectPublicKeyInfo_der_to_dilithium3_bp256_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_dilithium3_ed25519_to_PrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_dilithium3_ed25519_to_PrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_dilithium3_ed25519_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_dilithium3_ed25519_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_dilithium3_ed25519_to_SubjectPublicKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_dilithium3_ed25519_to_SubjectPublicKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH oqs_dilithium3_ed25519_to_text_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_PrivateKeyInfo_der_to_dilithium3_ed25519_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_SubjectPublicKeyInfo_der_to_dilithium3_ed25519_decoder_functions[]; extern const OSSL_DISPATCH oqs_dilithium5_to_PrivateKeyInfo_der_encoder_functions[]; extern const OSSL_DISPATCH @@ -1075,6 +1246,57 @@ extern const OSSL_DISPATCH oqs_PrivateKeyInfo_der_to_p521_dilithium5_decoder_functions[]; extern const OSSL_DISPATCH oqs_SubjectPublicKeyInfo_der_to_p521_dilithium5_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_dilithium5_p384_to_PrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_dilithium5_p384_to_PrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_dilithium5_p384_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_dilithium5_p384_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_dilithium5_p384_to_SubjectPublicKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_dilithium5_p384_to_SubjectPublicKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH oqs_dilithium5_p384_to_text_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_PrivateKeyInfo_der_to_dilithium5_p384_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_SubjectPublicKeyInfo_der_to_dilithium5_p384_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_dilithium5_bp384_to_PrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_dilithium5_bp384_to_PrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_dilithium5_bp384_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_dilithium5_bp384_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_dilithium5_bp384_to_SubjectPublicKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_dilithium5_bp384_to_SubjectPublicKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH oqs_dilithium5_bp384_to_text_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_PrivateKeyInfo_der_to_dilithium5_bp384_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_SubjectPublicKeyInfo_der_to_dilithium5_bp384_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_dilithium5_ed448_to_PrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_dilithium5_ed448_to_PrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_dilithium5_ed448_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_dilithium5_ed448_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_dilithium5_ed448_to_SubjectPublicKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_dilithium5_ed448_to_SubjectPublicKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH oqs_dilithium5_ed448_to_text_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_PrivateKeyInfo_der_to_dilithium5_ed448_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_SubjectPublicKeyInfo_der_to_dilithium5_ed448_decoder_functions[]; extern const OSSL_DISPATCH oqs_falcon512_to_PrivateKeyInfo_der_encoder_functions[]; extern const OSSL_DISPATCH @@ -1127,39 +1349,90 @@ extern const OSSL_DISPATCH extern const OSSL_DISPATCH oqs_SubjectPublicKeyInfo_der_to_rsa3072_falcon512_decoder_functions[]; extern const OSSL_DISPATCH - oqs_falcon1024_to_PrivateKeyInfo_der_encoder_functions[]; + oqs_falcon512_p256_to_PrivateKeyInfo_der_encoder_functions[]; extern const OSSL_DISPATCH - oqs_falcon1024_to_PrivateKeyInfo_pem_encoder_functions[]; + oqs_falcon512_p256_to_PrivateKeyInfo_pem_encoder_functions[]; extern const OSSL_DISPATCH - oqs_falcon1024_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; + oqs_falcon512_p256_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; extern const OSSL_DISPATCH - oqs_falcon1024_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; + oqs_falcon512_p256_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; extern const OSSL_DISPATCH - oqs_falcon1024_to_SubjectPublicKeyInfo_der_encoder_functions[]; + oqs_falcon512_p256_to_SubjectPublicKeyInfo_der_encoder_functions[]; extern const OSSL_DISPATCH - oqs_falcon1024_to_SubjectPublicKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_falcon1024_to_text_encoder_functions[]; + oqs_falcon512_p256_to_SubjectPublicKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH oqs_falcon512_p256_to_text_encoder_functions[]; extern const OSSL_DISPATCH - oqs_PrivateKeyInfo_der_to_falcon1024_decoder_functions[]; + oqs_PrivateKeyInfo_der_to_falcon512_p256_decoder_functions[]; extern const OSSL_DISPATCH - oqs_SubjectPublicKeyInfo_der_to_falcon1024_decoder_functions[]; + oqs_SubjectPublicKeyInfo_der_to_falcon512_p256_decoder_functions[]; extern const OSSL_DISPATCH - oqs_p521_falcon1024_to_PrivateKeyInfo_der_encoder_functions[]; + oqs_falcon512_bp256_to_PrivateKeyInfo_der_encoder_functions[]; extern const OSSL_DISPATCH - oqs_p521_falcon1024_to_PrivateKeyInfo_pem_encoder_functions[]; + oqs_falcon512_bp256_to_PrivateKeyInfo_pem_encoder_functions[]; extern const OSSL_DISPATCH - oqs_p521_falcon1024_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; + oqs_falcon512_bp256_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; extern const OSSL_DISPATCH - oqs_p521_falcon1024_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; + oqs_falcon512_bp256_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; extern const OSSL_DISPATCH - oqs_p521_falcon1024_to_SubjectPublicKeyInfo_der_encoder_functions[]; + oqs_falcon512_bp256_to_SubjectPublicKeyInfo_der_encoder_functions[]; extern const OSSL_DISPATCH - oqs_p521_falcon1024_to_SubjectPublicKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_p521_falcon1024_to_text_encoder_functions[]; + oqs_falcon512_bp256_to_SubjectPublicKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH oqs_falcon512_bp256_to_text_encoder_functions[]; extern const OSSL_DISPATCH - oqs_PrivateKeyInfo_der_to_p521_falcon1024_decoder_functions[]; + oqs_PrivateKeyInfo_der_to_falcon512_bp256_decoder_functions[]; extern const OSSL_DISPATCH - oqs_SubjectPublicKeyInfo_der_to_p521_falcon1024_decoder_functions[]; + oqs_SubjectPublicKeyInfo_der_to_falcon512_bp256_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_falcon512_ed25519_to_PrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_falcon512_ed25519_to_PrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_falcon512_ed25519_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_falcon512_ed25519_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_falcon512_ed25519_to_SubjectPublicKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_falcon512_ed25519_to_SubjectPublicKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH oqs_falcon512_ed25519_to_text_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_PrivateKeyInfo_der_to_falcon512_ed25519_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_SubjectPublicKeyInfo_der_to_falcon512_ed25519_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_falcon1024_to_PrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_falcon1024_to_PrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_falcon1024_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_falcon1024_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_falcon1024_to_SubjectPublicKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_falcon1024_to_SubjectPublicKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH oqs_falcon1024_to_text_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_PrivateKeyInfo_der_to_falcon1024_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_SubjectPublicKeyInfo_der_to_falcon1024_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_p521_falcon1024_to_PrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_p521_falcon1024_to_PrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_p521_falcon1024_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_p521_falcon1024_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_p521_falcon1024_to_SubjectPublicKeyInfo_der_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_p521_falcon1024_to_SubjectPublicKeyInfo_pem_encoder_functions[]; +extern const OSSL_DISPATCH oqs_p521_falcon1024_to_text_encoder_functions[]; +extern const OSSL_DISPATCH + oqs_PrivateKeyInfo_der_to_p521_falcon1024_decoder_functions[]; +extern const OSSL_DISPATCH + oqs_SubjectPublicKeyInfo_der_to_p521_falcon1024_decoder_functions[]; extern const OSSL_DISPATCH oqs_sphincssha2128fsimple_to_PrivateKeyInfo_der_encoder_functions[]; extern const OSSL_DISPATCH @@ -1404,292 +1677,35 @@ extern const OSSL_DISPATCH extern const OSSL_DISPATCH oqs_SubjectPublicKeyInfo_der_to_rsa3072_sphincsshake128fsimple_decoder_functions []; - -extern const OSSL_DISPATCH - oqs_dilithium3_rsa3072_to_PrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH - oqs_dilithium3_rsa3072_to_PrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH - oqs_dilithium3_rsa3072_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH - oqs_dilithium3_rsa3072_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH - oqs_dilithium3_rsa3072_to_SubjectPublicKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH - oqs_dilithium3_rsa3072_to_SubjectPublicKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_dilithium3_rsa3072_to_text_encoder_functions[]; -extern const OSSL_DISPATCH - oqs_PrivateKeyInfo_der_to_dilithium3_rsa3072_decoder_functions[]; -extern const OSSL_DISPATCH - oqs_SubjectPublicKeyInfo_der_to_dilithium3_rsa3072_decoder_functions[]; -extern const OSSL_DISPATCH - oqs_dilithium3_p256_to_PrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH - oqs_dilithium3_p256_to_PrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH - oqs_dilithium3_p256_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH - oqs_dilithium3_p256_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH - oqs_dilithium3_p256_to_SubjectPublicKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH - oqs_dilithium3_p256_to_SubjectPublicKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_dilithium3_p256_to_text_encoder_functions[]; -extern const OSSL_DISPATCH - oqs_PrivateKeyInfo_der_to_dilithium3_p256_decoder_functions[]; -extern const OSSL_DISPATCH - oqs_SubjectPublicKeyInfo_der_to_dilithium3_p256_decoder_functions[]; -extern const OSSL_DISPATCH - oqs_falcon512_p256_to_PrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH - oqs_falcon512_p256_to_PrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH - oqs_falcon512_p256_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH - oqs_falcon512_p256_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH - oqs_falcon512_p256_to_SubjectPublicKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH - oqs_falcon512_p256_to_SubjectPublicKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_falcon512_p256_to_text_encoder_functions[]; -extern const OSSL_DISPATCH - oqs_PrivateKeyInfo_der_to_falcon512_p256_decoder_functions[]; -extern const OSSL_DISPATCH - oqs_SubjectPublicKeyInfo_der_to_falcon512_p256_decoder_functions[]; -extern const OSSL_DISPATCH - oqs_dilithium5_p384_to_PrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH - oqs_dilithium5_p384_to_PrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH - oqs_dilithium5_p384_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH - oqs_dilithium5_p384_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH - oqs_dilithium5_p384_to_SubjectPublicKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH - oqs_dilithium5_p384_to_SubjectPublicKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_dilithium5_p384_to_text_encoder_functions[]; -extern const OSSL_DISPATCH - oqs_PrivateKeyInfo_der_to_dilithium5_p384_decoder_functions[]; -extern const OSSL_DISPATCH - oqs_SubjectPublicKeyInfo_der_to_dilithium5_p384_decoder_functions[]; -extern const OSSL_DISPATCH - oqs_dilithium3_bp256_to_PrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH - oqs_dilithium3_bp256_to_PrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH - oqs_dilithium3_bp256_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH - oqs_dilithium3_bp256_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH - oqs_dilithium3_bp256_to_SubjectPublicKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH - oqs_dilithium3_bp256_to_SubjectPublicKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_dilithium3_bp256_to_text_encoder_functions[]; -extern const OSSL_DISPATCH - oqs_PrivateKeyInfo_der_to_dilithium3_bp256_decoder_functions[]; -extern const OSSL_DISPATCH - oqs_SubjectPublicKeyInfo_der_to_dilithium3_bp256_decoder_functions[]; -extern const OSSL_DISPATCH - oqs_dilithium3_ed25519_to_PrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH - oqs_dilithium3_ed25519_to_PrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH - oqs_dilithium3_ed25519_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH - oqs_dilithium3_ed25519_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH - oqs_dilithium3_ed25519_to_SubjectPublicKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH - oqs_dilithium3_ed25519_to_SubjectPublicKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_dilithium3_ed25519_to_text_encoder_functions[]; -extern const OSSL_DISPATCH - oqs_PrivateKeyInfo_der_to_dilithium3_ed25519_decoder_functions[]; -extern const OSSL_DISPATCH - oqs_SubjectPublicKeyInfo_der_to_dilithium3_ed25519_decoder_functions[]; -extern const OSSL_DISPATCH - oqs_dilithium5_bp384_to_PrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH - oqs_dilithium5_bp384_to_PrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH - oqs_dilithium5_bp384_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH - oqs_dilithium5_bp384_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH - oqs_dilithium5_bp384_to_SubjectPublicKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH - oqs_dilithium5_bp384_to_SubjectPublicKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_dilithium5_bp384_to_text_encoder_functions[]; -extern const OSSL_DISPATCH - oqs_PrivateKeyInfo_der_to_dilithium5_bp384_decoder_functions[]; -extern const OSSL_DISPATCH - oqs_SubjectPublicKeyInfo_der_to_dilithium5_bp384_decoder_functions[]; -extern const OSSL_DISPATCH - oqs_dilithium5_ed448_to_PrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH - oqs_dilithium5_ed448_to_PrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH - oqs_dilithium5_ed448_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH - oqs_dilithium5_ed448_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH - oqs_dilithium5_ed448_to_SubjectPublicKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH - oqs_dilithium5_ed448_to_SubjectPublicKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_dilithium5_ed448_to_text_encoder_functions[]; -extern const OSSL_DISPATCH - oqs_PrivateKeyInfo_der_to_dilithium5_ed448_decoder_functions[]; -extern const OSSL_DISPATCH - oqs_SubjectPublicKeyInfo_der_to_dilithium5_ed448_decoder_functions[]; -extern const OSSL_DISPATCH - oqs_falcon512_bp256_to_PrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH - oqs_falcon512_bp256_to_PrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH - oqs_falcon512_bp256_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH - oqs_falcon512_bp256_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH - oqs_falcon512_bp256_to_SubjectPublicKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH - oqs_falcon512_bp256_to_SubjectPublicKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_falcon512_bp256_to_text_encoder_functions[]; -extern const OSSL_DISPATCH - oqs_PrivateKeyInfo_der_to_falcon512_bp256_decoder_functions[]; -extern const OSSL_DISPATCH - oqs_SubjectPublicKeyInfo_der_to_falcon512_bp256_decoder_functions[]; -extern const OSSL_DISPATCH - oqs_falcon512_ed25519_to_PrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH - oqs_falcon512_ed25519_to_PrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH - oqs_falcon512_ed25519_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH - oqs_falcon512_ed25519_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH - oqs_falcon512_ed25519_to_SubjectPublicKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH - oqs_falcon512_ed25519_to_SubjectPublicKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_falcon512_ed25519_to_text_encoder_functions[]; -extern const OSSL_DISPATCH - oqs_PrivateKeyInfo_der_to_falcon512_ed25519_decoder_functions[]; -extern const OSSL_DISPATCH - oqs_SubjectPublicKeyInfo_der_to_falcon512_ed25519_decoder_functions[]; -extern const OSSL_DISPATCH - oqs_dilithium3_pss3072_to_PrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH - oqs_dilithium3_pss3072_to_PrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH - oqs_dilithium3_pss3072_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH - oqs_dilithium3_pss3072_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH - oqs_dilithium3_pss3072_to_SubjectPublicKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH - oqs_dilithium3_pss3072_to_SubjectPublicKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_dilithium3_pss3072_to_text_encoder_functions[]; -extern const OSSL_DISPATCH - oqs_PrivateKeyInfo_der_to_dilithium3_pss3072_decoder_functions[]; -extern const OSSL_DISPATCH - oqs_SubjectPublicKeyInfo_der_to_dilithium3_pss3072_decoder_functions[]; -extern const OSSL_DISPATCH - oqs_dilithium2_pss2048_to_PrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH - oqs_dilithium2_pss2048_to_PrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH - oqs_dilithium2_pss2048_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH - oqs_dilithium2_pss2048_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH - oqs_dilithium2_pss2048_to_SubjectPublicKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH - oqs_dilithium2_pss2048_to_SubjectPublicKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_dilithium2_pss2048_to_text_encoder_functions[]; -extern const OSSL_DISPATCH - oqs_PrivateKeyInfo_der_to_dilithium2_pss2048_decoder_functions[]; -extern const OSSL_DISPATCH - oqs_SubjectPublicKeyInfo_der_to_dilithium2_pss2048_decoder_functions[]; -extern const OSSL_DISPATCH - oqs_dilithium2_rsa2048_to_PrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH - oqs_dilithium2_rsa2048_to_PrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH - oqs_dilithium2_rsa2048_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH - oqs_dilithium2_rsa2048_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH - oqs_dilithium2_rsa2048_to_SubjectPublicKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH - oqs_dilithium2_rsa2048_to_SubjectPublicKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_dilithium2_rsa2048_to_text_encoder_functions[]; -extern const OSSL_DISPATCH - oqs_PrivateKeyInfo_der_to_dilithium2_rsa2048_decoder_functions[]; -extern const OSSL_DISPATCH - oqs_SubjectPublicKeyInfo_der_to_dilithium2_rsa2048_decoder_functions[]; -extern const OSSL_DISPATCH - oqs_dilithium2_ed25519_to_PrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH - oqs_dilithium2_ed25519_to_PrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH - oqs_dilithium2_ed25519_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH - oqs_dilithium2_ed25519_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH - oqs_dilithium2_ed25519_to_SubjectPublicKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH - oqs_dilithium2_ed25519_to_SubjectPublicKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_dilithium2_ed25519_to_text_encoder_functions[]; -extern const OSSL_DISPATCH - oqs_PrivateKeyInfo_der_to_dilithium2_ed25519_decoder_functions[]; -extern const OSSL_DISPATCH - oqs_SubjectPublicKeyInfo_der_to_dilithium2_ed25519_decoder_functions[]; -extern const OSSL_DISPATCH - oqs_dilithium2_p256_to_PrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH - oqs_dilithium2_p256_to_PrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH - oqs_dilithium2_p256_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH - oqs_dilithium2_p256_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH - oqs_dilithium2_p256_to_SubjectPublicKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH - oqs_dilithium2_p256_to_SubjectPublicKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_dilithium2_p256_to_text_encoder_functions[]; -extern const OSSL_DISPATCH - oqs_PrivateKeyInfo_der_to_dilithium2_p256_decoder_functions[]; -extern const OSSL_DISPATCH - oqs_SubjectPublicKeyInfo_der_to_dilithium2_p256_decoder_functions[]; -extern const OSSL_DISPATCH - oqs_dilithium2_bp256_to_PrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH - oqs_dilithium2_bp256_to_PrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH - oqs_dilithium2_bp256_to_EncryptedPrivateKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH - oqs_dilithium2_bp256_to_EncryptedPrivateKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH - oqs_dilithium2_bp256_to_SubjectPublicKeyInfo_der_encoder_functions[]; -extern const OSSL_DISPATCH - oqs_dilithium2_bp256_to_SubjectPublicKeyInfo_pem_encoder_functions[]; -extern const OSSL_DISPATCH oqs_dilithium2_bp256_to_text_encoder_functions[]; -extern const OSSL_DISPATCH - oqs_PrivateKeyInfo_der_to_dilithium2_bp256_decoder_functions[]; -extern const OSSL_DISPATCH - oqs_SubjectPublicKeyInfo_der_to_dilithium2_bp256_decoder_functions[]; ///// OQS_TEMPLATE_FRAGMENT_ENDECODER_FUNCTIONS_END ///// OQS_TEMPLATE_FRAGMENT_ALG_FUNCTIONS_START extern const OSSL_DISPATCH oqs_dilithium2_keymgmt_functions[]; extern const OSSL_DISPATCH oqs_p256_dilithium2_keymgmt_functions[]; extern const OSSL_DISPATCH oqs_rsa3072_dilithium2_keymgmt_functions[]; +extern const OSSL_DISPATCH oqs_dilithium2_pss2048_keymgmt_functions[]; +extern const OSSL_DISPATCH oqs_dilithium2_rsa2048_keymgmt_functions[]; +extern const OSSL_DISPATCH oqs_dilithium2_ed25519_keymgmt_functions[]; +extern const OSSL_DISPATCH oqs_dilithium2_p256_keymgmt_functions[]; +extern const OSSL_DISPATCH oqs_dilithium2_bp256_keymgmt_functions[]; extern const OSSL_DISPATCH oqs_dilithium3_keymgmt_functions[]; extern const OSSL_DISPATCH oqs_p384_dilithium3_keymgmt_functions[]; +extern const OSSL_DISPATCH oqs_dilithium3_pss3072_keymgmt_functions[]; +extern const OSSL_DISPATCH oqs_dilithium3_rsa3072_keymgmt_functions[]; +extern const OSSL_DISPATCH oqs_dilithium3_p256_keymgmt_functions[]; +extern const OSSL_DISPATCH oqs_dilithium3_bp256_keymgmt_functions[]; +extern const OSSL_DISPATCH oqs_dilithium3_ed25519_keymgmt_functions[]; extern const OSSL_DISPATCH oqs_dilithium5_keymgmt_functions[]; extern const OSSL_DISPATCH oqs_p521_dilithium5_keymgmt_functions[]; +extern const OSSL_DISPATCH oqs_dilithium5_p384_keymgmt_functions[]; +extern const OSSL_DISPATCH oqs_dilithium5_bp384_keymgmt_functions[]; +extern const OSSL_DISPATCH oqs_dilithium5_ed448_keymgmt_functions[]; extern const OSSL_DISPATCH oqs_falcon512_keymgmt_functions[]; extern const OSSL_DISPATCH oqs_p256_falcon512_keymgmt_functions[]; extern const OSSL_DISPATCH oqs_rsa3072_falcon512_keymgmt_functions[]; +extern const OSSL_DISPATCH oqs_falcon512_p256_keymgmt_functions[]; +extern const OSSL_DISPATCH oqs_falcon512_bp256_keymgmt_functions[]; +extern const OSSL_DISPATCH oqs_falcon512_ed25519_keymgmt_functions[]; extern const OSSL_DISPATCH oqs_falcon1024_keymgmt_functions[]; extern const OSSL_DISPATCH oqs_p521_falcon1024_keymgmt_functions[]; extern const OSSL_DISPATCH oqs_sphincssha2128fsimple_keymgmt_functions[]; @@ -1706,22 +1722,6 @@ extern const OSSL_DISPATCH oqs_sphincsshake128fsimple_keymgmt_functions[]; extern const OSSL_DISPATCH oqs_p256_sphincsshake128fsimple_keymgmt_functions[]; extern const OSSL_DISPATCH oqs_rsa3072_sphincsshake128fsimple_keymgmt_functions[]; -extern const OSSL_DISPATCH oqs_dilithium3_rsa3072_keymgmt_functions[]; -extern const OSSL_DISPATCH oqs_dilithium3_p256_keymgmt_functions[]; -extern const OSSL_DISPATCH oqs_falcon512_p256_keymgmt_functions[]; -extern const OSSL_DISPATCH oqs_dilithium5_p384_keymgmt_functions[]; -extern const OSSL_DISPATCH oqs_dilithium3_bp256_keymgmt_functions[]; -extern const OSSL_DISPATCH oqs_dilithium3_ed25519_keymgmt_functions[]; -extern const OSSL_DISPATCH oqs_dilithium5_bp384_keymgmt_functions[]; -extern const OSSL_DISPATCH oqs_dilithium5_ed448_keymgmt_functions[]; -extern const OSSL_DISPATCH oqs_falcon512_bp256_keymgmt_functions[]; -extern const OSSL_DISPATCH oqs_falcon512_ed25519_keymgmt_functions[]; -extern const OSSL_DISPATCH oqs_dilithium3_pss3072_keymgmt_functions[]; -extern const OSSL_DISPATCH oqs_dilithium2_pss2048_keymgmt_functions[]; -extern const OSSL_DISPATCH oqs_dilithium2_rsa2048_keymgmt_functions[]; -extern const OSSL_DISPATCH oqs_dilithium2_ed25519_keymgmt_functions[]; -extern const OSSL_DISPATCH oqs_dilithium2_p256_keymgmt_functions[]; -extern const OSSL_DISPATCH oqs_dilithium2_bp256_keymgmt_functions[]; extern const OSSL_DISPATCH oqs_frodo640aes_keymgmt_functions[]; diff --git a/oqsprov/oqs_sig.c b/oqsprov/oqs_sig.c index 1dddeb4e..b4785056 100644 --- a/oqsprov/oqs_sig.c +++ b/oqsprov/oqs_sig.c @@ -27,12 +27,6 @@ // TBD: Review what we really need/want: For now go with OSSL settings: #define OSSL_MAX_NAME_SIZE 50 #define OSSL_MAX_PROPQUERY_SIZE 256 /* Property query strings */ -#ifdef OQS_KEM_ENCODERS /*idx to the first composite in the composite idx \ - block*/ -# define COMPOSITE_IDX_ADJUST 65 -#else -# define COMPOSITE_IDX_ADJUST 23 -#endif #ifdef NDEBUG # define OQS_SIG_PRINTF(a) @@ -219,42 +213,45 @@ static int oqs_sig_verify_init(void *vpoqs_sigctx, void *voqssig, return oqs_sig_signverify_init(vpoqs_sigctx, voqssig, EVP_PKEY_OP_VERIFY); } +// this next two list need to be in order of the last number on the OID from the +// composite static const char *composite_OID_prefix[] = { + "69642D4D4C44534134342D525341323034382D5053532D534841323536", // dilithium2_pss2048 + "69642D4D4C44534134342D525341323034382D504B435331352D534841323536", // dilithium2_rsa2048 + "69642D4D4C44534134342D456432353531392D534841353132", // dilithium2_ed25519 + "69642D4D4C44534134342D45434453412D503235362D534841323536", // dilithium2_p256 + "69642D4D4C44534134342D45434453412D627261696E706F6F6C5032353672312D534841323536", // dilithium2_bp256 + "69642D4D4C44534136352D525341333037322D5053532D534841323536", // dilithium3_pss3072 "69642D4D4C44534136352D525341333037322D504B435331352D534841323536", // dilithium3_rsa3072 "69642D4D4C44534136352D45434453412D503235362D534841323536", // dilithium3_p256 - "69642D46616C6F6E3531322D45434453412D503235362D534841323536", // falcon512_p256 - "69642D4D4C44534138372D45434453412D503338342D534841333834", // dilithium5_p384 "69642D4D4C44534136352D45434453412D627261696E706F6F6C5032353672312D534841323536", // dilithium3_bp256 "69642D4D4C44534136352D456432353531392D534841353132", // dilithium3_ed25519 + "69642D4D4C44534138372D45434453412D503338342D534841333834", // dilithium5_p384 "69642D4D4C44534138372D45434453412D627261696E706F6F6C5033383472312D534841333834", // dilithium5_bp384 "69642D4D4C44534138372D45643434382D5348414B45323536", // dilithium5_ed448 + "69642D46616C6F6E3531322D45434453412D503235362D534841323536", // falcon512_p256 "69642D46616C636F6E3531322D45434453412D627261696E706F6F6C5032353672312D534841323536", // falcon512_bp256 "69642D46616C636F6E3531322D456432353531392D534841353132", // falcon512_ed25519 - "69642D4D4C44534136352D525341333037322D5053532D534841323536", // dilithium3_pss3072 - "69642D4D4C44534134342D525341323034382D5053532D534841323536", // dilithium2_pss2048 - "69642D4D4C44534134342D525341323034382D504B435331352D534841323536", // dilithium2_rsa2048 - "69642D4D4C44534134342D456432353531392D534841353132", // dilithium2_ed25519 - "69642D4D4C44534134342D45434453412D503235362D534841323536", // dilithium2_p256 - "69642D4D4C44534134342D45434453412D627261696E706F6F6C5032353672312D534841323536", // dilithium2_bp256 + }; static const size_t composite_OID_prefix_len[] = { + 58, // dilithium2_pss2048 + 64, // dilithium2_rsa2048 + 50, // dilithium2_ed25519 + 56, // dilithium2_p256 + 78, // dilithium2_bp256 + 58, // dilithium3_pss3072 64, // dilithium3_rsa3072 56, // dilithium3_p256 - 58, // falcon512_p256 - 56, // dilithium5_p384 78, // dilithium3_bp256 50, // dilithium3_ed25519 + 56, // dilithium5_p384 78, // dilithium5_bp384 50, // dilithium5_ed448 + 58, // falcon512_p256 82, // falcon512_bp256 54, // falcon512_ed25519 - 58, // dilithium3_pss3072 - 58, // dilithium2_pss2048 - 64, // dilithium2_rsa2048 - 50, // dilithium2_ed25519 - 56, // dilithium2_p256 - 78, // dilithium2_bp256 }; /* On entry to this function, data to be signed (tbs) might have been hashed @@ -389,10 +386,10 @@ static int oqs_sig_sign(void *vpoqs_sigctx, unsigned char *sig, size_t *siglen, int i; int nid = OBJ_sn2nid(oqsxkey->tls_name); const char *oid_prefix - = composite_OID_prefix[get_oqsalg_idx(nid) - COMPOSITE_IDX_ADJUST]; + = composite_OID_prefix[get_composite_idx(get_oqsalg_idx(nid)) - 1]; const size_t oid_prefix_len - = composite_OID_prefix_len[get_oqsalg_idx(nid) - - COMPOSITE_IDX_ADJUST]; + = composite_OID_prefix_len[get_composite_idx(get_oqsalg_idx(nid)) + - 1]; char *final_tbs; size_t final_tbslen = oid_prefix_len; @@ -751,10 +748,10 @@ static int oqs_sig_verify(void *vpoqs_sigctx, const unsigned char *sig, unsigned char *buf; size_t buf_len; const char *oid_prefix - = composite_OID_prefix[get_oqsalg_idx(nid) - COMPOSITE_IDX_ADJUST]; + = composite_OID_prefix[get_composite_idx(get_oqsalg_idx(nid)) - 1]; const size_t oid_prefix_len - = composite_OID_prefix_len[get_oqsalg_idx(nid) - - COMPOSITE_IDX_ADJUST]; + = composite_OID_prefix_len[get_composite_idx(get_oqsalg_idx(nid)) + - 1]; char *final_tbs; size_t final_tbslen = oid_prefix_len; diff --git a/oqsprov/oqsdecoders.inc b/oqsprov/oqsdecoders.inc index 17d73480..3496d68d 100644 --- a/oqsprov/oqsdecoders.inc +++ b/oqsprov/oqsdecoders.inc @@ -203,22 +203,10 @@ DECODER_w_structure("frodo640aes", der, PrivateKeyInfo, frodo640aes), dilithium2_pss2048), DECODER_w_structure("dilithium2_pss2048", der, SubjectPublicKeyInfo, dilithium2_pss2048), - DECODER_w_structure("dilithium2_pss2048", der, PrivateKeyInfo, - dilithium2_pss2048), - DECODER_w_structure("dilithium2_pss2048", der, SubjectPublicKeyInfo, - dilithium2_pss2048), DECODER_w_structure("dilithium2_rsa2048", der, PrivateKeyInfo, dilithium2_rsa2048), DECODER_w_structure("dilithium2_rsa2048", der, SubjectPublicKeyInfo, dilithium2_rsa2048), - DECODER_w_structure("dilithium2_rsa2048", der, PrivateKeyInfo, - dilithium2_rsa2048), - DECODER_w_structure("dilithium2_rsa2048", der, SubjectPublicKeyInfo, - dilithium2_rsa2048), - DECODER_w_structure("dilithium2_ed25519", der, PrivateKeyInfo, - dilithium2_ed25519), - DECODER_w_structure("dilithium2_ed25519", der, SubjectPublicKeyInfo, - dilithium2_ed25519), DECODER_w_structure("dilithium2_ed25519", der, PrivateKeyInfo, dilithium2_ed25519), DECODER_w_structure("dilithium2_ed25519", der, SubjectPublicKeyInfo, @@ -227,14 +215,6 @@ DECODER_w_structure("frodo640aes", der, PrivateKeyInfo, frodo640aes), dilithium2_p256), DECODER_w_structure("dilithium2_p256", der, SubjectPublicKeyInfo, dilithium2_p256), - DECODER_w_structure("dilithium2_p256", der, PrivateKeyInfo, - dilithium2_p256), - DECODER_w_structure("dilithium2_p256", der, SubjectPublicKeyInfo, - dilithium2_p256), - DECODER_w_structure("dilithium2_bp256", der, PrivateKeyInfo, - dilithium2_bp256), - DECODER_w_structure("dilithium2_bp256", der, SubjectPublicKeyInfo, - dilithium2_bp256), DECODER_w_structure("dilithium2_bp256", der, PrivateKeyInfo, dilithium2_bp256), DECODER_w_structure("dilithium2_bp256", der, SubjectPublicKeyInfo, @@ -247,10 +227,10 @@ DECODER_w_structure("frodo640aes", der, PrivateKeyInfo, frodo640aes), p384_dilithium3), DECODER_w_structure("p384_dilithium3", der, SubjectPublicKeyInfo, p384_dilithium3), - DECODER_w_structure("dilithium3_rsa3072", der, SubjectPublicKeyInfo, - dilithium3_rsa3072), - DECODER_w_structure("dilithium3_p256", der, SubjectPublicKeyInfo, - dilithium3_p256), + DECODER_w_structure("dilithium3_pss3072", der, PrivateKeyInfo, + dilithium3_pss3072), + DECODER_w_structure("dilithium3_pss3072", der, SubjectPublicKeyInfo, + dilithium3_pss3072), DECODER_w_structure("dilithium3_rsa3072", der, PrivateKeyInfo, dilithium3_rsa3072), DECODER_w_structure("dilithium3_rsa3072", der, SubjectPublicKeyInfo, @@ -267,11 +247,6 @@ DECODER_w_structure("frodo640aes", der, PrivateKeyInfo, frodo640aes), dilithium3_ed25519), DECODER_w_structure("dilithium3_ed25519", der, SubjectPublicKeyInfo, dilithium3_ed25519), - DECODER_w_structure("dilithium3_pss3072", der, PrivateKeyInfo, - dilithium3_pss3072), - DECODER_w_structure("dilithium3_pss3072", der, SubjectPublicKeyInfo, - dilithium3_pss3072), - #endif #ifdef OQS_ENABLE_SIG_dilithium_5 DECODER_w_structure("dilithium5", der, PrivateKeyInfo, dilithium5), @@ -303,8 +278,6 @@ DECODER_w_structure("frodo640aes", der, PrivateKeyInfo, frodo640aes), rsa3072_falcon512), DECODER_w_structure("rsa3072_falcon512", der, SubjectPublicKeyInfo, rsa3072_falcon512), - DECODER_w_structure("falcon512_p256", der, SubjectPublicKeyInfo, - falcon512_p256), DECODER_w_structure("falcon512_p256", der, PrivateKeyInfo, falcon512_p256), DECODER_w_structure("falcon512_p256", der, SubjectPublicKeyInfo, falcon512_p256), diff --git a/oqsprov/oqsencoders.inc b/oqsprov/oqsencoders.inc index 165fb62d..88729583 100644 --- a/oqsprov/oqsencoders.inc +++ b/oqsprov/oqsencoders.inc @@ -665,6 +665,19 @@ ENCODER_w_structure("frodo640aes", frodo640aes, der, PrivateKeyInfo), ENCODER_w_structure("p384_dilithium3", p384_dilithium3, pem, SubjectPublicKeyInfo), ENCODER_TEXT("p384_dilithium3", p384_dilithium3), + ENCODER_w_structure("dilithium3_pss3072", dilithium3_pss3072, der, + PrivateKeyInfo), + ENCODER_w_structure("dilithium3_pss3072", dilithium3_pss3072, pem, + PrivateKeyInfo), + ENCODER_w_structure("dilithium3_pss3072", dilithium3_pss3072, der, + EncryptedPrivateKeyInfo), + ENCODER_w_structure("dilithium3_pss3072", dilithium3_pss3072, pem, + EncryptedPrivateKeyInfo), + ENCODER_w_structure("dilithium3_pss3072", dilithium3_pss3072, der, + SubjectPublicKeyInfo), + ENCODER_w_structure("dilithium3_pss3072", dilithium3_pss3072, pem, + SubjectPublicKeyInfo), + ENCODER_TEXT("dilithium3_pss3072", dilithium3_pss3072), ENCODER_w_structure("dilithium3_rsa3072", dilithium3_rsa3072, der, PrivateKeyInfo), ENCODER_w_structure("dilithium3_rsa3072", dilithium3_rsa3072, pem, @@ -717,20 +730,6 @@ ENCODER_w_structure("frodo640aes", frodo640aes, der, PrivateKeyInfo), ENCODER_w_structure("dilithium3_ed25519", dilithium3_ed25519, pem, SubjectPublicKeyInfo), ENCODER_TEXT("dilithium3_ed25519", dilithium3_ed25519), - ENCODER_w_structure("dilithium3_pss3072", dilithium3_pss3072, der, - PrivateKeyInfo), - ENCODER_w_structure("dilithium3_pss3072", dilithium3_pss3072, pem, - PrivateKeyInfo), - ENCODER_w_structure("dilithium3_pss3072", dilithium3_pss3072, der, - EncryptedPrivateKeyInfo), - ENCODER_w_structure("dilithium3_pss3072", dilithium3_pss3072, pem, - EncryptedPrivateKeyInfo), - ENCODER_w_structure("dilithium3_pss3072", dilithium3_pss3072, der, - SubjectPublicKeyInfo), - ENCODER_w_structure("dilithium3_pss3072", dilithium3_pss3072, pem, - SubjectPublicKeyInfo), - ENCODER_TEXT("dilithium3_pss3072", dilithium3_pss3072), - #endif #ifdef OQS_ENABLE_SIG_dilithium_5 ENCODER_w_structure("dilithium5", dilithium5, der, PrivateKeyInfo), diff --git a/oqsprov/oqsprov.c b/oqsprov/oqsprov.c index 24d02400..47f34c8a 100644 --- a/oqsprov/oqsprov.c +++ b/oqsprov/oqsprov.c @@ -150,20 +150,52 @@ const char *oqs_oid_alg_list[OQS_OID_CNT] = { "p256_dilithium2", "1.3.9999.2.7.2", "rsa3072_dilithium2", + "2.16.840.1.114027.80.7.1.1", + "dilithium2_pss2048", + "2.16.840.1.114027.80.7.1.2", + "dilithium2_rsa2048", + "2.16.840.1.114027.80.7.1.3", + "dilithium2_ed25519", + "2.16.840.1.114027.80.7.1.4", + "dilithium2_p256", + "2.16.840.1.114027.80.7.1.5", + "dilithium2_bp256", "1.3.6.1.4.1.2.267.7.6.5", "dilithium3", "1.3.9999.2.7.3", "p384_dilithium3", + "2.16.840.1.114027.80.7.1.6", + "dilithium3_pss3072", + "2.16.840.1.114027.80.7.1.7", + "dilithium3_rsa3072", + "2.16.840.1.114027.80.7.1.8", + "dilithium3_p256", + "2.16.840.1.114027.80.7.1.9", + "dilithium3_bp256", + "2.16.840.1.114027.80.7.1.10", + "dilithium3_ed25519", "1.3.6.1.4.1.2.267.7.8.7", "dilithium5", "1.3.9999.2.7.4", "p521_dilithium5", + "2.16.840.1.114027.80.7.1.11", + "dilithium5_p384", + "2.16.840.1.114027.80.7.1.12", + "dilithium5_bp384", + "2.16.840.1.114027.80.7.1.13", + "dilithium5_ed448", "1.3.9999.3.6", "falcon512", "1.3.9999.3.7", "p256_falcon512", "1.3.9999.3.8", "rsa3072_falcon512", + "2.16.840.1.114027.80.7.1.14", + "falcon512_p256", + "2.16.840.1.114027.80.7.1.15", + "falcon512_bp256", + "2.16.840.1.114027.80.7.1.16", + "falcon512_ed25519", "1.3.9999.3.9", "falcon1024", "1.3.9999.3.10", @@ -190,38 +222,6 @@ const char *oqs_oid_alg_list[OQS_OID_CNT] = { "p256_sphincsshake128fsimple", "1.3.9999.6.7.15", "rsa3072_sphincsshake128fsimple", - "2.16.840.1.114027.80.7.1.7", - "dilithium3_rsa3072", - "2.16.840.1.114027.80.7.1.8", - "dilithium3_p256", - "2.16.840.1.114027.80.7.1.9", - "dilithium3_bp256", - "2.16.840.1.114027.80.7.1.10", - "dilithium3_ed25519", - "2.16.840.1.114027.80.7.1.11", - "dilithium5_p384", - "2.16.840.1.114027.80.7.1.12", - "dilithium5_bp384", - "2.16.840.1.114027.80.7.1.13", - "dilithium5_ed448", - "2.16.840.1.114027.80.7.1.14", - "falcon512_p256", - "2.16.840.1.114027.80.7.1.15", - "falcon512_bp256", - "2.16.840.1.114027.80.7.1.16", - "falcon512_ed25519", - "2.16.840.1.114027.80.7.1.6", - "dilithium3_pss3072", - "2.16.840.1.114027.80.7.1.1", - "dilithium2_pss2048", - "2.16.840.1.114027.80.7.1.2", - "dilithium2_rsa2048", - "2.16.840.1.114027.80.7.1.3", - "dilithium2_ed25519", - "2.16.840.1.114027.80.7.1.4", - "dilithium2_p256", - "2.16.840.1.114027.80.7.1.5", - "dilithium2_bp256", ///// OQS_TEMPLATE_FRAGMENT_ASSIGN_SIG_OIDS_END }; @@ -423,112 +423,192 @@ int oqs_patch_encodings(void) if (getenv("OQS_ENCODING_RSA3072_DILITHIUM2_ALGNAME")) oqs_alg_encoding_list[5] = getenv("OQS_ENCODING_RSA3072_DILITHIUM2_ALGNAME"); + if (getenv("OQS_ENCODING_DILITHIUM2_PSS2048")) + oqs_alg_encoding_list[6] = getenv("OQS_ENCODING_DILITHIUM2_PSS2048"); + if (getenv("OQS_ENCODING_DILITHIUM2_PSS2048_ALGNAME")) + oqs_alg_encoding_list[7] + = getenv("OQS_ENCODING_DILITHIUM2_PSS2048_ALGNAME"); + if (getenv("OQS_ENCODING_DILITHIUM2_RSA2048")) + oqs_alg_encoding_list[8] = getenv("OQS_ENCODING_DILITHIUM2_RSA2048"); + if (getenv("OQS_ENCODING_DILITHIUM2_RSA2048_ALGNAME")) + oqs_alg_encoding_list[9] + = getenv("OQS_ENCODING_DILITHIUM2_RSA2048_ALGNAME"); + if (getenv("OQS_ENCODING_DILITHIUM2_ED25519")) + oqs_alg_encoding_list[10] = getenv("OQS_ENCODING_DILITHIUM2_ED25519"); + if (getenv("OQS_ENCODING_DILITHIUM2_ED25519_ALGNAME")) + oqs_alg_encoding_list[11] + = getenv("OQS_ENCODING_DILITHIUM2_ED25519_ALGNAME"); + if (getenv("OQS_ENCODING_DILITHIUM2_P256")) + oqs_alg_encoding_list[12] = getenv("OQS_ENCODING_DILITHIUM2_P256"); + if (getenv("OQS_ENCODING_DILITHIUM2_P256_ALGNAME")) + oqs_alg_encoding_list[13] + = getenv("OQS_ENCODING_DILITHIUM2_P256_ALGNAME"); + if (getenv("OQS_ENCODING_DILITHIUM2_BP256")) + oqs_alg_encoding_list[14] = getenv("OQS_ENCODING_DILITHIUM2_BP256"); + if (getenv("OQS_ENCODING_DILITHIUM2_BP256_ALGNAME")) + oqs_alg_encoding_list[15] + = getenv("OQS_ENCODING_DILITHIUM2_BP256_ALGNAME"); if (getenv("OQS_ENCODING_DILITHIUM3")) - oqs_alg_encoding_list[6] = getenv("OQS_ENCODING_DILITHIUM3"); + oqs_alg_encoding_list[16] = getenv("OQS_ENCODING_DILITHIUM3"); if (getenv("OQS_ENCODING_DILITHIUM3_ALGNAME")) - oqs_alg_encoding_list[7] = getenv("OQS_ENCODING_DILITHIUM3_ALGNAME"); + oqs_alg_encoding_list[17] = getenv("OQS_ENCODING_DILITHIUM3_ALGNAME"); if (getenv("OQS_ENCODING_P384_DILITHIUM3")) - oqs_alg_encoding_list[8] = getenv("OQS_ENCODING_P384_DILITHIUM3"); + oqs_alg_encoding_list[18] = getenv("OQS_ENCODING_P384_DILITHIUM3"); if (getenv("OQS_ENCODING_P384_DILITHIUM3_ALGNAME")) - oqs_alg_encoding_list[9] + oqs_alg_encoding_list[19] = getenv("OQS_ENCODING_P384_DILITHIUM3_ALGNAME"); + if (getenv("OQS_ENCODING_DILITHIUM3_PSS3072")) + oqs_alg_encoding_list[20] = getenv("OQS_ENCODING_DILITHIUM3_PSS3072"); + if (getenv("OQS_ENCODING_DILITHIUM3_PSS3072_ALGNAME")) + oqs_alg_encoding_list[21] + = getenv("OQS_ENCODING_DILITHIUM3_PSS3072_ALGNAME"); + if (getenv("OQS_ENCODING_DILITHIUM3_RSA3072")) + oqs_alg_encoding_list[22] = getenv("OQS_ENCODING_DILITHIUM3_RSA3072"); + if (getenv("OQS_ENCODING_DILITHIUM3_RSA3072_ALGNAME")) + oqs_alg_encoding_list[23] + = getenv("OQS_ENCODING_DILITHIUM3_RSA3072_ALGNAME"); + if (getenv("OQS_ENCODING_DILITHIUM3_P256")) + oqs_alg_encoding_list[24] = getenv("OQS_ENCODING_DILITHIUM3_P256"); + if (getenv("OQS_ENCODING_DILITHIUM3_P256_ALGNAME")) + oqs_alg_encoding_list[25] + = getenv("OQS_ENCODING_DILITHIUM3_P256_ALGNAME"); + if (getenv("OQS_ENCODING_DILITHIUM3_BP256")) + oqs_alg_encoding_list[26] = getenv("OQS_ENCODING_DILITHIUM3_BP256"); + if (getenv("OQS_ENCODING_DILITHIUM3_BP256_ALGNAME")) + oqs_alg_encoding_list[27] + = getenv("OQS_ENCODING_DILITHIUM3_BP256_ALGNAME"); + if (getenv("OQS_ENCODING_DILITHIUM3_ED25519")) + oqs_alg_encoding_list[28] = getenv("OQS_ENCODING_DILITHIUM3_ED25519"); + if (getenv("OQS_ENCODING_DILITHIUM3_ED25519_ALGNAME")) + oqs_alg_encoding_list[29] + = getenv("OQS_ENCODING_DILITHIUM3_ED25519_ALGNAME"); if (getenv("OQS_ENCODING_DILITHIUM5")) - oqs_alg_encoding_list[10] = getenv("OQS_ENCODING_DILITHIUM5"); + oqs_alg_encoding_list[30] = getenv("OQS_ENCODING_DILITHIUM5"); if (getenv("OQS_ENCODING_DILITHIUM5_ALGNAME")) - oqs_alg_encoding_list[11] = getenv("OQS_ENCODING_DILITHIUM5_ALGNAME"); + oqs_alg_encoding_list[31] = getenv("OQS_ENCODING_DILITHIUM5_ALGNAME"); if (getenv("OQS_ENCODING_P521_DILITHIUM5")) - oqs_alg_encoding_list[12] = getenv("OQS_ENCODING_P521_DILITHIUM5"); + oqs_alg_encoding_list[32] = getenv("OQS_ENCODING_P521_DILITHIUM5"); if (getenv("OQS_ENCODING_P521_DILITHIUM5_ALGNAME")) - oqs_alg_encoding_list[13] + oqs_alg_encoding_list[33] = getenv("OQS_ENCODING_P521_DILITHIUM5_ALGNAME"); + if (getenv("OQS_ENCODING_DILITHIUM5_P384")) + oqs_alg_encoding_list[34] = getenv("OQS_ENCODING_DILITHIUM5_P384"); + if (getenv("OQS_ENCODING_DILITHIUM5_P384_ALGNAME")) + oqs_alg_encoding_list[35] + = getenv("OQS_ENCODING_DILITHIUM5_P384_ALGNAME"); + if (getenv("OQS_ENCODING_DILITHIUM5_BP384")) + oqs_alg_encoding_list[36] = getenv("OQS_ENCODING_DILITHIUM5_BP384"); + if (getenv("OQS_ENCODING_DILITHIUM5_BP384_ALGNAME")) + oqs_alg_encoding_list[37] + = getenv("OQS_ENCODING_DILITHIUM5_BP384_ALGNAME"); + if (getenv("OQS_ENCODING_DILITHIUM5_ED448")) + oqs_alg_encoding_list[38] = getenv("OQS_ENCODING_DILITHIUM5_ED448"); + if (getenv("OQS_ENCODING_DILITHIUM5_ED448_ALGNAME")) + oqs_alg_encoding_list[39] + = getenv("OQS_ENCODING_DILITHIUM5_ED448_ALGNAME"); if (getenv("OQS_ENCODING_FALCON512")) - oqs_alg_encoding_list[14] = getenv("OQS_ENCODING_FALCON512"); + oqs_alg_encoding_list[40] = getenv("OQS_ENCODING_FALCON512"); if (getenv("OQS_ENCODING_FALCON512_ALGNAME")) - oqs_alg_encoding_list[15] = getenv("OQS_ENCODING_FALCON512_ALGNAME"); + oqs_alg_encoding_list[41] = getenv("OQS_ENCODING_FALCON512_ALGNAME"); if (getenv("OQS_ENCODING_P256_FALCON512")) - oqs_alg_encoding_list[16] = getenv("OQS_ENCODING_P256_FALCON512"); + oqs_alg_encoding_list[42] = getenv("OQS_ENCODING_P256_FALCON512"); if (getenv("OQS_ENCODING_P256_FALCON512_ALGNAME")) - oqs_alg_encoding_list[17] + oqs_alg_encoding_list[43] = getenv("OQS_ENCODING_P256_FALCON512_ALGNAME"); if (getenv("OQS_ENCODING_RSA3072_FALCON512")) - oqs_alg_encoding_list[18] = getenv("OQS_ENCODING_RSA3072_FALCON512"); + oqs_alg_encoding_list[44] = getenv("OQS_ENCODING_RSA3072_FALCON512"); if (getenv("OQS_ENCODING_RSA3072_FALCON512_ALGNAME")) - oqs_alg_encoding_list[19] + oqs_alg_encoding_list[45] = getenv("OQS_ENCODING_RSA3072_FALCON512_ALGNAME"); + if (getenv("OQS_ENCODING_FALCON512_P256")) + oqs_alg_encoding_list[46] = getenv("OQS_ENCODING_FALCON512_P256"); + if (getenv("OQS_ENCODING_FALCON512_P256_ALGNAME")) + oqs_alg_encoding_list[47] + = getenv("OQS_ENCODING_FALCON512_P256_ALGNAME"); + if (getenv("OQS_ENCODING_FALCON512_BP256")) + oqs_alg_encoding_list[48] = getenv("OQS_ENCODING_FALCON512_BP256"); + if (getenv("OQS_ENCODING_FALCON512_BP256_ALGNAME")) + oqs_alg_encoding_list[49] + = getenv("OQS_ENCODING_FALCON512_BP256_ALGNAME"); + if (getenv("OQS_ENCODING_FALCON512_ED25519")) + oqs_alg_encoding_list[50] = getenv("OQS_ENCODING_FALCON512_ED25519"); + if (getenv("OQS_ENCODING_FALCON512_ED25519_ALGNAME")) + oqs_alg_encoding_list[51] + = getenv("OQS_ENCODING_FALCON512_ED25519_ALGNAME"); if (getenv("OQS_ENCODING_FALCON1024")) - oqs_alg_encoding_list[20] = getenv("OQS_ENCODING_FALCON1024"); + oqs_alg_encoding_list[52] = getenv("OQS_ENCODING_FALCON1024"); if (getenv("OQS_ENCODING_FALCON1024_ALGNAME")) - oqs_alg_encoding_list[21] = getenv("OQS_ENCODING_FALCON1024_ALGNAME"); + oqs_alg_encoding_list[53] = getenv("OQS_ENCODING_FALCON1024_ALGNAME"); if (getenv("OQS_ENCODING_P521_FALCON1024")) - oqs_alg_encoding_list[22] = getenv("OQS_ENCODING_P521_FALCON1024"); + oqs_alg_encoding_list[54] = getenv("OQS_ENCODING_P521_FALCON1024"); if (getenv("OQS_ENCODING_P521_FALCON1024_ALGNAME")) - oqs_alg_encoding_list[23] + oqs_alg_encoding_list[55] = getenv("OQS_ENCODING_P521_FALCON1024_ALGNAME"); if (getenv("OQS_ENCODING_SPHINCSSHA2128FSIMPLE")) - oqs_alg_encoding_list[24] + oqs_alg_encoding_list[56] = getenv("OQS_ENCODING_SPHINCSSHA2128FSIMPLE"); if (getenv("OQS_ENCODING_SPHINCSSHA2128FSIMPLE_ALGNAME")) - oqs_alg_encoding_list[25] + oqs_alg_encoding_list[57] = getenv("OQS_ENCODING_SPHINCSSHA2128FSIMPLE_ALGNAME"); if (getenv("OQS_ENCODING_P256_SPHINCSSHA2128FSIMPLE")) - oqs_alg_encoding_list[26] + oqs_alg_encoding_list[58] = getenv("OQS_ENCODING_P256_SPHINCSSHA2128FSIMPLE"); if (getenv("OQS_ENCODING_P256_SPHINCSSHA2128FSIMPLE_ALGNAME")) - oqs_alg_encoding_list[27] + oqs_alg_encoding_list[59] = getenv("OQS_ENCODING_P256_SPHINCSSHA2128FSIMPLE_ALGNAME"); if (getenv("OQS_ENCODING_RSA3072_SPHINCSSHA2128FSIMPLE")) - oqs_alg_encoding_list[28] + oqs_alg_encoding_list[60] = getenv("OQS_ENCODING_RSA3072_SPHINCSSHA2128FSIMPLE"); if (getenv("OQS_ENCODING_RSA3072_SPHINCSSHA2128FSIMPLE_ALGNAME")) - oqs_alg_encoding_list[29] + oqs_alg_encoding_list[61] = getenv("OQS_ENCODING_RSA3072_SPHINCSSHA2128FSIMPLE_ALGNAME"); if (getenv("OQS_ENCODING_SPHINCSSHA2128SSIMPLE")) - oqs_alg_encoding_list[30] + oqs_alg_encoding_list[62] = getenv("OQS_ENCODING_SPHINCSSHA2128SSIMPLE"); if (getenv("OQS_ENCODING_SPHINCSSHA2128SSIMPLE_ALGNAME")) - oqs_alg_encoding_list[31] + oqs_alg_encoding_list[63] = getenv("OQS_ENCODING_SPHINCSSHA2128SSIMPLE_ALGNAME"); if (getenv("OQS_ENCODING_P256_SPHINCSSHA2128SSIMPLE")) - oqs_alg_encoding_list[32] + oqs_alg_encoding_list[64] = getenv("OQS_ENCODING_P256_SPHINCSSHA2128SSIMPLE"); if (getenv("OQS_ENCODING_P256_SPHINCSSHA2128SSIMPLE_ALGNAME")) - oqs_alg_encoding_list[33] + oqs_alg_encoding_list[65] = getenv("OQS_ENCODING_P256_SPHINCSSHA2128SSIMPLE_ALGNAME"); if (getenv("OQS_ENCODING_RSA3072_SPHINCSSHA2128SSIMPLE")) - oqs_alg_encoding_list[34] + oqs_alg_encoding_list[66] = getenv("OQS_ENCODING_RSA3072_SPHINCSSHA2128SSIMPLE"); if (getenv("OQS_ENCODING_RSA3072_SPHINCSSHA2128SSIMPLE_ALGNAME")) - oqs_alg_encoding_list[35] + oqs_alg_encoding_list[67] = getenv("OQS_ENCODING_RSA3072_SPHINCSSHA2128SSIMPLE_ALGNAME"); if (getenv("OQS_ENCODING_SPHINCSSHA2192FSIMPLE")) - oqs_alg_encoding_list[36] + oqs_alg_encoding_list[68] = getenv("OQS_ENCODING_SPHINCSSHA2192FSIMPLE"); if (getenv("OQS_ENCODING_SPHINCSSHA2192FSIMPLE_ALGNAME")) - oqs_alg_encoding_list[37] + oqs_alg_encoding_list[69] = getenv("OQS_ENCODING_SPHINCSSHA2192FSIMPLE_ALGNAME"); if (getenv("OQS_ENCODING_P384_SPHINCSSHA2192FSIMPLE")) - oqs_alg_encoding_list[38] + oqs_alg_encoding_list[70] = getenv("OQS_ENCODING_P384_SPHINCSSHA2192FSIMPLE"); if (getenv("OQS_ENCODING_P384_SPHINCSSHA2192FSIMPLE_ALGNAME")) - oqs_alg_encoding_list[39] + oqs_alg_encoding_list[71] = getenv("OQS_ENCODING_P384_SPHINCSSHA2192FSIMPLE_ALGNAME"); if (getenv("OQS_ENCODING_SPHINCSSHAKE128FSIMPLE")) - oqs_alg_encoding_list[40] + oqs_alg_encoding_list[72] = getenv("OQS_ENCODING_SPHINCSSHAKE128FSIMPLE"); if (getenv("OQS_ENCODING_SPHINCSSHAKE128FSIMPLE_ALGNAME")) - oqs_alg_encoding_list[41] + oqs_alg_encoding_list[73] = getenv("OQS_ENCODING_SPHINCSSHAKE128FSIMPLE_ALGNAME"); if (getenv("OQS_ENCODING_P256_SPHINCSSHAKE128FSIMPLE")) - oqs_alg_encoding_list[42] + oqs_alg_encoding_list[74] = getenv("OQS_ENCODING_P256_SPHINCSSHAKE128FSIMPLE"); if (getenv("OQS_ENCODING_P256_SPHINCSSHAKE128FSIMPLE_ALGNAME")) - oqs_alg_encoding_list[43] + oqs_alg_encoding_list[75] = getenv("OQS_ENCODING_P256_SPHINCSSHAKE128FSIMPLE_ALGNAME"); if (getenv("OQS_ENCODING_RSA3072_SPHINCSSHAKE128FSIMPLE")) - oqs_alg_encoding_list[44] + oqs_alg_encoding_list[76] = getenv("OQS_ENCODING_RSA3072_SPHINCSSHAKE128FSIMPLE"); if (getenv("OQS_ENCODING_RSA3072_SPHINCSSHAKE128FSIMPLE_ALGNAME")) - oqs_alg_encoding_list[45] + oqs_alg_encoding_list[77] = getenv("OQS_ENCODING_RSA3072_SPHINCSSHAKE128FSIMPLE_ALGNAME"); ///// OQS_TEMPLATE_FRAGMENT_ENCODING_PATCHING_END return 1; @@ -578,35 +658,34 @@ static const OSSL_ALGORITHM oqsprovider_signatures[] = { SIGALG("dilithium2", 128, oqs_signature_functions), SIGALG("p256_dilithium2", 128, oqs_signature_functions), SIGALG("rsa3072_dilithium2", 128, oqs_signature_functions), - SIGALG("dilithium2_pss2048", 128, oqs_signature_functions), - SIGALG("dilithium2_rsa2048", 128, oqs_signature_functions), + SIGALG("dilithium2_pss2048", 112, oqs_signature_functions), + SIGALG("dilithium2_rsa2048", 112, oqs_signature_functions), SIGALG("dilithium2_ed25519", 128, oqs_signature_functions), SIGALG("dilithium2_p256", 128, oqs_signature_functions), - SIGALG("dilithium2_bp256", 128, oqs_signature_functions), + SIGALG("dilithium2_bp256", 256, oqs_signature_functions), #endif #ifdef OQS_ENABLE_SIG_dilithium_3 SIGALG("dilithium3", 192, oqs_signature_functions), SIGALG("p384_dilithium3", 192, oqs_signature_functions), - SIGALG("dilithium3_rsa3072", 192, oqs_signature_functions), - SIGALG("dilithium3_p256", 192, oqs_signature_functions), - SIGALG("dilithium3_bp256", 192, oqs_signature_functions), - SIGALG("dilithium3_ed25519", 192, oqs_signature_functions), - SIGALG("dilithium3_pss3072", 192, oqs_signature_functions), - + SIGALG("dilithium3_pss3072", 128, oqs_signature_functions), + SIGALG("dilithium3_rsa3072", 128, oqs_signature_functions), + SIGALG("dilithium3_p256", 128, oqs_signature_functions), + SIGALG("dilithium3_bp256", 256, oqs_signature_functions), + SIGALG("dilithium3_ed25519", 128, oqs_signature_functions), #endif #ifdef OQS_ENABLE_SIG_dilithium_5 SIGALG("dilithium5", 256, oqs_signature_functions), SIGALG("p521_dilithium5", 256, oqs_signature_functions), - SIGALG("dilithium5_p384", 256, oqs_signature_functions), - SIGALG("dilithium5_bp384", 256, oqs_signature_functions), - SIGALG("dilithium5_ed448", 256, oqs_signature_functions), + SIGALG("dilithium5_p384", 192, oqs_signature_functions), + SIGALG("dilithium5_bp384", 384, oqs_signature_functions), + SIGALG("dilithium5_ed448", 192, oqs_signature_functions), #endif #ifdef OQS_ENABLE_SIG_falcon_512 SIGALG("falcon512", 128, oqs_signature_functions), SIGALG("p256_falcon512", 128, oqs_signature_functions), SIGALG("rsa3072_falcon512", 128, oqs_signature_functions), SIGALG("falcon512_p256", 128, oqs_signature_functions), - SIGALG("falcon512_bp256", 128, oqs_signature_functions), + SIGALG("falcon512_bp256", 256, oqs_signature_functions), SIGALG("falcon512_ed25519", 128, oqs_signature_functions), #endif #ifdef OQS_ENABLE_SIG_falcon_1024 @@ -722,35 +801,34 @@ static const OSSL_ALGORITHM oqsprovider_keymgmt[] = { SIGALG("dilithium2", 128, oqs_dilithium2_keymgmt_functions), SIGALG("p256_dilithium2", 128, oqs_p256_dilithium2_keymgmt_functions), SIGALG("rsa3072_dilithium2", 128, oqs_rsa3072_dilithium2_keymgmt_functions), - SIGALG("dilithium2_pss2048", 128, oqs_dilithium2_pss2048_keymgmt_functions), - SIGALG("dilithium2_rsa2048", 128, oqs_dilithium2_rsa2048_keymgmt_functions), + SIGALG("dilithium2_pss2048", 112, oqs_dilithium2_pss2048_keymgmt_functions), + SIGALG("dilithium2_rsa2048", 112, oqs_dilithium2_rsa2048_keymgmt_functions), SIGALG("dilithium2_ed25519", 128, oqs_dilithium2_ed25519_keymgmt_functions), SIGALG("dilithium2_p256", 128, oqs_dilithium2_p256_keymgmt_functions), - SIGALG("dilithium2_bp256", 128, oqs_dilithium2_bp256_keymgmt_functions), + SIGALG("dilithium2_bp256", 256, oqs_dilithium2_bp256_keymgmt_functions), #endif #ifdef OQS_ENABLE_SIG_dilithium_3 SIGALG("dilithium3", 192, oqs_dilithium3_keymgmt_functions), SIGALG("p384_dilithium3", 192, oqs_p384_dilithium3_keymgmt_functions), - SIGALG("dilithium3_rsa3072", 192, oqs_dilithium3_rsa3072_keymgmt_functions), - SIGALG("dilithium3_p256", 192, oqs_dilithium3_p256_keymgmt_functions), - SIGALG("dilithium3_bp256", 192, oqs_dilithium3_bp256_keymgmt_functions), - SIGALG("dilithium3_ed25519", 192, oqs_dilithium3_ed25519_keymgmt_functions), - SIGALG("dilithium3_pss3072", 192, oqs_dilithium3_pss3072_keymgmt_functions), - + SIGALG("dilithium3_pss3072", 128, oqs_dilithium3_pss3072_keymgmt_functions), + SIGALG("dilithium3_rsa3072", 128, oqs_dilithium3_rsa3072_keymgmt_functions), + SIGALG("dilithium3_p256", 128, oqs_dilithium3_p256_keymgmt_functions), + SIGALG("dilithium3_bp256", 256, oqs_dilithium3_bp256_keymgmt_functions), + SIGALG("dilithium3_ed25519", 128, oqs_dilithium3_ed25519_keymgmt_functions), #endif #ifdef OQS_ENABLE_SIG_dilithium_5 SIGALG("dilithium5", 256, oqs_dilithium5_keymgmt_functions), SIGALG("p521_dilithium5", 256, oqs_p521_dilithium5_keymgmt_functions), - SIGALG("dilithium5_p384", 256, oqs_dilithium5_p384_keymgmt_functions), - SIGALG("dilithium5_bp384", 256, oqs_dilithium5_bp384_keymgmt_functions), - SIGALG("dilithium5_ed448", 256, oqs_dilithium5_ed448_keymgmt_functions), + SIGALG("dilithium5_p384", 192, oqs_dilithium5_p384_keymgmt_functions), + SIGALG("dilithium5_bp384", 384, oqs_dilithium5_bp384_keymgmt_functions), + SIGALG("dilithium5_ed448", 192, oqs_dilithium5_ed448_keymgmt_functions), #endif #ifdef OQS_ENABLE_SIG_falcon_512 SIGALG("falcon512", 128, oqs_falcon512_keymgmt_functions), SIGALG("p256_falcon512", 128, oqs_p256_falcon512_keymgmt_functions), SIGALG("rsa3072_falcon512", 128, oqs_rsa3072_falcon512_keymgmt_functions), SIGALG("falcon512_p256", 128, oqs_falcon512_p256_keymgmt_functions), - SIGALG("falcon512_bp256", 128, oqs_falcon512_bp256_keymgmt_functions), + SIGALG("falcon512_bp256", 256, oqs_falcon512_bp256_keymgmt_functions), SIGALG("falcon512_ed25519", 128, oqs_falcon512_ed25519_keymgmt_functions), #endif #ifdef OQS_ENABLE_SIG_falcon_1024 @@ -883,6 +961,23 @@ static const OSSL_ALGORITHM oqsprovider_decoder[] = { #undef DECODER_PROVIDER }; +// get the last number on the composite OID +int get_composite_idx(int idx) +{ + char *first_token; + char *token; + char *s; + int i; + s = OPENSSL_strdup(oqs_oid_alg_list[idx * 2]); + first_token = strtok_r(s, ".", &s); + for (i = 0; i <= 7; i++) { // 7 dots in composite OID + token = strtok_r(NULL, ".", &s); + } + i = atoi(token); + OPENSSL_free(first_token); + return i; +} + static const OSSL_PARAM *oqsprovider_gettable_params(void *provctx) { return oqsprovider_param_types; diff --git a/oqsprov/oqsprov_keys.c b/oqsprov/oqsprov_keys.c index 76087dfc..20fb3049 100644 --- a/oqsprov/oqsprov_keys.c +++ b/oqsprov/oqsprov_keys.c @@ -119,13 +119,29 @@ static oqs_nid_name_t nid_names[NID_TABLE_LEN] = { {0, "dilithium2", OQS_SIG_alg_dilithium_2, KEY_TYPE_SIG, 128}, {0, "p256_dilithium2", OQS_SIG_alg_dilithium_2, KEY_TYPE_HYB_SIG, 128}, {0, "rsa3072_dilithium2", OQS_SIG_alg_dilithium_2, KEY_TYPE_HYB_SIG, 128}, + {0, "dilithium2_pss2048", OQS_SIG_alg_dilithium_2, KEY_TYPE_CMP_SIG, 112}, + {0, "dilithium2_rsa2048", OQS_SIG_alg_dilithium_2, KEY_TYPE_CMP_SIG, 112}, + {0, "dilithium2_ed25519", OQS_SIG_alg_dilithium_2, KEY_TYPE_CMP_SIG, 128}, + {0, "dilithium2_p256", OQS_SIG_alg_dilithium_2, KEY_TYPE_CMP_SIG, 128}, + {0, "dilithium2_bp256", OQS_SIG_alg_dilithium_2, KEY_TYPE_CMP_SIG, 256}, {0, "dilithium3", OQS_SIG_alg_dilithium_3, KEY_TYPE_SIG, 192}, {0, "p384_dilithium3", OQS_SIG_alg_dilithium_3, KEY_TYPE_HYB_SIG, 192}, + {0, "dilithium3_pss3072", OQS_SIG_alg_dilithium_3, KEY_TYPE_CMP_SIG, 128}, + {0, "dilithium3_rsa3072", OQS_SIG_alg_dilithium_3, KEY_TYPE_CMP_SIG, 128}, + {0, "dilithium3_p256", OQS_SIG_alg_dilithium_3, KEY_TYPE_CMP_SIG, 128}, + {0, "dilithium3_bp256", OQS_SIG_alg_dilithium_3, KEY_TYPE_CMP_SIG, 256}, + {0, "dilithium3_ed25519", OQS_SIG_alg_dilithium_3, KEY_TYPE_CMP_SIG, 128}, {0, "dilithium5", OQS_SIG_alg_dilithium_5, KEY_TYPE_SIG, 256}, {0, "p521_dilithium5", OQS_SIG_alg_dilithium_5, KEY_TYPE_HYB_SIG, 256}, + {0, "dilithium5_p384", OQS_SIG_alg_dilithium_5, KEY_TYPE_CMP_SIG, 192}, + {0, "dilithium5_bp384", OQS_SIG_alg_dilithium_5, KEY_TYPE_CMP_SIG, 384}, + {0, "dilithium5_ed448", OQS_SIG_alg_dilithium_5, KEY_TYPE_CMP_SIG, 192}, {0, "falcon512", OQS_SIG_alg_falcon_512, KEY_TYPE_SIG, 128}, {0, "p256_falcon512", OQS_SIG_alg_falcon_512, KEY_TYPE_HYB_SIG, 128}, {0, "rsa3072_falcon512", OQS_SIG_alg_falcon_512, KEY_TYPE_HYB_SIG, 128}, + {0, "falcon512_p256", OQS_SIG_alg_falcon_512, KEY_TYPE_CMP_SIG, 128}, + {0, "falcon512_bp256", OQS_SIG_alg_falcon_512, KEY_TYPE_CMP_SIG, 256}, + {0, "falcon512_ed25519", OQS_SIG_alg_falcon_512, KEY_TYPE_CMP_SIG, 128}, {0, "falcon1024", OQS_SIG_alg_falcon_1024, KEY_TYPE_SIG, 256}, {0, "p521_falcon1024", OQS_SIG_alg_falcon_1024, KEY_TYPE_HYB_SIG, 256}, {0, "sphincssha2128fsimple", OQS_SIG_alg_sphincs_sha2_128f_simple, @@ -150,22 +166,6 @@ static oqs_nid_name_t nid_names[NID_TABLE_LEN] = { KEY_TYPE_HYB_SIG, 128}, {0, "rsa3072_sphincsshake128fsimple", OQS_SIG_alg_sphincs_shake_128f_simple, KEY_TYPE_HYB_SIG, 128}, - {0, "dilithium3_rsa3072", OQS_SIG_alg_dilithium_3, KEY_TYPE_CMP_SIG, 128}, - {0, "dilithium3_p256", OQS_SIG_alg_dilithium_3, KEY_TYPE_CMP_SIG, 128}, - {0, "falcon512_p256", OQS_SIG_alg_falcon_512, KEY_TYPE_CMP_SIG, 128}, - {0, "dilithium5_p384", OQS_SIG_alg_dilithium_5, KEY_TYPE_CMP_SIG, 192}, - {0, "dilithium3_bp256", OQS_SIG_alg_dilithium_3, KEY_TYPE_CMP_SIG, 256}, - {0, "dilithium3_ed25519", OQS_SIG_alg_dilithium_3, KEY_TYPE_CMP_SIG, 128}, - {0, "dilithium5_bp384", OQS_SIG_alg_dilithium_5, KEY_TYPE_CMP_SIG, 384}, - {0, "dilithium5_ed448", OQS_SIG_alg_dilithium_5, KEY_TYPE_CMP_SIG, 192}, - {0, "falcon512_bp256", OQS_SIG_alg_falcon_512, KEY_TYPE_CMP_SIG, 256}, - {0, "falcon512_ed25519", OQS_SIG_alg_falcon_512, KEY_TYPE_CMP_SIG, 128}, - {0, "dilithium3_pss3072", OQS_SIG_alg_dilithium_3, KEY_TYPE_CMP_SIG, 128}, - {0, "dilithium2_pss2048", OQS_SIG_alg_dilithium_2, KEY_TYPE_CMP_SIG, 112}, - {0, "dilithium2_rsa2048", OQS_SIG_alg_dilithium_2, KEY_TYPE_CMP_SIG, 112}, - {0, "dilithium2_ed25519", OQS_SIG_alg_dilithium_2, KEY_TYPE_CMP_SIG, 128}, - {0, "dilithium2_p256", OQS_SIG_alg_dilithium_2, KEY_TYPE_CMP_SIG, 128}, - {0, "dilithium2_bp256", OQS_SIG_alg_dilithium_2, KEY_TYPE_CMP_SIG, 256}, ///// OQS_TEMPLATE_FRAGMENT_OQSNAMES_END }; diff --git a/scripts/common.py b/scripts/common.py index 7b936214..88c609e5 100644 --- a/scripts/common.py +++ b/scripts/common.py @@ -19,7 +19,8 @@ 'dilithium2','dilithium3','dilithium5','falcon512','falcon1024','sphincssha2128fsimple','sphincssha2128ssimple','sphincssha2192fsimple','sphincsshake128fsimple', # post-quantum + classical signatures 'p256_dilithium2','rsa3072_dilithium2','p384_dilithium3','p521_dilithium5','p256_falcon512','rsa3072_falcon512','p521_falcon1024','p256_sphincssha2128fsimple','rsa3072_sphincssha2128fsimple','p256_sphincssha2128ssimple','rsa3072_sphincssha2128ssimple','p384_sphincssha2192fsimple','p256_sphincsshake128fsimple','rsa3072_sphincsshake128fsimple', -##### OQS_TEMPLATE_FRAGMENT_SIG_ALGS_END + # post-quantum + classical signatures (COMPOSITE) + 'dilithium2_pss2048','dilithium2_rsa2048','dilithium2_ed25519','dilithium2_p256','dilithium2_bp256','dilithium3_pss3072','dilithium3_rsa3072','dilithium3_p256','dilithium3_bp256','dilithium3_ed25519','dilithium5_p384','dilithium5_bp384','dilithium5_ed448','falcon512_p256','falcon512_bp256','falcon512_ed25519',##### OQS_TEMPLATE_FRAGMENT_SIG_ALGS_END ] SERVER_START_ATTEMPTS = 10