Skip to content

Commit 329d697

Browse files
committed
Collapse WOLFSSL_WC_MLKEM / WOLFSSL_WC_DILITHIUM into their umbrellas
With the liboqs back-ends for ML-KEM and Dilithium gone, having two feature macros per algorithm (WOLFSSL_HAVE_MLKEM and WOLFSSL_WC_MLKEM, HAVE_DILITHIUM and WOLFSSL_WC_DILITHIUM) is redundant - the WC_ variant is always set whenever the umbrella is, and vice versa. Keep the umbrellas, drop the WC_ variants. WOLFSSL_WC_MLKEM -> WOLFSSL_HAVE_MLKEM WOLFSSL_WC_DILITHIUM -> HAVE_DILITHIUM Touches ~40 files: all #ifdef gates in wolfcrypt / src / tests, the Espressif/STM32/Zephyr/PlatformIO/C# user_settings.h templates, the ASM files that ship behind these macros, cmake/options.h.in, and the build-system entries. configure.ac loses the ENABLED_WC_MLKEM shell variable (was always tied to ENABLED_MLKEM anyway) and the -D flag emissions for both macros; CMakeLists.txt likewise stops defining the WC_ variants. Verified: ./configure --enable-mlkem --enable-mldsa && make check, the full Falcon build (--enable-experimental --with-liboqs --enable-falcon --enable-mlkem --enable-mldsa --enable-keygen --enable-certgen) passes make check, and the TLS 1.3 Falcon handshake matrix with openssl + oqs-provider is still green. Breaking for external users who defined WOLFSSL_WC_MLKEM / WOLFSSL_WC_DILITHIUM in their own user_settings.h - they should switch to WOLFSSL_HAVE_MLKEM / HAVE_DILITHIUM. Same class of breakage as the rest of this PR: we're deleting a legacy surface rather than preserving it.
1 parent cbd4cf3 commit 329d697

42 files changed

Lines changed: 122 additions & 153 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.

CMakeLists.txt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -637,13 +637,11 @@ add_option(WOLFSSL_MLKEM
637637

638638
if (WOLFSSL_MLKEM)
639639
list(APPEND WOLFSSL_DEFINITIONS "-DWOLFSSL_HAVE_MLKEM")
640-
list(APPEND WOLFSSL_DEFINITIONS "-DWOLFSSL_WC_MLKEM")
641640
list(APPEND WOLFSSL_DEFINITIONS "-DWOLFSSL_SHA3")
642641
list(APPEND WOLFSSL_DEFINITIONS "-DWOLFSSL_SHAKE128")
643642
list(APPEND WOLFSSL_DEFINITIONS "-DWOLFSSL_SHAKE256")
644643

645644
set_wolfssl_definitions("WOLFSSL_HAVE_MLKEM" RESULT)
646-
set_wolfssl_definitions("WOLFSSL_WC_MLKEM" RESULT)
647645
set_wolfssl_definitions("WOLFSSL_SHA3" RESULT)
648646
set_wolfssl_definitions("WOLFSSL_SHAKE128" RESULT)
649647
set_wolfssl_definitions("WOLFSSL_SHAKE256" RESULT)
@@ -682,13 +680,11 @@ add_option(WOLFSSL_DILITHIUM
682680

683681
if (WOLFSSL_DILITHIUM)
684682
list(APPEND WOLFSSL_DEFINITIONS "-DHAVE_DILITHIUM")
685-
list(APPEND WOLFSSL_DEFINITIONS "-DWOLFSSL_WC_DILITHIUM")
686683
list(APPEND WOLFSSL_DEFINITIONS "-DWOLFSSL_SHA3")
687684
list(APPEND WOLFSSL_DEFINITIONS "-DWOLFSSL_SHAKE128")
688685
list(APPEND WOLFSSL_DEFINITIONS "-DWOLFSSL_SHAKE256")
689686

690687
set_wolfssl_definitions("HAVE_DILITHIUM" RESULT)
691-
set_wolfssl_definitions("WOLFSSL_WC_DILITHIUM" RESULT)
692688
set_wolfssl_definitions("WOLFSSL_SHA3" RESULT)
693689
set_wolfssl_definitions("WOLFSSL_SHAKE128" RESULT)
694690
set_wolfssl_definitions("WOLFSSL_SHAKE256" RESULT)

IDE/Espressif/ESP-IDF/examples/template/components/wolfssl/include/user_settings.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,6 @@
215215
#ifdef CONFIG_ESP_WOLFSSL_ENABLE_MLKEM
216216
/* Kyber typically needs a minimum 10K stack */
217217
#define WOLFSSL_HAVE_MLKEM
218-
#define WOLFSSL_WC_MLKEM
219218
#define WOLFSSL_SHAKE128
220219
#define WOLFSSL_SHAKE256
221220

IDE/Espressif/ESP-IDF/examples/wolfssl_benchmark/components/wolfssl/include/user_settings.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,6 @@
215215
#ifdef CONFIG_ESP_WOLFSSL_ENABLE_MLKEM
216216
/* Kyber typically needs a minimum 10K stack */
217217
#define WOLFSSL_HAVE_MLKEM
218-
#define WOLFSSL_WC_MLKEM
219218
#define WOLFSSL_SHAKE128
220219
#define WOLFSSL_SHAKE256
221220

IDE/Espressif/ESP-IDF/examples/wolfssl_client/components/wolfssl/include/user_settings.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,6 @@
215215
#ifdef CONFIG_ESP_WOLFSSL_ENABLE_MLKEM
216216
/* Kyber typically needs a minimum 10K stack */
217217
#define WOLFSSL_HAVE_MLKEM
218-
#define WOLFSSL_WC_MLKEM
219218
#define WOLFSSL_SHAKE128
220219
#define WOLFSSL_SHAKE256
221220

IDE/Espressif/ESP-IDF/examples/wolfssl_client/main/client-tls.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
#undef USE_WOLFSSL_ESP_SDK_WIFI
4242
#include <wolfssl/ssl.h>
4343

44-
#if defined(WOLFSSL_WC_MLKEM)
44+
#if defined(WOLFSSL_HAVE_MLKEM)
4545
#include <wolfssl/wolfcrypt/wc_mlkem.h>
4646
#endif
4747
#if defined(USE_CERT_BUFFERS_2048) || defined(USE_CERT_BUFFERS_1024)

IDE/Espressif/ESP-IDF/examples/wolfssl_server/components/wolfssl/include/user_settings.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,6 @@
215215
#ifdef CONFIG_ESP_WOLFSSL_ENABLE_MLKEM
216216
/* Kyber typically needs a minimum 10K stack */
217217
#define WOLFSSL_HAVE_MLKEM
218-
#define WOLFSSL_WC_MLKEM
219218
#define WOLFSSL_SHAKE128
220219
#define WOLFSSL_SHAKE256
221220

IDE/Espressif/ESP-IDF/examples/wolfssl_server/main/server-tls.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
#error "Missing WOLFSSL_USER_SETTINGS in CMakeLists or Makefile:\
5555
CFLAGS +=-DWOLFSSL_USER_SETTINGS"
5656
#endif
57-
#if defined(WOLFSSL_WC_MLKEM)
57+
#if defined(WOLFSSL_HAVE_MLKEM)
5858
#include <wolfssl/wolfcrypt/wc_mlkem.h>
5959
#endif
6060
#if defined(USE_CERT_BUFFERS_2048) || defined(USE_CERT_BUFFERS_1024)

IDE/Espressif/ESP-IDF/examples/wolfssl_test/components/wolfssl/include/user_settings.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,6 @@
215215
#ifdef CONFIG_ESP_WOLFSSL_ENABLE_MLKEM
216216
/* Kyber typically needs a minimum 10K stack */
217217
#define WOLFSSL_HAVE_MLKEM
218-
#define WOLFSSL_WC_MLKEM
219218
#define WOLFSSL_SHAKE128
220219
#define WOLFSSL_SHAKE256
221220

IDE/STM32Cube/STM32_Benchmarks.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -700,7 +700,7 @@ Tested on commit: fa9e122f1cca32513611f5a24de88d07aced015b
700700
#define GCM_TABLE_4BIT
701701
702702
#define HAVE_DILITHIUM
703-
#define WOLFSSL_WC_DILITHIUM
703+
#define HAVE_DILITHIUM
704704
#define WOLFSSL_DILITHIUM_SMALL
705705
706706
#define WOLFSSL_ARMASM

IDE/STM32Cube/default_conf.ftl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -660,8 +660,8 @@ extern ${variable.value} ${variable.name};
660660
#undef WOLFSSL_HAVE_MLKEM
661661
#define WOLFSSL_HAVE_MLKEM
662662

663-
#undef WOLFSSL_WC_MLKEM
664-
#define WOLFSSL_WC_MLKEM
663+
#undef WOLFSSL_HAVE_MLKEM
664+
#define WOLFSSL_HAVE_MLKEM
665665

666666
#undef WOLFSSL_NO_SHAKE128
667667
#undef WOLFSSL_SHAKE128

0 commit comments

Comments
 (0)