Skip to content

Commit 4a01abc

Browse files
rben-devbhess
authored andcommitted
Add MQOM to liboqs (open-quantum-safe#2385)
* Add common dependencies with include_only Signed-off-by: Basil Hess <bhe@zurich.ibm.com> * Remove incorrect debug print in copy_from_upstream Signed-off-by: Basil Hess <bhe@zurich.ibm.com> * Add readme for copy_from_upstream Signed-off-by: Basil Hess <bhe@zurich.ibm.com> * Import MQOM: - memopt variant of the algorithm allowed using PR open-quantum-safe#2367 - common files for all variants are factorized using PR open-quantum-safe#2382 [extended tests] Signed-off-by: Ryad Benadjila <ryadbenadjila@gmail.com> --------- Signed-off-by: Basil Hess <bhe@zurich.ibm.com> Signed-off-by: Ryad Benadjila <ryadbenadjila@gmail.com> Co-authored-by: Basil Hess <bhe@zurich.ibm.com> Signed-off-by: Will Bates <william.bates11@outlook.com>
1 parent 19e8316 commit 4a01abc

143 files changed

Lines changed: 28801 additions & 24 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.CMake/alg_support.cmake

Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,20 @@ cmake_dependent_option(OQS_ENABLE_SIG_snova_SNOVA_37_8_4 "" ON "OQS_ENABLE_SIG_S
238238
cmake_dependent_option(OQS_ENABLE_SIG_snova_SNOVA_24_5_5 "" ON "OQS_ENABLE_SIG_SNOVA" OFF)
239239
cmake_dependent_option(OQS_ENABLE_SIG_snova_SNOVA_60_10_4 "" ON "OQS_ENABLE_SIG_SNOVA" OFF)
240240
cmake_dependent_option(OQS_ENABLE_SIG_snova_SNOVA_29_6_5 "" ON "OQS_ENABLE_SIG_SNOVA" OFF)
241+
242+
option(OQS_ENABLE_SIG_MQOM "Enable mqom algorithm family" ON)
243+
cmake_dependent_option(OQS_ENABLE_SIG_mqom_mqom2_cat1_gf16_fast_r3 "" ON "OQS_ENABLE_SIG_MQOM" OFF)
244+
cmake_dependent_option(OQS_ENABLE_SIG_mqom_mqom2_cat1_gf16_fast_r5 "" ON "OQS_ENABLE_SIG_MQOM" OFF)
245+
cmake_dependent_option(OQS_ENABLE_SIG_mqom_mqom2_cat1_gf16_short_r3 "" ON "OQS_ENABLE_SIG_MQOM" OFF)
246+
cmake_dependent_option(OQS_ENABLE_SIG_mqom_mqom2_cat1_gf16_short_r5 "" ON "OQS_ENABLE_SIG_MQOM" OFF)
247+
cmake_dependent_option(OQS_ENABLE_SIG_mqom_mqom2_cat3_gf16_fast_r3 "" ON "OQS_ENABLE_SIG_MQOM" OFF)
248+
cmake_dependent_option(OQS_ENABLE_SIG_mqom_mqom2_cat3_gf16_fast_r5 "" ON "OQS_ENABLE_SIG_MQOM" OFF)
249+
cmake_dependent_option(OQS_ENABLE_SIG_mqom_mqom2_cat3_gf16_short_r3 "" ON "OQS_ENABLE_SIG_MQOM" OFF)
250+
cmake_dependent_option(OQS_ENABLE_SIG_mqom_mqom2_cat3_gf16_short_r5 "" ON "OQS_ENABLE_SIG_MQOM" OFF)
251+
cmake_dependent_option(OQS_ENABLE_SIG_mqom_mqom2_cat5_gf16_fast_r3 "" ON "OQS_ENABLE_SIG_MQOM" OFF)
252+
cmake_dependent_option(OQS_ENABLE_SIG_mqom_mqom2_cat5_gf16_fast_r5 "" ON "OQS_ENABLE_SIG_MQOM" OFF)
253+
cmake_dependent_option(OQS_ENABLE_SIG_mqom_mqom2_cat5_gf16_short_r3 "" ON "OQS_ENABLE_SIG_MQOM" OFF)
254+
cmake_dependent_option(OQS_ENABLE_SIG_mqom_mqom2_cat5_gf16_short_r5 "" ON "OQS_ENABLE_SIG_MQOM" OFF)
241255
##### OQS_COPY_FROM_UPSTREAM_FRAGMENT_ADD_ENABLE_BY_ALG_END
242256
##### OQS_COPY_FROM_SLH_DSA_FRAGMENT_ADD_ENABLE_BY_ALG_START
243257
option(OQS_ENABLE_SIG_SLH_DSA "Enable slh_dsa algorithm family" ON)
@@ -1111,6 +1125,115 @@ if(OQS_DIST_ARM64_V8_BUILD OR (OQS_USE_ARM_NEON_INSTRUCTIONS AND OQS_USE_ARM_NEO
11111125
endif()
11121126
endif()
11131127

1128+
1129+
if(OQS_MEMOPT_BUILD)
1130+
cmake_dependent_option(OQS_ENABLE_SIG_mqom_mqom2_cat1_gf16_fast_r3_memopt "" ON "OQS_ENABLE_SIG_mqom_mqom2_cat1_gf16_fast_r3" OFF)
1131+
endif() # OQS_MEMOPT_BUILD
1132+
if(CMAKE_SYSTEM_NAME MATCHES "Linux|Darwin")
1133+
if(OQS_DIST_X86_64_BUILD OR (OQS_USE_AVX2_INSTRUCTIONS AND OQS_USE_AES_INSTRUCTIONS))
1134+
cmake_dependent_option(OQS_ENABLE_SIG_mqom_mqom2_cat1_gf16_fast_r3_avx2 "" ON "OQS_ENABLE_SIG_mqom_mqom2_cat1_gf16_fast_r3" OFF)
1135+
endif()
1136+
endif()
1137+
1138+
if(OQS_MEMOPT_BUILD)
1139+
cmake_dependent_option(OQS_ENABLE_SIG_mqom_mqom2_cat1_gf16_fast_r5_memopt "" ON "OQS_ENABLE_SIG_mqom_mqom2_cat1_gf16_fast_r5" OFF)
1140+
endif() # OQS_MEMOPT_BUILD
1141+
if(CMAKE_SYSTEM_NAME MATCHES "Linux|Darwin")
1142+
if(OQS_DIST_X86_64_BUILD OR (OQS_USE_AVX2_INSTRUCTIONS AND OQS_USE_AES_INSTRUCTIONS))
1143+
cmake_dependent_option(OQS_ENABLE_SIG_mqom_mqom2_cat1_gf16_fast_r5_avx2 "" ON "OQS_ENABLE_SIG_mqom_mqom2_cat1_gf16_fast_r5" OFF)
1144+
endif()
1145+
endif()
1146+
1147+
if(OQS_MEMOPT_BUILD)
1148+
cmake_dependent_option(OQS_ENABLE_SIG_mqom_mqom2_cat1_gf16_short_r3_memopt "" ON "OQS_ENABLE_SIG_mqom_mqom2_cat1_gf16_short_r3" OFF)
1149+
endif() # OQS_MEMOPT_BUILD
1150+
if(CMAKE_SYSTEM_NAME MATCHES "Linux|Darwin")
1151+
if(OQS_DIST_X86_64_BUILD OR (OQS_USE_AVX2_INSTRUCTIONS AND OQS_USE_AES_INSTRUCTIONS))
1152+
cmake_dependent_option(OQS_ENABLE_SIG_mqom_mqom2_cat1_gf16_short_r3_avx2 "" ON "OQS_ENABLE_SIG_mqom_mqom2_cat1_gf16_short_r3" OFF)
1153+
endif()
1154+
endif()
1155+
1156+
if(OQS_MEMOPT_BUILD)
1157+
cmake_dependent_option(OQS_ENABLE_SIG_mqom_mqom2_cat1_gf16_short_r5_memopt "" ON "OQS_ENABLE_SIG_mqom_mqom2_cat1_gf16_short_r5" OFF)
1158+
endif() # OQS_MEMOPT_BUILD
1159+
if(CMAKE_SYSTEM_NAME MATCHES "Linux|Darwin")
1160+
if(OQS_DIST_X86_64_BUILD OR (OQS_USE_AVX2_INSTRUCTIONS AND OQS_USE_AES_INSTRUCTIONS))
1161+
cmake_dependent_option(OQS_ENABLE_SIG_mqom_mqom2_cat1_gf16_short_r5_avx2 "" ON "OQS_ENABLE_SIG_mqom_mqom2_cat1_gf16_short_r5" OFF)
1162+
endif()
1163+
endif()
1164+
1165+
if(OQS_MEMOPT_BUILD)
1166+
cmake_dependent_option(OQS_ENABLE_SIG_mqom_mqom2_cat3_gf16_fast_r3_memopt "" ON "OQS_ENABLE_SIG_mqom_mqom2_cat3_gf16_fast_r3" OFF)
1167+
endif() # OQS_MEMOPT_BUILD
1168+
if(CMAKE_SYSTEM_NAME MATCHES "Linux|Darwin")
1169+
if(OQS_DIST_X86_64_BUILD OR (OQS_USE_AVX2_INSTRUCTIONS AND OQS_USE_AES_INSTRUCTIONS))
1170+
cmake_dependent_option(OQS_ENABLE_SIG_mqom_mqom2_cat3_gf16_fast_r3_avx2 "" ON "OQS_ENABLE_SIG_mqom_mqom2_cat3_gf16_fast_r3" OFF)
1171+
endif()
1172+
endif()
1173+
1174+
if(OQS_MEMOPT_BUILD)
1175+
cmake_dependent_option(OQS_ENABLE_SIG_mqom_mqom2_cat3_gf16_fast_r5_memopt "" ON "OQS_ENABLE_SIG_mqom_mqom2_cat3_gf16_fast_r5" OFF)
1176+
endif() # OQS_MEMOPT_BUILD
1177+
if(CMAKE_SYSTEM_NAME MATCHES "Linux|Darwin")
1178+
if(OQS_DIST_X86_64_BUILD OR (OQS_USE_AVX2_INSTRUCTIONS AND OQS_USE_AES_INSTRUCTIONS))
1179+
cmake_dependent_option(OQS_ENABLE_SIG_mqom_mqom2_cat3_gf16_fast_r5_avx2 "" ON "OQS_ENABLE_SIG_mqom_mqom2_cat3_gf16_fast_r5" OFF)
1180+
endif()
1181+
endif()
1182+
1183+
if(OQS_MEMOPT_BUILD)
1184+
cmake_dependent_option(OQS_ENABLE_SIG_mqom_mqom2_cat3_gf16_short_r3_memopt "" ON "OQS_ENABLE_SIG_mqom_mqom2_cat3_gf16_short_r3" OFF)
1185+
endif() # OQS_MEMOPT_BUILD
1186+
if(CMAKE_SYSTEM_NAME MATCHES "Linux|Darwin")
1187+
if(OQS_DIST_X86_64_BUILD OR (OQS_USE_AVX2_INSTRUCTIONS AND OQS_USE_AES_INSTRUCTIONS))
1188+
cmake_dependent_option(OQS_ENABLE_SIG_mqom_mqom2_cat3_gf16_short_r3_avx2 "" ON "OQS_ENABLE_SIG_mqom_mqom2_cat3_gf16_short_r3" OFF)
1189+
endif()
1190+
endif()
1191+
1192+
if(OQS_MEMOPT_BUILD)
1193+
cmake_dependent_option(OQS_ENABLE_SIG_mqom_mqom2_cat3_gf16_short_r5_memopt "" ON "OQS_ENABLE_SIG_mqom_mqom2_cat3_gf16_short_r5" OFF)
1194+
endif() # OQS_MEMOPT_BUILD
1195+
if(CMAKE_SYSTEM_NAME MATCHES "Linux|Darwin")
1196+
if(OQS_DIST_X86_64_BUILD OR (OQS_USE_AVX2_INSTRUCTIONS AND OQS_USE_AES_INSTRUCTIONS))
1197+
cmake_dependent_option(OQS_ENABLE_SIG_mqom_mqom2_cat3_gf16_short_r5_avx2 "" ON "OQS_ENABLE_SIG_mqom_mqom2_cat3_gf16_short_r5" OFF)
1198+
endif()
1199+
endif()
1200+
1201+
if(OQS_MEMOPT_BUILD)
1202+
cmake_dependent_option(OQS_ENABLE_SIG_mqom_mqom2_cat5_gf16_fast_r3_memopt "" ON "OQS_ENABLE_SIG_mqom_mqom2_cat5_gf16_fast_r3" OFF)
1203+
endif() # OQS_MEMOPT_BUILD
1204+
if(CMAKE_SYSTEM_NAME MATCHES "Linux|Darwin")
1205+
if(OQS_DIST_X86_64_BUILD OR (OQS_USE_AVX2_INSTRUCTIONS AND OQS_USE_AES_INSTRUCTIONS))
1206+
cmake_dependent_option(OQS_ENABLE_SIG_mqom_mqom2_cat5_gf16_fast_r3_avx2 "" ON "OQS_ENABLE_SIG_mqom_mqom2_cat5_gf16_fast_r3" OFF)
1207+
endif()
1208+
endif()
1209+
1210+
if(OQS_MEMOPT_BUILD)
1211+
cmake_dependent_option(OQS_ENABLE_SIG_mqom_mqom2_cat5_gf16_fast_r5_memopt "" ON "OQS_ENABLE_SIG_mqom_mqom2_cat5_gf16_fast_r5" OFF)
1212+
endif() # OQS_MEMOPT_BUILD
1213+
if(CMAKE_SYSTEM_NAME MATCHES "Linux|Darwin")
1214+
if(OQS_DIST_X86_64_BUILD OR (OQS_USE_AVX2_INSTRUCTIONS AND OQS_USE_AES_INSTRUCTIONS))
1215+
cmake_dependent_option(OQS_ENABLE_SIG_mqom_mqom2_cat5_gf16_fast_r5_avx2 "" ON "OQS_ENABLE_SIG_mqom_mqom2_cat5_gf16_fast_r5" OFF)
1216+
endif()
1217+
endif()
1218+
1219+
if(OQS_MEMOPT_BUILD)
1220+
cmake_dependent_option(OQS_ENABLE_SIG_mqom_mqom2_cat5_gf16_short_r3_memopt "" ON "OQS_ENABLE_SIG_mqom_mqom2_cat5_gf16_short_r3" OFF)
1221+
endif() # OQS_MEMOPT_BUILD
1222+
if(CMAKE_SYSTEM_NAME MATCHES "Linux|Darwin")
1223+
if(OQS_DIST_X86_64_BUILD OR (OQS_USE_AVX2_INSTRUCTIONS AND OQS_USE_AES_INSTRUCTIONS))
1224+
cmake_dependent_option(OQS_ENABLE_SIG_mqom_mqom2_cat5_gf16_short_r3_avx2 "" ON "OQS_ENABLE_SIG_mqom_mqom2_cat5_gf16_short_r3" OFF)
1225+
endif()
1226+
endif()
1227+
1228+
if(OQS_MEMOPT_BUILD)
1229+
cmake_dependent_option(OQS_ENABLE_SIG_mqom_mqom2_cat5_gf16_short_r5_memopt "" ON "OQS_ENABLE_SIG_mqom_mqom2_cat5_gf16_short_r5" OFF)
1230+
endif() # OQS_MEMOPT_BUILD
1231+
if(CMAKE_SYSTEM_NAME MATCHES "Linux|Darwin")
1232+
if(OQS_DIST_X86_64_BUILD OR (OQS_USE_AVX2_INSTRUCTIONS AND OQS_USE_AES_INSTRUCTIONS))
1233+
cmake_dependent_option(OQS_ENABLE_SIG_mqom_mqom2_cat5_gf16_short_r5_avx2 "" ON "OQS_ENABLE_SIG_mqom_mqom2_cat5_gf16_short_r5" OFF)
1234+
endif()
1235+
endif()
1236+
11141237
##### OQS_COPY_FROM_UPSTREAM_FRAGMENT_ADD_ENABLE_BY_ALG_CONDITIONAL_END
11151238

11161239
##### OQS_COPY_FROM_LIBJADE_FRAGMENT_ADD_ENABLE_BY_ALG_CONDITIONAL_START

CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,9 @@ endif()
278278
if(OQS_ENABLE_SIG_SNOVA)
279279
set(PUBLIC_HEADERS ${PUBLIC_HEADERS} ${PROJECT_SOURCE_DIR}/src/sig/snova/sig_snova.h)
280280
endif()
281+
if(OQS_ENABLE_SIG_MQOM)
282+
set(PUBLIC_HEADERS ${PUBLIC_HEADERS} ${PROJECT_SOURCE_DIR}/src/sig/mqom/sig_mqom.h)
283+
endif()
281284
##### OQS_COPY_FROM_UPSTREAM_FRAGMENT_INCLUDE_HEADERS_END
282285
if(OQS_ENABLE_SIG_SLH_DSA)
283286
set(PUBLIC_HEADERS ${PUBLIC_HEADERS} ${PROJECT_SOURCE_DIR}/src/sig/slh_dsa/sig_slh_dsa.h)

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ All names other than `ML-KEM` and `ML-DSA` are subject to change. `liboqs` makes
7474
| Falcon | Selected by [NIST](https://csrc.nist.gov/CSRC/media/Projects/post-quantum-cryptography/documents/round-3/submissions/Falcon-Round3.zip) for upcoming standardization | [`PQClean/PQClean@1eacfda`](https://github.com/PQClean/PQClean/commit/1eacfdafc15ddc5d5759d0b85b4cef26627df181) |
7575
| MAYO | Under [NIST](https://csrc.nist.gov/csrc/media/Projects/pqc-dig-sig/documents/round-2/spec-files/mayo-spec-round2-web.pdf) consideration | [`PQCMayo/MAYO-C@4b7cd94`](https://github.com/PQCMayo/MAYO-C/commit/4b7cd94c96b9522864efe40c6ad1fa269584a807) |
7676
| ML-DSA | Standardized by [NIST](https://csrc.nist.gov/pubs/fips/204/final) | [`pq-code-package/mldsa-native@f48f164`](https://github.com/pq-code-package/mldsa-native/commit/f48f164cefb07f4ffa519ddda7cee670b8ee3517) |
77+
| MQOM | Under [NIST](https://csrc.nist.gov/csrc/media/Projects/pqc-dig-sig/documents/round-2/spec-files/mqom-spec-round2-web.pdf) consideration | [`mqom/mqom-v2@ec6b7fa`](https://github.com/mqom/mqom-v2/commit/ec6b7fa86e232a25f8b2f151a4b4eebb8e81b5e7) |
7778
| SLH-DSA | Standardized by [NIST](https://csrc.nist.gov/pubs/fips/205/final) | [`pq-code-package/slhdsa-c@a0fc1ff`](https://github.com/pq-code-package/slhdsa-c/commit/a0fc1ff253930060d0246aebca06c2538eb92b88) |
7879
| SNOVA | Under [NIST](https://csrc.nist.gov/csrc/media/Projects/pqc-dig-sig/documents/round-2/spec-files/snova-spec-round2-web.pdf) consideration | [`vacuas/SNOVA@1c3ca6f`](https://github.com/vacuas/SNOVA/commit/1c3ca6f4f7286c0bde98d7d6f222cf63b9d52bff) |
7980
| UOV | Under [NIST](https://csrc.nist.gov/csrc/media/Projects/pqc-dig-sig/documents/round-2/spec-files/uov-spec-round2-web.pdf) consideration | [`pqov/pqov@33fa527`](https://github.com/pqov/pqov/commit/33fa5278754a32064c55901c3a17d48b06cc2351) |

0 commit comments

Comments
 (0)