Skip to content

Commit 74bb14a

Browse files
committed
CMake: add LMS verify-only, small and shake256 sub-options
CMake wired only the LMS sha256-192 and no-sha256-256 variants, while autotools --enable-lms also supports verify-only, small and shake256. Add the three missing sub-options (WOLFSSL_LMSVERIFYONLY, WOLFSSL_LMSSMALL, WOLFSSL_LMSSHAKE256), emitting WOLFSSL_LMS_VERIFY_ONLY, WOLFSSL_WC_LMS_SMALL and WOLFSSL_LMS_SHAKE256, and expose them in the generated options.h so the CMake and autotools LMS configurations match.
1 parent 961d5c8 commit 74bb14a

2 files changed

Lines changed: 36 additions & 0 deletions

File tree

CMakeLists.txt

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1010,6 +1010,18 @@ add_option(WOLFSSL_LMSNOSHA256256
10101010
"Disable the LMS SHA_256_256 standard variant (default: disabled)"
10111011
"no" "yes;no")
10121012

1013+
add_option(WOLFSSL_LMSVERIFYONLY
1014+
"Enable the LMS/HSS verify-only implementation (default: disabled)"
1015+
"no" "yes;no")
1016+
1017+
add_option(WOLFSSL_LMSSMALL
1018+
"Enable the smaller, slower LMS/HSS implementation (default: disabled)"
1019+
"no" "yes;no")
1020+
1021+
add_option(WOLFSSL_LMSSHAKE256
1022+
"Enable the LMS SHAKE256 variant (default: disabled)"
1023+
"no" "yes;no")
1024+
10131025
if (WOLFSSL_LMS)
10141026
list(APPEND WOLFSSL_DEFINITIONS "-DWOLFSSL_HAVE_LMS")
10151027

@@ -1026,6 +1038,24 @@ if (WOLFSSL_LMS)
10261038

10271039
set_wolfssl_definitions("WOLFSSL_NO_LMS_SHA256_256" RESULT)
10281040
endif()
1041+
1042+
if (WOLFSSL_LMSVERIFYONLY)
1043+
list(APPEND WOLFSSL_DEFINITIONS "-DWOLFSSL_LMS_VERIFY_ONLY")
1044+
1045+
set_wolfssl_definitions("WOLFSSL_LMS_VERIFY_ONLY" RESULT)
1046+
endif()
1047+
1048+
if (WOLFSSL_LMSSMALL)
1049+
list(APPEND WOLFSSL_DEFINITIONS "-DWOLFSSL_WC_LMS_SMALL")
1050+
1051+
set_wolfssl_definitions("WOLFSSL_WC_LMS_SMALL" RESULT)
1052+
endif()
1053+
1054+
if (WOLFSSL_LMSSHAKE256)
1055+
list(APPEND WOLFSSL_DEFINITIONS "-DWOLFSSL_LMS_SHAKE256")
1056+
1057+
set_wolfssl_definitions("WOLFSSL_LMS_SHAKE256" RESULT)
1058+
endif()
10291059
endif()
10301060

10311061
# Experimental features

cmake/options.h.in

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -409,6 +409,12 @@ extern "C" {
409409
#cmakedefine WOLFSSL_LMS_SHA256_192
410410
#undef WOLFSSL_NO_LMS_SHA256_256
411411
#cmakedefine WOLFSSL_NO_LMS_SHA256_256
412+
#undef WOLFSSL_LMS_VERIFY_ONLY
413+
#cmakedefine WOLFSSL_LMS_VERIFY_ONLY
414+
#undef WOLFSSL_WC_LMS_SMALL
415+
#cmakedefine WOLFSSL_WC_LMS_SMALL
416+
#undef WOLFSSL_LMS_SHAKE256
417+
#cmakedefine WOLFSSL_LMS_SHAKE256
412418
#undef WOLFSSL_HAVE_XMSS
413419
#cmakedefine WOLFSSL_HAVE_XMSS
414420
#undef WOLFSSL_WC_XMSS

0 commit comments

Comments
 (0)