@@ -603,6 +603,11 @@ add_option(WOLFSSL_MLKEM
603603 "Enable the wolfSSL PQ ML-KEM library (default: disabled)"
604604 "no" "yes;no" )
605605
606+ # Dilithium
607+ add_option (WOLFSSL_DILITHIUM
608+ "Enable the wolfSSL PQ Dilithium (ML-DSA) implementation (default: disabled)"
609+ "no" "yes;no" )
610+
606611# LMS
607612add_option (WOLFSSL_LMS
608613 "Enable the PQ LMS Stateful Hash-based Signature Scheme (default: disabled)"
@@ -700,6 +705,22 @@ if (WOLFSSL_EXPERIMENTAL)
700705 message (STATUS "Looking for WOLFSSL_LMS - not found" )
701706 endif ()
702707
708+ # Checking for experimental feature: Dilithium
709+ message (STATUS "Looking for WOLFSSL_DILITHIUM" )
710+ if (WOLFSSL_DILITHIUM)
711+ set (WOLFSSL_FOUND_EXPERIMENTAL_FEATURE 1)
712+
713+ message (STATUS "Automatically set related requirements for Dilithium:" )
714+ set_wolfssl_definitions ("HAVE_DILITHIUM" RESUlT )
715+ set_wolfssl_definitions ("WOLFSSL_WC_DILITHIUM" RESUlT )
716+ set_wolfssl_definitions ("WOLFSSL_SHA3" RESUlT )
717+ set_wolfssl_definitions ("WOLFSSL_SHAKE128" RESUlT )
718+ set_wolfssl_definitions ("WOLFSSL_SHAKE256" RESUlT )
719+ message (STATUS "Looking for WOLFSSL_DILITHIUM - found" )
720+ else ()
721+ message (STATUS "Looking for WOLFSSL_DILITHIUM - not found" )
722+ endif ()
723+
703724 # Other experimental feature detection can be added here...
704725
705726 # Were any experimental features found? Display a message.
@@ -713,7 +734,9 @@ if (WOLFSSL_EXPERIMENTAL)
713734 if (WOLFSSL_OQS AND WOLFSSL_MLKEM)
714735 message (FATAL_ERROR "Error: cannot enable both WOLFSSL_OQS and WOLFSSL_MLKEM at the same time." )
715736 endif ()
716-
737+ if (WOLFSSL_OQS AND WOLFSSL_DILITHIUM)
738+ message (FATAL_ERROR "Error: cannot enable both WOLFSSL_OQS and WOLFSSL_DILITHIUM at the same time." )
739+ endif ()
717740else ()
718741 # Experimental mode not enabled, but were any experimental features enabled? Error out if so:
719742 message (STATUS "Looking for WOLFSSL_EXPERIMENTAL - not found" )
@@ -723,6 +746,9 @@ else()
723746 if (WOLFSSL_MLKEM)
724747 message (FATAL_ERROR "Error: WOLFSSL_MLKEM requires WOLFSSL_EXPERIMENTAL at this time." )
725748 endif ()
749+ if (WOLFSSL_DILITHIUM)
750+ message (FATAL_ERROR "Error: WOLFSSL_DILITHIUM requires WOLFSSL_EXPERIMENTAL at this time." )
751+ endif ()
726752endif ()
727753
728754# LMS
@@ -1866,6 +1892,15 @@ if(NOT WOLFSSL_PKCS12)
18661892 list (APPEND WOLFSSL_DEFINITIONS "-DNO_PKCS12" )
18671893endif ()
18681894
1895+ # PKCS#11
1896+ add_option ("WOLFSSL_PKCS11"
1897+ "Enable PKCS#11 (default: disabled)"
1898+ "no" "yes;no" )
1899+
1900+ if (WOLFSSL_PKCS11 AND NOT WIN32 )
1901+ list (APPEND WOLFSSL_LINK_LIBS ${CMAKE_DL_LIBS} )
1902+ endif ()
1903+
18691904
18701905# PWDBASED has to come after certservice since we want it on w/o explicit on
18711906# PWDBASED
@@ -1964,7 +1999,6 @@ add_option("WOLFSSL_CRYPT_TESTS_HELP"
19641999 "no" "yes;no" )
19652000
19662001# TODO: - LIBZ
1967- # - PKCS#11
19682002# - Cavium
19692003# - Cavium V
19702004# - Cavium Octeon
0 commit comments