chore(crypto): enable `MLD_CONFIG_REDUCE_RAM`
What changed, and why it matters
This commit turns on a build-time option called MLD_CONFIG_REDUCE_RAM for the ML-DSA cryptographic code used in Trezor firmware. The stated purpose is to lower the amount of stack memory consumed during ML-DSA (post-quantum digital signature) operations, accepting a small performance slowdown. There is no indication in the commit that this fixes a security bug, vulnerability, or exploit. It appears to be a routine memory-optimization change.
No security action required. Treat as a normal memory-optimization build configuration change. If reviewing for product security, verify separately that the reduced-RAM configuration does not weaken side-channel resistance or alter ML-DSA test vectors, but the commit itself does not signal a security issue.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The change adds one compile-time define, MLD_CONFIG_REDUCE_RAM=1, in core/embed/crypto/build.rs when building the ML-DSA library. The commit message describes this as a stack-size reduction for ML-DSA with an acceptable slowdown. The diff is a single line addition and contains no functional code changes, no bounds checks, no input validation changes, and no algorithmic modifications. No security relevance is claimed by the vendor, and no external references are provided.
Changed components
core/embed/crypto/build.rsML-DSA library build configurationInspect captured patch +1 / −0
### core/embed/crypto/build.rs
@@ -347,6 +347,7 @@ fn add_mldsa(lib: &mut CLibrary, attrs: &CompileAttrs) -> Result<()> {
lib.add_defines([
("MLD_CONFIG_NAMESPACE_PREFIX", Some("mldsa")),
("MLD_CONFIG_NO_RANDOMIZED_API", Some("1")),
+ ("MLD_CONFIG_REDUCE_RAM", Some("1")),
]);
lib.add_sources_in_dir_with_attrs(Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.