Skip to content

Commit c88674a

Browse files
committed
Rename Dilithium implementation file/symbols to ML-DSA, add backwards-compat shims
The post-quantum signature algorithm originally implemented as Dilithium was standardized by NIST as ML-DSA in FIPS 204. This commit renames the implementation file pair, the public API surface, and every internal helper to the canonical ML-DSA names, mirroring the earlier Kyber -> ML-KEM migration in wc_mlkem.{h,c}. This commit deliberately scopes the change to the rename + compatibility surface only. **No in-tree consumer call sites are converted.** Existing in-tree consumers (TLS layer, ASN.1 / EVP / cryptocb wrappers, tests, benchmark, examples, Rust wrapper) keep using the legacy spelling and compile through the dilithium.h symbol-alias shim and the bi-directional settings.h gate shim. New consumer code can include <wolfssl/wolfcrypt/wc_mldsa.h> directly and use the canonical names. Rebased onto current master (50da0c0) so that PR wolfSSL#10399's ML-DSA Wconversion fixes (commit 2833a4b, ~220 (sword32)/(byte)/(word32) casts in dilithium.c plus three cast hunks in asn.c) are inherited into the new wc_mldsa.c via the file rename. The asn.c cast hunks land separately on master and aren't part of this commit. File layout ----------- wolfcrypt/src/dilithium.c -> wolfcrypt/src/wc_mldsa.c wolfssl/wolfcrypt/dilithium.h -> wolfssl/wolfcrypt/wc_mldsa.h The legacy <wolfssl/wolfcrypt/dilithium.h> path is reborn as a thin compatibility shim that #include's wc_mldsa.h and provides macro aliases for every legacy linkage symbol. Build-gate rename ----------------- HAVE_DILITHIUM -> WOLFSSL_HAVE_MLDSA WOLFSSL_DILITHIUM_* -> WOLFSSL_MLDSA_* (~25 sub-config gates) WC_DILITHIUM_CACHE_* -> WC_MLDSA_CACHE_* WC_DILITHIUM_FIXED_ARRAY -> WC_MLDSA_FIXED_ARRAY WC_DILITHIUMKEY_TYPE_DEFINED -> WC_MLDSAKEY_TYPE_DEFINED The configure summary echoes "ML-DSA: yes" rather than "DILITHIUM: yes". The --enable-dilithium configure switch is preserved as a convenience alias for --enable-mldsa. A new wolfssl/wolfcrypt/settings_legacy_mldsa.h is included from settings.h after user_settings.h. It is bi-directional: defining the legacy gate (e.g. -DHAVE_DILITHIUM) implies the canonical gate, and defining the canonical gate (e.g. via --enable-mldsa) implies the legacy gate. The whole shim can be globally suppressed by defining WOLFSSL_NO_DILITHIUM_LEGACY_GATES. Public API rename ----------------- Type: dilithium_key -> MlDsaKey Init / lifecycle (wolfSSL idiom: 1-arg simple form, 3-arg _ex form): wc_dilithium_init -> wc_MlDsaKey_Init wc_dilithium_init_ex -> wc_MlDsaKey_Init_ex wc_dilithium_init_id -> wc_MlDsaKey_InitId wc_dilithium_init_label -> wc_MlDsaKey_InitLabel wc_dilithium_new -> wc_MlDsaKey_New wc_dilithium_delete -> wc_MlDsaKey_Delete wc_dilithium_free -> wc_MlDsaKey_Free Parameters / sizing: wc_dilithium_set_level -> wc_MlDsaKey_SetParams wc_dilithium_get_level -> wc_MlDsaKey_GetParams wc_dilithium_size -> wc_MlDsaKey_Size wc_dilithium_priv_size -> wc_MlDsaKey_PrivSize wc_dilithium_pub_size -> wc_MlDsaKey_PubSize wc_dilithium_sig_size -> wc_MlDsaKey_SigSize wc_dilithium_check_key -> wc_MlDsaKey_CheckKey Key generation: wc_dilithium_make_key -> wc_MlDsaKey_MakeKey wc_dilithium_make_key_from_seed -> wc_MlDsaKey_MakeKeyFromSeed Raw export (no argument reorder): wc_dilithium_export_public -> wc_MlDsaKey_ExportPubRaw wc_dilithium_export_private[_only] -> wc_MlDsaKey_ExportPrivRaw wc_dilithium_export_key -> wc_MlDsaKey_ExportKey Raw import / sign / verify / DER decode (FIPS 204 / ML-KEM convention puts the key first; legacy form put it last): wc_dilithium_import_public(in, inLen, key) -> wc_MlDsaKey_ImportPubRaw(key, in, inLen) wc_dilithium_import_private[_only](priv, privSz, key) -> wc_MlDsaKey_ImportPrivRaw(key, priv, privSz) wc_dilithium_import_key(priv, privSz, pub, pubSz, key) -> wc_MlDsaKey_ImportKey(key, priv, privSz, pub, pubSz) wc_dilithium_sign_msg / sign_ctx_msg / sign_ctx_hash / *_with_seed -> wc_MlDsaKey_Sign / SignCtx / SignCtxHash / *WithSeed wc_dilithium_verify_msg / verify_ctx_msg / verify_ctx_hash / verify_mu -> wc_MlDsaKey_Verify / VerifyCtx / VerifyCtxHash / VerifyMu wc_Dilithium_PrivateKeyDecode(in, idx, key, sz) -> wc_MlDsaKey_PrivateKeyDecode(key, in, sz, idx) wc_Dilithium_PublicKeyDecode(in, idx, key, sz) -> wc_MlDsaKey_PublicKeyDecode(key, in, sz, idx) ASN.1 encode (no reorder): wc_Dilithium_PublicKeyToDer -> wc_MlDsaKey_PublicKeyToDer wc_Dilithium_PrivateKeyToDer -> wc_MlDsaKey_PrivateKeyToDer wc_Dilithium_KeyToDer -> wc_MlDsaKey_KeyToDer OpenSSL-compat enum: Adds WC_EVP_PKEY_MLDSA / EVP_PKEY_MLDSA. The legacy WC_EVP_PKEY_DILITHIUM / EVP_PKEY_DILITHIUM remain as enum aliases to the same value (no ABI change for the enum itself). Type forward declaration in wolfssl/wolfcrypt/asn_public.h: The 6-line forward declaration `typedef struct dilithium_key dilithium_key;` (guarded by WC_DILITHIUMKEY_TYPE_DEFINED) is flipped to `typedef struct MlDsaKey MlDsaKey;` (guarded by WC_MLDSAKEY_TYPE_DEFINED). Struct field type in wolfssl/wolfcrypt/asn.h: The two `struct dilithium_key` references inside SignatureCtx's ML-DSA union arm reference `struct MlDsaKey` directly. The field name (`dilithium`) is unchanged so legacy-spelled consumer code keeps working. Internal helper rename ---------------------- All ~80 lower-case static / file-scope helpers in wc_mldsa.{h,c} and wc_mldsa_asm.S are renamed dilithium_* -> mldsa_* for consistency with ML-KEM's mlkem_* convention. The two WOLFSSL_TEST_VIS encoders wc_dilithium_encode_w1_88/32 become wc_mldsa_encode_w1_88/32. The struct typedef wc_dilithium_params becomes wc_mldsa_params. The FIPS 204 spec-derived constants (DILITHIUM_Q, DILITHIUM_N, DILITHIUM_LEVEL{2,3,5}_*, DILITHIUM_ML_DSA_{44,65,87}_*) are kept under their existing names. Compatibility surface --------------------- Two independent shims, each suppressible via its own opt-out: - The wolfssl/wolfcrypt/dilithium.h compatibility shim provides macro aliases for every legacy linkage symbol. Direct one-to-one #defines for the no-reorder APIs and function-like macros that swap arguments back for the 16 arg-reorder APIs. Suppressed by defining WOLFSSL_NO_DILITHIUM_LEGACY_NAMES. - The wolfssl/wolfcrypt/settings_legacy_mldsa.h shim is bi-directional: defining either spelling of any of the 32 build gates implies the other. Suppressed by defining WOLFSSL_NO_DILITHIUM_LEGACY_GATES. A small block of internal-helper aliases at the bottom of dilithium.h covers WOLFSSL_LOCAL `dilithium_get_oid_sum` and the WOLFSSL_TEST_VIS `wc_dilithium_encode_w1_*` encoders that this branch's unmigrated in-tree consumers (src/ssl_load.c and tests/api/test_mldsa.c) still call. Tests / verification -------------------- A compile-time validation block at the bottom of wc_mldsa.c (under WOLFSSL_NO_DILITHIUM_LEGACY_NAMES suppression) exercises every legacy macro alias. The bodies sit inside `if (0)` so the compiler parses and type-checks the expansions without emitting any runtime call. A missing or misordered alias produces an immediate compile error. Wconversion preservation: master's PR wolfSSL#10399 added 220 `(sword32)` casts (and several `(byte)` / `(word32)` casts) inside dilithium.c. After the file rename, the new wc_mldsa.c has all 220 `(sword32)` casts intact (count verified equal between master's dilithium.c and our new wc_mldsa.c). Builds clean with --enable-mldsa and --enable-dilithium (legacy alias). make check passes; testwolfcrypt DILITHIUM test passes. https://claude.ai/code/session_01N9vLeZw4Gsfb11N4BU1Mbe
1 parent 50da0c0 commit c88674a

30 files changed

Lines changed: 3340 additions & 2466 deletions

CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -679,12 +679,12 @@ add_option(WOLFSSL_DILITHIUM
679679
"no" "yes;no")
680680

681681
if (WOLFSSL_DILITHIUM)
682-
list(APPEND WOLFSSL_DEFINITIONS "-DHAVE_DILITHIUM")
682+
list(APPEND WOLFSSL_DEFINITIONS "-DWOLFSSL_HAVE_MLDSA")
683683
list(APPEND WOLFSSL_DEFINITIONS "-DWOLFSSL_SHA3")
684684
list(APPEND WOLFSSL_DEFINITIONS "-DWOLFSSL_SHAKE128")
685685
list(APPEND WOLFSSL_DEFINITIONS "-DWOLFSSL_SHAKE256")
686686

687-
set_wolfssl_definitions("HAVE_DILITHIUM" RESULT)
687+
set_wolfssl_definitions("WOLFSSL_HAVE_MLDSA" RESULT)
688688
set_wolfssl_definitions("WOLFSSL_SHA3" RESULT)
689689
set_wolfssl_definitions("WOLFSSL_SHAKE128" RESULT)
690690
set_wolfssl_definitions("WOLFSSL_SHAKE256" RESULT)

ChangeLog.md

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,79 @@
22

33
## Enhancements
44

5+
* Renamed the ML-DSA implementation file pair from
6+
`wolfcrypt/src/dilithium.c` and `wolfssl/wolfcrypt/dilithium.h` to
7+
`wolfcrypt/src/wc_mldsa.c` and `wolfssl/wolfcrypt/wc_mldsa.h`,
8+
matching the existing ML-KEM (`wc_mlkem.{h,c}`) naming convention.
9+
Inside that pair, the public API surface and every internal helper
10+
is renamed to its FIPS 204 ML-DSA spelling: `dilithium_key` becomes
11+
`MlDsaKey`, every `wc_dilithium_*` / `wc_Dilithium_*` function
12+
becomes `wc_MlDsaKey_*` (with the FIPS 204 / ML-KEM key-first
13+
argument order for sign / verify / import / DER-decode entry
14+
points), `HAVE_DILITHIUM` becomes `WOLFSSL_HAVE_MLDSA`, every
15+
`WOLFSSL_DILITHIUM_*` / `WC_DILITHIUM_*` sub-config gate becomes
16+
`WOLFSSL_MLDSA_*` / `WC_MLDSA_*`, and the lower-case static
17+
helpers (`dilithium_get_params`, `dilithium_hash256`, etc.) become
18+
`mldsa_*`. The internal parameter-table struct keeps its wolfSSL
19+
MixedCase form: `wc_dilithium_params` becomes `MlDsaParams`. The
20+
`wc_MlDsaKey_Init` canonical entry point takes 3 arguments
21+
(`MlDsaKey*`, `void* heap`, `int devId`) to match the ML-KEM
22+
`wc_MlKemKey_Init` convention; the legacy 1-argument
23+
`wc_dilithium_init(key)` is mapped through the shim to
24+
`wc_MlDsaKey_Init(key, NULL, INVALID_DEVID)`.
25+
26+
Backwards compatibility is preserved through a single TEMPORARY
27+
shim, `<wolfssl/wolfcrypt/dilithium.h>`, that will be removed in
28+
a future release once consumer code has migrated to the canonical
29+
names. The shim performs two services, each separately
30+
suppressible:
31+
32+
- Macro / static-inline aliases for the legacy
33+
`dilithium_key` / `wc_dilithium_params` / `wc_dilithium_*` /
34+
`wc_Dilithium_*` names, including arg-reordering wrappers for
35+
the entry points whose canonical prototype puts the key first.
36+
Suppressible via `WOLFSSL_NO_DILITHIUM_LEGACY_NAMES`. The
37+
`dilithium_key` typedef alias is also exposed from
38+
`<wolfssl/wolfcrypt/asn_public.h>` so code that included only
39+
that header on master keeps compiling.
40+
41+
- Bi-directional propagation of the sub-config build-gate
42+
names (`WOLFSSL_DILITHIUM_* <-> WOLFSSL_MLDSA_*`,
43+
`WC_DILITHIUM_* <-> WC_MLDSA_*`) so existing `user_settings.h`
44+
files and unmigrated consumer code keep gating correctly.
45+
Suppressible via `WOLFSSL_NO_DILITHIUM_LEGACY_GATES`. The
46+
parent gate (`HAVE_DILITHIUM <-> WOLFSSL_HAVE_MLDSA`) is
47+
mapped earlier in `<wolfssl/wolfcrypt/settings.h>` because
48+
`<wolfssl/internal.h>` and `<wolfssl/wolfcrypt/cryptocb.h>`
49+
gate their transitive include of `dilithium.h` on
50+
`HAVE_DILITHIUM`; this parent mapping is always active.
51+
52+
Two wolfSSL-internal infrastructure files
53+
(`wolfssl/wolfcrypt/memory.h` for `LARGEST_MEM_BUCKET` sizing and
54+
`wolfssl/certs_test.h` auto-generated cert-data buffers) had their
55+
legacy `WOLFSSL_DILITHIUM_*` sub-gate references migrated to
56+
canonical `WOLFSSL_MLDSA_*` spellings, since neither file pulls
57+
in `<wolfssl/wolfcrypt/dilithium.h>` and so cannot rely on the
58+
bi-directional shim. The corresponding generator script
59+
(`gencertbuf.pl`) was updated to keep emitting canonical
60+
sub-gate names on regeneration.
61+
62+
The OpenSSL-compat enum gains `WC_EVP_PKEY_MLDSA` /
63+
`EVP_PKEY_MLDSA`; the legacy `WC_EVP_PKEY_DILITHIUM` /
64+
`EVP_PKEY_DILITHIUM` names remain as aliases to the same numeric
65+
value. The `--enable-dilithium` configure switch is preserved as a
66+
convenience alias for `--enable-mldsa`.
67+
68+
**ABI note:** the library's exported linkage symbols are renamed
69+
(the `.so` now exports `wc_MlDsaKey_*` instead of
70+
`wc_dilithium_*`). Applications that linked dynamically against
71+
the legacy symbol names need to either recompile against the
72+
legacy header path (which provides macro aliases that resolve to
73+
the new symbols) or switch their sources to the canonical names.
74+
Existing in-tree consumer code keeps using the legacy spelling and
75+
compiles through the shim — new consumer code must include
76+
`wc_mldsa.h` directly and use the canonical names.
77+
578
* TLS 1.3: zero traffic key staging buffers in `SetKeysSide()` once a
679
CryptoCB callback has imported the AES key into a Secure Element
780
(`aes->devCtx != NULL`). Clears `keys->{client,server}_write_key`

IDE/INTIME-RTOS/libwolfssl.vcxproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
<ClCompile Include="..\..\wolfcrypt\src\cpuid.c" />
4343
<ClCompile Include="..\..\wolfcrypt\src\cryptocb.c" />
4444
<ClCompile Include="..\..\wolfcrypt\src\des3.c" />
45-
<ClCompile Include="..\..\wolfcrypt\src\dilithium.c" />
45+
<ClCompile Include="..\..\wolfcrypt\src\wc_mldsa.c" />
4646
<ClCompile Include="..\..\wolfcrypt\src\dh.c" />
4747
<ClCompile Include="..\..\wolfcrypt\src\dsa.c" />
4848
<ClCompile Include="..\..\wolfcrypt\src\ecc.c" />

IDE/INTIME-RTOS/wolfssl-lib.vcxproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@
7979
<ClCompile Include="..\..\wolfcrypt\src\cpuid.c" />
8080
<ClCompile Include="..\..\wolfcrypt\src\cryptocb.c" />
8181
<ClCompile Include="..\..\wolfcrypt\src\curve448.c" />
82-
<ClCompile Include="..\..\wolfcrypt\src\dilithium.c" />
82+
<ClCompile Include="..\..\wolfcrypt\src\wc_mldsa.c" />
8383
<ClCompile Include="..\..\wolfcrypt\src\eccsi.c" />
8484
<ClCompile Include="..\..\wolfcrypt\src\ed448.c" />
8585
<ClCompile Include="..\..\wolfcrypt\src\evp.c">

IDE/WIN10/wolfssl-fips.vcxproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@
318318
<ClCompile Include="..\..\wolfcrypt\src\wolfmath.c" />
319319
<ClCompile Include="..\..\wolfcrypt\src\wolfevent.c" />
320320
<ClCompile Include="..\..\wolfcrypt\src\pkcs12.c" />
321-
<ClCompile Include="..\..\wolfcrypt\src\dilithium.c" />
321+
<ClCompile Include="..\..\wolfcrypt\src\wc_mldsa.c" />
322322
<ClCompile Include="..\..\wolfcrypt\src\wc_lms.c" />
323323
<ClCompile Include="..\..\wolfcrypt\src\wc_lms_impl.c" />
324324
<ClCompile Include="..\..\wolfcrypt\src\wc_xmss.c" />

IDE/XCODE/wolfssl-FIPS.xcodeproj/project.pbxproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@
122122
700F0CF22A2FC11300755BA7 /* curve448.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 700F0CD32A2FC0D500755BA7 /* curve448.h */; };
123123
700F0CF32A2FC11300755BA7 /* curve25519.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 700F0CC82A2FC0D500755BA7 /* curve25519.h */; };
124124
700F0CF42A2FC11300755BA7 /* dilithium.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 700F0CE52A2FC0D500755BA7 /* dilithium.h */; };
125+
700F0CE52A2FC0D500755BC0 /* wc_mldsa.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 700F0CE52A2FC0D500755BC1 /* wc_mldsa.h */; };
125126
700F0CF52A2FC11300755BA7 /* eccsi.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 700F0CDB2A2FC0D500755BA7 /* eccsi.h */; };
126127
700F0CF62A2FC11300755BA7 /* ed448.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 700F0CD22A2FC0D500755BA7 /* ed448.h */; };
127128
700F0CF72A2FC11300755BA7 /* ed25519.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 700F0CE12A2FC0D500755BA7 /* ed25519.h */; };
@@ -280,6 +281,7 @@
280281
700F0CF22A2FC11300755BA7 /* curve448.h in CopyFiles */,
281282
700F0CF32A2FC11300755BA7 /* curve25519.h in CopyFiles */,
282283
700F0CF42A2FC11300755BA7 /* dilithium.h in CopyFiles */,
284+
700F0CE52A2FC0D500755BC0 /* wc_mldsa.h in CopyFiles */,
283285
700F0CF52A2FC11300755BA7 /* eccsi.h in CopyFiles */,
284286
700F0CF62A2FC11300755BA7 /* ed448.h in CopyFiles */,
285287
700F0CF72A2FC11300755BA7 /* ed25519.h in CopyFiles */,
@@ -583,6 +585,7 @@
583585
700F0CE22A2FC0D500755BA7 /* ge_448.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ge_448.h; path = ../../wolfssl/wolfcrypt/ge_448.h; sourceTree = "<group>"; };
584586
700F0CE42A2FC0D500755BA7 /* pkcs12.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = pkcs12.h; path = ../../wolfssl/wolfcrypt/pkcs12.h; sourceTree = "<group>"; };
585587
700F0CE52A2FC0D500755BA7 /* dilithium.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = dilithium.h; path = ../../wolfssl/wolfcrypt/dilithium.h; sourceTree = "<group>"; };
588+
700F0CE52A2FC0D500755BC1 /* wc_mldsa.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = wc_mldsa.h; path = ../../wolfssl/wolfcrypt/wc_mldsa.h; sourceTree = "<group>"; };
586589
700F0CE62A2FC0D500755BA7 /* sakke.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = sakke.h; path = ../../wolfssl/wolfcrypt/sakke.h; sourceTree = "<group>"; };
587590
700F0CE72A2FC0D500755BA7 /* signature.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = signature.h; path = ../../wolfssl/wolfcrypt/signature.h; sourceTree = "<group>"; };
588591
700F0CE82A2FC0D500755BA7 /* wc_pkcs11.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = wc_pkcs11.h; path = ../../wolfssl/wolfcrypt/wc_pkcs11.h; sourceTree = "<group>"; };
@@ -634,6 +637,7 @@
634637
700F0CD32A2FC0D500755BA7 /* curve448.h */,
635638
700F0CC82A2FC0D500755BA7 /* curve25519.h */,
636639
700F0CE52A2FC0D500755BA7 /* dilithium.h */,
640+
700F0CE52A2FC0D500755BC1 /* wc_mldsa.h */,
637641
700F0CDB2A2FC0D500755BA7 /* eccsi.h */,
638642
700F0CD22A2FC0D500755BA7 /* ed448.h */,
639643
700F0CE12A2FC0D500755BA7 /* ed25519.h */,

IDE/XCODE/wolfssl.xcodeproj/project.pbxproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,7 @@
253253
700F0C0A2A2FBC5100755BA7 /* curve448.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 700F0BE32A2FBC1500755BA7 /* curve448.h */; };
254254
700F0C0B2A2FBC5100755BA7 /* curve25519.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 700F0BE52A2FBC1500755BA7 /* curve25519.h */; };
255255
700F0C0C2A2FBC5100755BA7 /* dilithium.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 700F0BEF2A2FBC1500755BA7 /* dilithium.h */; };
256+
700F0BEF2A2FBC1500755BC0 /* wc_mldsa.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 700F0BEF2A2FBC1500755BC1 /* wc_mldsa.h */; };
256257
700F0C0D2A2FBC5100755BA7 /* eccsi.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 700F0BF72A2FBC1600755BA7 /* eccsi.h */; };
257258
700F0C0E2A2FBC5100755BA7 /* ed448.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 700F0BF82A2FBC1600755BA7 /* ed448.h */; };
258259
700F0C0F2A2FBC5100755BA7 /* ed25519.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 700F0BF42A2FBC1600755BA7 /* ed25519.h */; };
@@ -617,6 +618,7 @@
617618
700F0C0A2A2FBC5100755BA7 /* curve448.h in CopyFiles */,
618619
700F0C0B2A2FBC5100755BA7 /* curve25519.h in CopyFiles */,
619620
700F0C0C2A2FBC5100755BA7 /* dilithium.h in CopyFiles */,
621+
700F0BEF2A2FBC1500755BC0 /* wc_mldsa.h in CopyFiles */,
620622
700F0C0D2A2FBC5100755BA7 /* eccsi.h in CopyFiles */,
621623
700F0C0E2A2FBC5100755BA7 /* ed448.h in CopyFiles */,
622624
700F0C0F2A2FBC5100755BA7 /* ed25519.h in CopyFiles */,
@@ -983,6 +985,7 @@
983985
700F0BED2A2FBC1500755BA7 /* chacha20_poly1305.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = chacha20_poly1305.h; path = ../../wolfssl/wolfcrypt/chacha20_poly1305.h; sourceTree = "<group>"; };
984986
700F0BEE2A2FBC1500755BA7 /* cryptocb.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = cryptocb.h; path = ../../wolfssl/wolfcrypt/cryptocb.h; sourceTree = "<group>"; };
985987
700F0BEF2A2FBC1500755BA7 /* dilithium.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = dilithium.h; path = ../../wolfssl/wolfcrypt/dilithium.h; sourceTree = "<group>"; };
988+
700F0BEF2A2FBC1500755BC1 /* wc_mldsa.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = wc_mldsa.h; path = ../../wolfssl/wolfcrypt/wc_mldsa.h; sourceTree = "<group>"; };
986989
700F0BF02A2FBC1500755BA7 /* sakke.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = sakke.h; path = ../../wolfssl/wolfcrypt/sakke.h; sourceTree = "<group>"; };
987990
700F0BF12A2FBC1600755BA7 /* cpuid.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = cpuid.h; path = ../../wolfssl/wolfcrypt/cpuid.h; sourceTree = "<group>"; };
988991
700F0BF22A2FBC1600755BA7 /* selftest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = selftest.h; path = ../../wolfssl/wolfcrypt/selftest.h; sourceTree = "<group>"; };
@@ -1144,6 +1147,7 @@
11441147
700F0BE32A2FBC1500755BA7 /* curve448.h */,
11451148
700F0BE52A2FBC1500755BA7 /* curve25519.h */,
11461149
700F0BEF2A2FBC1500755BA7 /* dilithium.h */,
1150+
700F0BEF2A2FBC1500755BC1 /* wc_mldsa.h */,
11471151
700F0BF72A2FBC1600755BA7 /* eccsi.h */,
11481152
700F0BF82A2FBC1600755BA7 /* ed448.h */,
11491153
700F0BF42A2FBC1600755BA7 /* ed25519.h */,

cmake/functions.cmake

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ function(generate_build_flags)
211211
set(BUILD_WC_MLKEM "yes" PARENT_SCOPE)
212212
endif()
213213
if(WOLFSSL_DILITHIUM OR WOLFSSL_USER_SETTINGS)
214-
set(BUILD_DILITHIUM "yes" PARENT_SCOPE)
214+
set(BUILD_MLDSA "yes" PARENT_SCOPE)
215215
endif()
216216
if(WOLFSSL_FALCON OR WOLFSSL_USER_SETTINGS)
217217
set(BUILD_FALCON "yes" PARENT_SCOPE)
@@ -1029,8 +1029,8 @@ function(generate_lib_src_list LIB_SOURCES)
10291029
list(APPEND LIB_SOURCES wolfcrypt/src/falcon.c)
10301030
endif()
10311031

1032-
if(BUILD_DILITHIUM)
1033-
list(APPEND LIB_SOURCES wolfcrypt/src/dilithium.c)
1032+
if(BUILD_MLDSA)
1033+
list(APPEND LIB_SOURCES wolfcrypt/src/wc_mldsa.c)
10341034

10351035
if(BUILD_INTELASM)
10361036
list(APPEND LIB_SOURCES wolfcrypt/src/wc_mldsa_asm.S)

cmake/options.h.in

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,8 @@ extern "C" {
9696
#cmakedefine HAVE_CURVE448
9797
#undef HAVE_DH_DEFAULT_PARAMS
9898
#cmakedefine HAVE_DH_DEFAULT_PARAMS
99-
#undef HAVE_DILITHIUM
100-
#cmakedefine HAVE_DILITHIUM
99+
#undef WOLFSSL_HAVE_MLDSA
100+
#cmakedefine WOLFSSL_HAVE_MLDSA
101101
#undef HAVE_ECC
102102
#cmakedefine HAVE_ECC
103103
#undef HAVE_ECH

0 commit comments

Comments
 (0)