@@ -37,6 +37,20 @@ the legacy API.
3737| ` wc_dilithium_* ` (lifecycle / sizing) | ` wc_MlDsaKey_* ` |
3838| ` wc_Dilithium_* ` (DER encode / decode) | ` wc_MlDsaKey_* ` |
3939| internal lower-case ` dilithium_* ` helpers | ` mldsa_* ` |
40+ | ` DILITHIUM_* ` algorithm-parameter macros | ` MLDSA_* ` (matches ` MLKEM_* ` in ` wc_mlkem.h ` ) |
41+ | ` DILITHIUM_LEVEL{2,3,5}_*_SIZE ` , ` ML_DSA_LEVEL{2,3,5}_*_SIZE ` , ` DILITHIUM_ML_DSA_{44,65,87}_*_SIZE ` | ` WC_MLDSA_{44,65,87}_*_SIZE ` |
42+ | ` DEBUG_DILITHIUM ` | ` DEBUG_MLDSA ` |
43+
44+ The ` WC_ML_DSA_{44,65,87} ` / ` WC_ML_DSA_{44,65,87}_DRAFT ` / ` WC_ML_DSA_DRAFT `
45+ public level identifiers and the ` PARAMS_ML_DSA_{44,65,87}_* `
46+ per-parameter-set internal constants intentionally ** keep** their
47+ underscored ` ML_DSA_ ` spelling — the level identifiers are established
48+ public names and the ` PARAMS_* ` family is internal-only, so neither
49+ benefits from a rename.
50+
51+ The ` WOLFSSL_NO_ML_DSA_{44,65,87} ` parameter-set disable gates are
52+ likewise kept in their underscored form (matching the
53+ ` WOLFSSL_NO_ML_KEM_{512,768,1024} ` spelling in ` wc_mlkem.h ` ).
4054
4155The 16 sign / verify / import / DER-decode entry points were also
4256re-ordered to put the ` MlDsaKey* ` first (matching the FIPS 204 / ML-KEM
@@ -165,6 +179,77 @@ wolfSSL-internal infrastructure (an auto-generated cert-buffer data
165179file and the static allocator's default sizing), not consumer-facing
166180API; these changes do not require downstream code changes.
167181
182+ ## Macro / comment cleanup inside ` wc_mldsa.{c,h} `
183+
184+ A follow-on cleanup of the ML-DSA implementation file finished the
185+ internal naming migration that the file/symbol rename above started:
186+
187+ - All algorithm-parameter macros defined in ` wolfssl/wolfcrypt/wc_mldsa.h `
188+ (` DILITHIUM_Q ` , ` DILITHIUM_N ` , ` DILITHIUM_D ` , ` DILITHIUM_ETA_* ` ,
189+ ` DILITHIUM_GAMMA1_* ` , ` DILITHIUM_K_SZ ` , ` DILITHIUM_MU_SZ ` ,
190+ ` DILITHIUM_MAX_* ` , …) were renamed to canonical ` MLDSA_* ` spellings
191+ matching the ` MLKEM_* ` internal constants in
192+ ` <wolfssl/wolfcrypt/wc_mlkem.h> ` . The ` PARAMS_ML_DSA_{44,65,87}_* `
193+ per-parameter-set internal constants and the
194+ ` WC_ML_DSA_{44,65,87} ` / ` WC_ML_DSA_{44,65,87}_DRAFT ` /
195+ ` WC_ML_DSA_DRAFT ` public level identifiers keep their underscored
196+ spelling — the level identifiers are established public names and
197+ the ` PARAMS_* ` family is internal-only.
198+ - The per-parameter-set size constants previously existed in ** three**
199+ redundant spellings — ` DILITHIUM_LEVEL{2,3,5}_*_SIZE ` ,
200+ ` ML_DSA_LEVEL{2,3,5}_*_SIZE ` , and
201+ ` DILITHIUM_ML_DSA_{44,65,87}_*_SIZE ` . They were consolidated to a
202+ single canonical family, ` WC_MLDSA_{44,65,87}_*_SIZE ` . All three
203+ legacy spellings remain reachable as aliases through the
204+ ` <wolfssl/wolfcrypt/dilithium.h> ` shim (gated by
205+ ` WOLFSSL_NO_DILITHIUM_LEGACY_NAMES ` ); a duplicate ` MLDSA_N `
206+ definition in ` wc_mldsa.h ` was also removed.
207+ - All ~ 20 file-local macros inside ` wolfcrypt/src/wc_mldsa.c `
208+ (` DILITHIUM_SIGN_BYTES ` , ` DILITHIUM_GEN_S_* ` , ` DILITHIUM_HASH_OID_LEN ` ,
209+ ` DILITHIUM_PARAMS_CNT ` , ` DILITHIUM_COEFF_S* ` , ` DILITHIUM_QINV ` ,
210+ ` DILITHIUM_NTT_ZETA_1 ` , ` DILITHIUM_POS_OFFSET ` , …) were renamed
211+ to ` MLDSA_* ` . The file-local macros are not user-visible and have no
212+ alias in the shim.
213+ - The user-tunable knobs documented in the ` wc_mldsa.c ` file-top
214+ comment block — ` DEBUG_DILITHIUM ` and the five performance-tuning
215+ defines ` DILITHIUM_MUL_SLOW ` , ` DILITHIUM_MUL_44_SLOW ` ,
216+ ` DILITHIUM_MUL_11_SLOW ` , ` DILITHIUM_MUL_QINV_SLOW ` ,
217+ ` DILITHIUM_MUL_Q_SLOW ` — were renamed to ` DEBUG_MLDSA ` /
218+ ` MLDSA_MUL_*_SLOW ` . These are set from ` user_settings.h ` or ` -D ` ,
219+ so a forward-translation block was added to the legacy-gates arm
220+ in ` <wolfssl/wolfcrypt/dilithium.h> ` (gated by
221+ ` WOLFSSL_NO_DILITHIUM_LEGACY_GATES ` ) so consumers using the legacy
222+ spelling continue to get the intended code path.
223+ - A long-standing typo, ` dilitihium_get_der_length() ` (5 call sites,
224+ ` static ` -scope), was corrected to ` mldsa_get_der_length() ` .
225+ - All ` DILITHIUM_* ` legacy macro spellings remain reachable from
226+ unmigrated in-tree consumers (` wolfcrypt/src/asn.c ` , ` src/ssl_load.c ` ,
227+ ` src/internal.c ` , ` src/tls13.c ` , ` src/ssl.c ` , ` src/x509.c ` ,
228+ ` src/ssl_api_pk.c ` , ` src/ssl_certman.c ` , ` wolfssl/internal.h ` ,
229+ ` wolfssl/wolfcrypt/asn.h ` , ` asn_public.h ` , ` oid_sum.h ` ,
230+ ` examples/configs/user_settings_pq.h ` ,
231+ ` wolfcrypt/benchmark/benchmark.c ` , ` wolfcrypt/test/test.c ` ,
232+ ` tests/api/test_mldsa.c ` ) and downstream code through a new
233+ reverse-arm macro alias block in ` <wolfssl/wolfcrypt/dilithium.h> ` ,
234+ gated by the existing ` WOLFSSL_NO_DILITHIUM_LEGACY_NAMES ` opt-out.
235+ - All function and section comments inside ` wc_mldsa.c ` had their
236+ "Dilithium" / "dilithium" prose replaced with "ML-DSA" (the file-top
237+ credit retains a parenthetical mention of the historical name).
238+ - Every algorithm-step citation was re-numbered against FIPS 204 Final
239+ (August 2024). The implementation was previously annotated with the
240+ draft (IPD) numbering — e.g. ` Algorithm 18 skEncode ` , `Algorithm 26
241+ ExpandA` , ` Algorithm 29 Power2Round`. These were updated to the
242+ Final numbering (` Algorithm 24 skEncode ` , ` Algorithm 32 ExpandA ` ,
243+ ` Algorithm 35 Power2Round ` , …) and the section references were
244+ retargeted from the draft ` §8.x ` building-blocks group to the Final
245+ ` §7.x ` arrangement. SHAKE128/256 notation references were redirected
246+ from the IPD ` §8.3 ` to the Final ` §3.7 ` . Citation punctuation was
247+ normalized from ` FIPS 204. N.M: ` to ` FIPS 204 §N.M, ` .
248+
249+ These changes are contained to ` wolfcrypt/src/wc_mldsa.c ` ,
250+ ` wolfssl/wolfcrypt/wc_mldsa.h ` , and the macro-alias block in
251+ ` wolfssl/wolfcrypt/dilithium.h ` . No external consumer is touched.
252+
168253### Retained internal symbols
169254
170255A few internal-only spellings are intentionally ** not** renamed in this
0 commit comments