build(core+legacy+crypto): remove deprecated `ECMULT_GEN_PREC_BITS` flag
What changed, and why it matters
This commit removes an obsolete compiler flag called ECMULT_GEN_PREC_BITS from the build scripts for Trezor's cryptographic code. The upstream secp256k1 library deleted this flag in version 0.5.0, so Trezor is simply cleaning up its build configuration to match. There is no indication this change fixes an active security vulnerability; it is routine build maintenance.
No security action required. Verify that CI builds pass against the updated secp256k1 dependency and that the resulting firmware produces identical or expected test vectors for secp256k1 operations.
Security signals we found
Build cleanup for deprecated upstream flag
No functional code change to cryptographic algorithms
No changelog entry requested by committer
No CVE, advisory, or security disclosure referenced
Evidence from the diff
The commit deletes the -DECMULT_GEN_PREC_BITS=… definition from three build files: core/embed/crypto/build.rs, crypto/Makefile, and legacy/firmware/Makefile. The flag was used to configure precomputed table size for secp256k1’s ecmult_gen logic, but upstream removed it in bitcoin-core/secp256k1 PR #1058 (release 0.5.0 on 2024-05-06). Retaining the flag after upstream removal would either be ignored or could cause build warnings/errors; removing it restores a clean build against the newer dependency. The remaining -DECMULT_WINDOW_SIZE=2 and module flags are unchanged.
Changed components
core/embed/crypto/build.rscrypto/Makefilelegacy/firmware/Makefilesecp256k1-zkp build configurationInspect captured patch +0 / −3
### core/embed/crypto/build.rs
@@ -280,7 +280,6 @@ fn add_secp256k1_zkp(lib: &mut CLibrary, _attrs: &CompileAttrs) -> Result<()> {
("USE_SECP256K1_ZKP", None),
("USE_SECP256K1_ZKP_ECDSA", None),
("USE_EXTERNAL_DEFAULT_CALLBACKS", None),
- ("ECMULT_GEN_PREC_BITS", Some("2")),
("ECMULT_WINDOW_SIZE", Some("2")),
("ENABLE_MODULE_GENERATOR", None),
("ENABLE_MODULE_RECOVERY", None),
### crypto/Makefile
@@ -66,7 +66,6 @@ ifneq ($(FUZZER),1) # This can be removed once the fuzzer machine uses at least
endif
ZKP_CFLAGS = \
- -DECMULT_GEN_PREC_BITS=4 \
-DECMULT_WINDOW_SIZE=2 \
-DENABLE_MODULE_GENERATOR \
-DENABLE_MODULE_RECOVERY \
### legacy/firmware/Makefile
@@ -20,7 +20,6 @@ ZKP_CFLAGS = \
-DUSE_ASM_ARM \
-DUSE_EXTERNAL_ASM \
-DUSE_EXTERNAL_DEFAULT_CALLBACKS \
- -DECMULT_GEN_PREC_BITS=4 \
-DECMULT_WINDOW_SIZE=2 \
-DENABLE_MODULE_GENERATOR \
-DENABLE_MODULE_RECOVERY \Why this scored 18/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.