Skip to content

Commit

Permalink
consistent naming ml_*_ipd
Browse files Browse the repository at this point in the history
  • Loading branch information
bhess committed Jan 29, 2024
1 parent 3468dc8 commit fa09831
Show file tree
Hide file tree
Showing 19 changed files with 314 additions and 314 deletions.
26 changes: 13 additions & 13 deletions .CMake/alg_support.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -233,24 +233,24 @@ endif()


option(OQS_ENABLE_KEM_ML_KEM "Enable ml_kem algorithm family" ON)
cmake_dependent_option(OQS_ENABLE_KEM_ml_kem_512 "" ON "OQS_ENABLE_KEM_ML_KEM" OFF)
cmake_dependent_option(OQS_ENABLE_KEM_ml_kem_512_ipd "" ON "OQS_ENABLE_KEM_ML_KEM" OFF)
if(CMAKE_SYSTEM_NAME MATCHES "Linux|Darwin")
if(OQS_DIST_X86_64_BUILD OR (OQS_USE_AVX2_INSTRUCTIONS AND OQS_USE_BMI2_INSTRUCTIONS AND OQS_USE_POPCNT_INSTRUCTIONS))
cmake_dependent_option(OQS_ENABLE_KEM_ml_kem_512_avx2 "" ON "OQS_ENABLE_KEM_ml_kem_512" OFF)
cmake_dependent_option(OQS_ENABLE_KEM_ml_kem_512_ipd_avx2 "" ON "OQS_ENABLE_KEM_ml_kem_512_ipd" OFF)
endif()
endif()

cmake_dependent_option(OQS_ENABLE_KEM_ml_kem_768 "" ON "OQS_ENABLE_KEM_ML_KEM" OFF)
cmake_dependent_option(OQS_ENABLE_KEM_ml_kem_768_ipd "" ON "OQS_ENABLE_KEM_ML_KEM" OFF)
if(CMAKE_SYSTEM_NAME MATCHES "Linux|Darwin")
if(OQS_DIST_X86_64_BUILD OR (OQS_USE_AVX2_INSTRUCTIONS AND OQS_USE_BMI2_INSTRUCTIONS AND OQS_USE_POPCNT_INSTRUCTIONS))
cmake_dependent_option(OQS_ENABLE_KEM_ml_kem_768_avx2 "" ON "OQS_ENABLE_KEM_ml_kem_768" OFF)
cmake_dependent_option(OQS_ENABLE_KEM_ml_kem_768_ipd_avx2 "" ON "OQS_ENABLE_KEM_ml_kem_768_ipd" OFF)
endif()
endif()

cmake_dependent_option(OQS_ENABLE_KEM_ml_kem_1024 "" ON "OQS_ENABLE_KEM_ML_KEM" OFF)
cmake_dependent_option(OQS_ENABLE_KEM_ml_kem_1024_ipd "" ON "OQS_ENABLE_KEM_ML_KEM" OFF)
if(CMAKE_SYSTEM_NAME MATCHES "Linux|Darwin")
if(OQS_DIST_X86_64_BUILD OR (OQS_USE_AVX2_INSTRUCTIONS AND OQS_USE_BMI2_INSTRUCTIONS AND OQS_USE_POPCNT_INSTRUCTIONS))
cmake_dependent_option(OQS_ENABLE_KEM_ml_kem_1024_avx2 "" ON "OQS_ENABLE_KEM_ml_kem_1024" OFF)
cmake_dependent_option(OQS_ENABLE_KEM_ml_kem_1024_ipd_avx2 "" ON "OQS_ENABLE_KEM_ml_kem_1024_ipd" OFF)
endif()
endif()

Expand Down Expand Up @@ -297,24 +297,24 @@ endif()


option(OQS_ENABLE_SIG_ML_DSA "Enable ml_dsa algorithm family" ON)
cmake_dependent_option(OQS_ENABLE_SIG_ml_dsa_44 "" ON "OQS_ENABLE_SIG_ML_DSA" OFF)
cmake_dependent_option(OQS_ENABLE_SIG_ml_dsa_44_ipd "" ON "OQS_ENABLE_SIG_ML_DSA" OFF)
if(CMAKE_SYSTEM_NAME MATCHES "Darwin|Linux")
if(OQS_DIST_X86_64_BUILD OR (OQS_USE_AVX2_INSTRUCTIONS AND OQS_USE_POPCNT_INSTRUCTIONS))
cmake_dependent_option(OQS_ENABLE_SIG_ml_dsa_44_avx2 "" ON "OQS_ENABLE_SIG_ml_dsa_44" OFF)
cmake_dependent_option(OQS_ENABLE_SIG_ml_dsa_44_ipd_avx2 "" ON "OQS_ENABLE_SIG_ml_dsa_44_ipd" OFF)
endif()
endif()

cmake_dependent_option(OQS_ENABLE_SIG_ml_dsa_65 "" ON "OQS_ENABLE_SIG_ML_DSA" OFF)
cmake_dependent_option(OQS_ENABLE_SIG_ml_dsa_65_ipd "" ON "OQS_ENABLE_SIG_ML_DSA" OFF)
if(CMAKE_SYSTEM_NAME MATCHES "Darwin|Linux")
if(OQS_DIST_X86_64_BUILD OR (OQS_USE_AVX2_INSTRUCTIONS AND OQS_USE_POPCNT_INSTRUCTIONS))
cmake_dependent_option(OQS_ENABLE_SIG_ml_dsa_65_avx2 "" ON "OQS_ENABLE_SIG_ml_dsa_65" OFF)
cmake_dependent_option(OQS_ENABLE_SIG_ml_dsa_65_ipd_avx2 "" ON "OQS_ENABLE_SIG_ml_dsa_65_ipd" OFF)
endif()
endif()

cmake_dependent_option(OQS_ENABLE_SIG_ml_dsa_87 "" ON "OQS_ENABLE_SIG_ML_DSA" OFF)
cmake_dependent_option(OQS_ENABLE_SIG_ml_dsa_87_ipd "" ON "OQS_ENABLE_SIG_ML_DSA" OFF)
if(CMAKE_SYSTEM_NAME MATCHES "Darwin|Linux")
if(OQS_DIST_X86_64_BUILD OR (OQS_USE_AVX2_INSTRUCTIONS AND OQS_USE_POPCNT_INSTRUCTIONS))
cmake_dependent_option(OQS_ENABLE_SIG_ml_dsa_87_avx2 "" ON "OQS_ENABLE_SIG_ml_dsa_87" OFF)
cmake_dependent_option(OQS_ENABLE_SIG_ml_dsa_87_ipd_avx2 "" ON "OQS_ENABLE_SIG_ml_dsa_87_ipd" OFF)
endif()
endif()

Expand Down Expand Up @@ -442,7 +442,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_kyber_512;KEM_kyber_768;KEM_kyber_1024;KEM_ml_kem_512;KEM_ml_kem_768;KEM_ml_kem_1024;SIG_dilithium_2;SIG_dilithium_3;SIG_dilithium_5;SIG_ml_dsa_44;SIG_ml_dsa_65;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")
filter_algs("KEM_kyber_512;KEM_kyber_768;KEM_kyber_1024;KEM_ml_kem_512_ipd;KEM_ml_kem_768_ipd;KEM_ml_kem_1024_ipd;SIG_dilithium_2;SIG_dilithium_3;SIG_dilithium_5;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")
##### 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
12 changes: 6 additions & 6 deletions scripts/copy_from_upstream/copy_from_upstream.yml
Original file line number Diff line number Diff line change
Expand Up @@ -143,15 +143,15 @@ kems:
upstream_location: pqcrystals-kyber-standard
schemes:
-
scheme: "512"
scheme: "512_ipd"
pqclean_scheme: ml-kem-512-ipd
pretty_name_full: ML-KEM-512-ipd
-
scheme: "768"
scheme: "768_ipd"
pqclean_scheme: ml-kem-768-ipd
pretty_name_full: ML-KEM-768-ipd
-
scheme: "1024"
scheme: "1024_ipd"
pqclean_scheme: ml-kem-1024-ipd
pretty_name_full: ML-KEM-1024-ipd
sigs:
Expand Down Expand Up @@ -185,17 +185,17 @@ sigs:
upstream_location: pqcrystals-dilithium-standard
schemes:
-
scheme: "44"
scheme: "44_ipd"
pqclean_scheme: ml-dsa-44-ipd
pretty_name_full: ML-DSA-44-ipd
signed_msg_order: sig_then_msg
-
scheme: "65"
scheme: "65_ipd"
pqclean_scheme: ml-dsa-65-ipd
pretty_name_full: ML-DSA-65-ipd
signed_msg_order: sig_then_msg
-
scheme: "87"
scheme: "87_ipd"
pqclean_scheme: ml-dsa-87-ipd
pretty_name_full: ML-DSA-87-ipd
signed_msg_order: sig_then_msg
Expand Down
36 changes: 18 additions & 18 deletions src/kem/kem.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ OQS_API const char *OQS_KEM_alg_identifier(size_t i) {
OQS_KEM_alg_kyber_512,
OQS_KEM_alg_kyber_768,
OQS_KEM_alg_kyber_1024,
OQS_KEM_alg_ml_kem_512,
OQS_KEM_alg_ml_kem_768,
OQS_KEM_alg_ml_kem_1024,
OQS_KEM_alg_ml_kem_512_ipd,
OQS_KEM_alg_ml_kem_768_ipd,
OQS_KEM_alg_ml_kem_1024_ipd,
///// OQS_COPY_FROM_UPSTREAM_FRAGMENT_ALG_IDENTIFIER_END
OQS_KEM_alg_ntruprime_sntrup761,
OQS_KEM_alg_frodokem_640_aes,
Expand Down Expand Up @@ -175,20 +175,20 @@ OQS_API int OQS_KEM_alg_is_enabled(const char *method_name) {
#else
return 0;
#endif
} else if (0 == strcasecmp(method_name, OQS_KEM_alg_ml_kem_512)) {
#ifdef OQS_ENABLE_KEM_ml_kem_512
} else if (0 == strcasecmp(method_name, OQS_KEM_alg_ml_kem_512_ipd)) {
#ifdef OQS_ENABLE_KEM_ml_kem_512_ipd
return 1;
#else
return 0;
#endif
} else if (0 == strcasecmp(method_name, OQS_KEM_alg_ml_kem_768)) {
#ifdef OQS_ENABLE_KEM_ml_kem_768
} else if (0 == strcasecmp(method_name, OQS_KEM_alg_ml_kem_768_ipd)) {
#ifdef OQS_ENABLE_KEM_ml_kem_768_ipd
return 1;
#else
return 0;
#endif
} else if (0 == strcasecmp(method_name, OQS_KEM_alg_ml_kem_1024)) {
#ifdef OQS_ENABLE_KEM_ml_kem_1024
} else if (0 == strcasecmp(method_name, OQS_KEM_alg_ml_kem_1024_ipd)) {
#ifdef OQS_ENABLE_KEM_ml_kem_1024_ipd
return 1;
#else
return 0;
Expand Down Expand Up @@ -361,21 +361,21 @@ OQS_API OQS_KEM *OQS_KEM_new(const char *method_name) {
#else
return NULL;
#endif
} else if (0 == strcasecmp(method_name, OQS_KEM_alg_ml_kem_512)) {
#ifdef OQS_ENABLE_KEM_ml_kem_512
return OQS_KEM_ml_kem_512_new();
} else if (0 == strcasecmp(method_name, OQS_KEM_alg_ml_kem_512_ipd)) {
#ifdef OQS_ENABLE_KEM_ml_kem_512_ipd
return OQS_KEM_ml_kem_512_ipd_new();
#else
return NULL;
#endif
} else if (0 == strcasecmp(method_name, OQS_KEM_alg_ml_kem_768)) {
#ifdef OQS_ENABLE_KEM_ml_kem_768
return OQS_KEM_ml_kem_768_new();
} else if (0 == strcasecmp(method_name, OQS_KEM_alg_ml_kem_768_ipd)) {
#ifdef OQS_ENABLE_KEM_ml_kem_768_ipd
return OQS_KEM_ml_kem_768_ipd_new();
#else
return NULL;
#endif
} else if (0 == strcasecmp(method_name, OQS_KEM_alg_ml_kem_1024)) {
#ifdef OQS_ENABLE_KEM_ml_kem_1024
return OQS_KEM_ml_kem_1024_new();
} else if (0 == strcasecmp(method_name, OQS_KEM_alg_ml_kem_1024_ipd)) {
#ifdef OQS_ENABLE_KEM_ml_kem_1024_ipd
return OQS_KEM_ml_kem_1024_ipd_new();
#else
return NULL;
#endif
Expand Down
6 changes: 3 additions & 3 deletions src/kem/kem.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,11 @@ extern "C" {
/** Algorithm identifier for Kyber1024 KEM. */
#define OQS_KEM_alg_kyber_1024 "Kyber1024"
/** Algorithm identifier for ML-KEM-512-ipd KEM. */
#define OQS_KEM_alg_ml_kem_512 "ML-KEM-512-ipd"
#define OQS_KEM_alg_ml_kem_512_ipd "ML-KEM-512-ipd"
/** Algorithm identifier for ML-KEM-768-ipd KEM. */
#define OQS_KEM_alg_ml_kem_768 "ML-KEM-768-ipd"
#define OQS_KEM_alg_ml_kem_768_ipd "ML-KEM-768-ipd"
/** Algorithm identifier for ML-KEM-1024-ipd KEM. */
#define OQS_KEM_alg_ml_kem_1024 "ML-KEM-1024-ipd"
#define OQS_KEM_alg_ml_kem_1024_ipd "ML-KEM-1024-ipd"
///// OQS_COPY_FROM_UPSTREAM_FRAGMENT_ALG_IDENTIFIER_END
/** Algorithm identifier for sntrup761 KEM. */
#define OQS_KEM_alg_ntruprime_sntrup761 "sntrup761"
Expand Down
Loading

0 comments on commit fa09831

Please sign in to comment.