Skip to content

Commit

Permalink
Small fixes after adding ML-* (#1702)
Browse files Browse the repository at this point in the history
* - Fixes list_standardized_algs fragment
- Fixes fetch_values.sh script to (re-)generate ML-* vectors

* consider aliases in STD filter
  • Loading branch information
bhess authored Feb 23, 2024
1 parent 60adf53 commit 154ae5c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .CMake/alg_support.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,7 @@ if(NOT ((OQS_MINIMAL_BUILD STREQUAL "") OR (OQS_MINIMAL_BUILD STREQUAL "OFF")))
filter_algs("${OQS_MINIMAL_BUILD}")
elseif (${OQS_ALGS_ENABLED} STREQUAL "STD")
##### OQS_COPY_FROM_UPSTREAM_FRAGMENT_LIST_STANDARDIZED_ALGS_START
filter_algs("KEM_ml_kem_512_ipd;KEM_ml_kem_768_ipd;KEM_ml_kem_1024_ipd;SIG_dilithium_;SIG_dilithium_;SIG_dilithium_;SIG_ml_dsa_44_ipd;SIG_ml_dsa_65_ipd;SIG_ml_dsa_87_ipd;SIG_falcon_512;SIG_falcon_1024;SIG_sphincs_sha2_128f_simple;SIG_sphincs_sha2_128s_simple;SIG_sphincs_sha2_192f_simple;SIG_sphincs_sha2_192s_simple;SIG_sphincs_sha2_256f_simple;SIG_sphincs_sha2_256s_simple;SIG_sphincs_shake_128f_simple;SIG_sphincs_shake_128s_simple;SIG_sphincs_shake_192f_simple;SIG_sphincs_shake_192s_simple;SIG_sphincs_shake_256f_simple;SIG_sphincs_shake_256s_simple")
filter_algs("KEM_ml_kem_512_ipd;KEM_ml_kem_512;KEM_ml_kem_768_ipd;KEM_ml_kem_768;KEM_ml_kem_1024_ipd;KEM_ml_kem_1024;SIG_ml_dsa_44_ipd;SIG_ml_dsa_44;SIG_ml_dsa_65_ipd;SIG_ml_dsa_65;SIG_ml_dsa_87_ipd;SIG_ml_dsa_87;SIG_falcon_512;SIG_falcon_1024;SIG_sphincs_sha2_128f_simple;SIG_sphincs_sha2_128s_simple;SIG_sphincs_sha2_192f_simple;SIG_sphincs_sha2_192s_simple;SIG_sphincs_sha2_256f_simple;SIG_sphincs_sha2_256s_simple;SIG_sphincs_shake_128f_simple;SIG_sphincs_shake_128s_simple;SIG_sphincs_shake_192f_simple;SIG_sphincs_shake_192s_simple;SIG_sphincs_shake_256f_simple;SIG_sphincs_shake_256s_simple")
##### OQS_COPY_FROM_UPSTREAM_FRAGMENT_LIST_STANDARDIZED_ALGS_END
elseif(${OQS_ALGS_ENABLED} STREQUAL "NIST_R4")
filter_algs("KEM_classic_mceliece_348864;KEM_classic_mceliece_348864f;KEM_classic_mceliece_460896;KEM_classic_mceliece_460896f;KEM_classic_mceliece_6688128;KEM_classic_mceliece_6688128f;KEM_classic_mceliece_6960119;KEM_classic_mceliece_6960119f;KEM_classic_mceliece_8192128;KEM_classic_mceliece_8192128f;KEM_hqc_128;KEM_hqc_192;KEM_hqc_256;KEM_bike_l1;KEM_bike_l3")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
filter_algs("
{%- for family in instructions['kems'] if family['name'] in ['ml_kem'] -%}
{%- for scheme in family['schemes'] -%}
KEM_{{ family['name'] }}_{{ scheme['scheme'] }};
KEM_{{ family['name'] }}_{{ scheme['scheme'] }}{%- if 'alias_scheme' in scheme -%};KEM_{{ family['name'] }}_{{ scheme['alias_scheme'] }};{%- endif -%}
{%- endfor -%}
{%- endfor -%}
{%- for family in instructions['sigs'] -%}
{%- for family in instructions['sigs'] if family['name'] in ['ml_dsa', 'falcon', 'sphincs'] -%}
{%- set outer_loop = loop -%}
{%- for scheme in family['schemes'] -%}
SIG_{{ family['name'] }}_{{ scheme['scheme'] if family['name'] in ['ml_dsa', 'falcon', 'sphincs'] }}{%- if not (outer_loop.last and loop.last) -%};{%- endif -%}
SIG_{{ family['name'] }}_{{ scheme['scheme'] }}{%- if 'alias_scheme' in scheme -%};SIG_{{ family['name'] }}_{{ scheme['alias_scheme'] }}{%- endif -%}{%- if not (outer_loop.last and loop.last) -%};{%- endif -%}
{%- endfor -%}
{%- endfor -%}
")
Expand Down
4 changes: 2 additions & 2 deletions tests/PQC_Intermediate_Values/fetch_values.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

# This script fetches the NIST vectors for the ML-KEM-ipd and ML-DSA-ipd and extracts the values we use for testing

wget https://csrc.nist.gov/csrc/media/Projects/post-quantum-cryptography/documents/example-files/PQC%20Intermediate%20Values.zip
unzip PQC_Intermediate_Values.zip
wget -O PQC_Intermediate_Values.zip https://csrc.nist.gov/csrc/media/Projects/post-quantum-cryptography/documents/example-files/PQC%20Intermediate%20Values.zip
unzip PQC_Intermediate_Values.zip && mv "PQC Intermediate Values" PQC_Intermediate_Values

file_keygen="PQC_Intermediate_Values/Key Generation -- "
file_signature="PQC_Intermediate_Values/Signature Generation -- "
Expand Down

0 comments on commit 154ae5c

Please sign in to comment.