Skip to content

Commit

Permalink
Updated templates to change p256_mlkem768 to SecP256r1MLKEM768
Browse files Browse the repository at this point in the history
Signed-off-by: Pravek Sharma <sharmapravek@gmail.com>
  • Loading branch information
praveksharma committed Sep 20, 2024
1 parent e255f59 commit 46e1aad
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 8 deletions.
2 changes: 1 addition & 1 deletion oqs-template/README.md/algs.fragment
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

### KEM algorithms
{% for family, kems in config['kems'] | groupby('family') %}
- **{{ family }}**: {% for kem in kems -%} `{{ kem['name_group'] }}` {%- for hybrid in kem['hybrids'] -%}, `{{ hybrid['hybrid_group']}}_{{ kem['name_group'] }}`{%- endfor -%}{%- if not loop.last %}, {% endif -%}{%- if loop.last and family == 'HQC' -%}†{%- endif -%}{%- endfor -%}
- **{{ family }}**: {% for kem in kems -%} `{{ kem['name_group'] }}` {%- for hybrid in kem['hybrids'] -%}, `{% if 'standard_name' in hybrid %}{{hybrid['standard_name']}}{% else %}{{hybrid['hybrid_group']}}_{{kem['name_group']}}{% endif %}`{%- endfor -%}{%- if not loop.last %}, {% endif -%}{%- if loop.last and family == 'HQC' -%}†{%- endif -%}{%- endfor -%}
{%- endfor %}

### Signature algorithms
Expand Down
6 changes: 4 additions & 2 deletions oqs-template/generate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -183,11 +183,13 @@ kems:
# code point not standardized: Why? XXX
nid: '0x2FB7'
- hybrid_group: "x25519"
# https://www.ietf.org/archive/id/draft-kwiatkowski-tls-ecdhe-mlkem-02.html#name-x25519mlkem768
nid: '0x11ec'
standard_name: "X25519MLKEM768"
- hybrid_group: "p256"
# https://www.ietf.org/archive/id/draft-kwiatkowski-tls-ecdhe-mlkem-01.html#name-iana-considerations
nid: '4587'
# https://www.ietf.org/archive/id/draft-kwiatkowski-tls-ecdhe-mlkem-02.html#name-secp256r1mlkem768
nid: '0x11eb'
standard_name: "SecP256r1MLKEM768"
-
family: 'ML-KEM'
fips_standard: 1
Expand Down
2 changes: 1 addition & 1 deletion oqs-template/oqs-kem-info.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
| ML-KEM | ML-KEM | mlkem512 | FIPS203 | 1 | 0x2F4B | secp256_r1 |
| ML-KEM | ML-KEM | mlkem512 | FIPS203 | 1 | 0x2FB6 | x25519 |
| ML-KEM | ML-KEM | mlkem768 | FIPS203 | 3 | 0x0768 | |
| ML-KEM | ML-KEM | mlkem768 | FIPS203 | 3 | 0x11eb | p256 |
| ML-KEM | ML-KEM | mlkem768 | FIPS203 | 3 | 0x11ec | x25519 |
| ML-KEM | ML-KEM | mlkem768 | FIPS203 | 3 | 0x2F4C | secp384_r1 |
| ML-KEM | ML-KEM | mlkem768 | FIPS203 | 3 | 0x2FB7 | x448 |
| ML-KEM | ML-KEM | mlkem768 | FIPS203 | 3 | 4587 | p256 |
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ MAKE_SIG_KEYMGMT_FUNCTIONS({{variant['name']}}_{{ composite_alg['name'] }})
MAKE_KEM_KEYMGMT_FUNCTIONS({{kem['name_group']}}, {{kem['oqs_alg']}}, {{kem['bit_security']}})
{% for hybrid in kem['hybrids'] %}
{% if hybrid['hybrid_group'].startswith('p') -%}
MAKE_KEM_ECP_KEYMGMT_FUNCTIONS({{hybrid['hybrid_group']}}_{{kem['name_group']}}, {{kem['oqs_alg']}}, {{hybrid['bit_security']}})
MAKE_KEM_ECP_KEYMGMT_FUNCTIONS({% if 'standard_name' in hybrid %}{{hybrid['standard_name']}}{% else %}{{hybrid['hybrid_group']}}_{{kem['name_group']}}{% endif %}, {{kem['oqs_alg']}}, {{hybrid['bit_security']}})
{%- else %}
MAKE_KEM_ECX_KEYMGMT_FUNCTIONS({% if 'standard_name' in hybrid %}{{hybrid['standard_name']}}{% else %}{{hybrid['hybrid_group']}}_{{kem['name_group']}}{% endif %}, {{kem['oqs_alg']}}, {{hybrid['bit_security']}}, {% if 'fips_standard' in kem %}{{kem['fips_standard']}}{% else %}0{% endif %})
{%- endif %}
Expand Down
2 changes: 1 addition & 1 deletion oqs-template/oqsprov/oqs_prov.h/alg_functions.fragment
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ extern const OSSL_DISPATCH oqs_{{ variant['name'] }}_{{ composite_alg['name'] }}
extern const OSSL_DISPATCH oqs_{{ kem['name_group'] }}_keymgmt_functions[];
{% for hybrid in kem['hybrids'] %}
{% if hybrid['hybrid_group'].startswith('p') -%}
extern const OSSL_DISPATCH oqs_ecp_{{ hybrid['hybrid_group']}}_{{ kem['name_group'] }}_keymgmt_functions[];
extern const OSSL_DISPATCH oqs_ecp_{% if 'standard_name' in hybrid %}{{hybrid['standard_name']}}{% else %}{{ hybrid['hybrid_group'] }}_{{ kem['name_group'] }}{% endif %}_keymgmt_functions[];
{%- else -%}
extern const OSSL_DISPATCH oqs_ecx_{% if 'standard_name' in hybrid %}{{hybrid['standard_name']}}{% else %}{{ hybrid['hybrid_group'] }}_{{ kem['name_group'] }}{% endif %}_keymgmt_functions[];
{%- endif %}
Expand Down
2 changes: 1 addition & 1 deletion oqs-template/oqsprov/oqsprov.c/keymgmt_functions.fragment
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#ifdef OQS_ENABLE_KEM_{{ kem['oqs_alg']|replace("OQS_KEM_alg_","") }}
KEMKMALG({{ kem['name_group'] }}, {{ kem['bit_security'] }})
{% for hybrid in kem['hybrids'] %}
{% if hybrid['hybrid_group'].startswith('x') %} KEMKMHYBALG({% if 'standard_name' in hybrid %}{{hybrid['standard_name']}}{% else %}{{ hybrid['hybrid_group'] }}_{{ kem['name_group'] }}{% endif %}, {{ hybrid['bit_security'] }}, ecx){% else %} KEMKMHYBALG({{ hybrid['hybrid_group']}}_{{ kem['name_group'] }}, {{ hybrid['bit_security'] }}, ecp){% endif %}
{% if hybrid['hybrid_group'].startswith('x') %} KEMKMHYBALG({% if 'standard_name' in hybrid %}{{hybrid['standard_name']}}{% else %}{{ hybrid['hybrid_group'] }}_{{ kem['name_group'] }}{% endif %}, {{ hybrid['bit_security'] }}, ecx){% else %} KEMKMHYBALG({% if 'standard_name' in hybrid %}{{hybrid['standard_name']}}{% else %}{{ hybrid['hybrid_group'] }}_{{ kem['name_group'] }}{% endif %}, {{ hybrid['bit_security'] }}, ecp){% endif %}
{%- endfor %}
#endif
{%- endfor %}
Expand Down
2 changes: 1 addition & 1 deletion oqs-template/scripts/common.py/kex_algs.fragment
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# post-quantum + classical key exchanges
{% for kem in config['kems'] -%}
{%- for hybrid in kem['hybrids'] -%}
'{{ hybrid['hybrid_group'] }}_{{kem['name_group']}}',
'{% if 'standard_name' in hybrid %}{{hybrid['standard_name']}}{% else %}{{ hybrid['hybrid_group'] }}_{{ kem['name_group'] }}{% endif %}',
{%- endfor -%}
{% endfor %}

0 comments on commit 46e1aad

Please sign in to comment.