secp256k1: update C library to bitbox02-2026-10-12
What changed, and why it matters
This commit updates the secp256k1 cryptographic library inside the BitBox02 firmware and switches to a smaller, faster signing table. The change reduces firmware size by about 29 KB and makes ECDSA and Schnorr signing roughly 30-37% faster. There is no indication in the commit that this fixes a known security vulnerability; it appears to be a routine performance and size optimization while preserving existing behavior and patches.
Treat as a normal dependency update. Review the upstream changelog between upstream 10366dbb and the previous submodule base for any security-relevant fixes, and verify that the retained anti-exfil, recovery-ID, and DLEQ patches still apply cleanly and behave correctly. Run the existing cryptographic test suite and, if available, side-channel/constant-time tests on the new 2 KiB comb implementation before release.
Security signals we found
Cryptographic library update with submodule bump
Change to elliptic-curve generator precomputation table size and algorithm
Preservation of existing anti-exfil, recovery-ID, and DLEQ patches
No explicit security bug fix or CVE mentioned in commit message
Context initialization cost increased significantly; firmware caches global context once
Evidence from the diff
The commit bumps the secp256k1-zkp submodule from edc3c3e0 to e54d68ea on a BitBoxSwiss fork branch based on upstream 10366dbb. It replaces the old ECMULT_GEN_PREC_BITS=2 configuration with COMB_BLOCKS=2 and COMB_TEETH=5 to select upstream’s 2 KiB signing table, keeps ECMULT_WINDOW_SIZE=2 for verification, and retains the existing anti-exfil recovery-ID and DLEQ patches. The diff only touches build.rs and the submodule pointer; no C code changes are shown. The commit message provides extensive benchmark data showing reduced cycle counts for signing and key creation, plus a small increase in context initialization and secret-key tweak operations.
Changed components
src/rust/bitbox-secp256k1/build.rssrc/rust/bitbox-secp256k1/depend/secp256k1-zkp (submodule)BitBox02 firmware secp256k1 cryptographic operationsInspect captured patch +5 / −2
### src/rust/bitbox-secp256k1/build.rs
@@ -23,7 +23,10 @@ fn main() {
// Suppress all warnings in this dependency, we don't have control over them.
.flag_if_supported("-w")
.define("ECMULT_WINDOW_SIZE", Some("2"))
- .define("ECMULT_GEN_PREC_BITS", Some("2"))
+ // Upstream's 2 KiB signing-table preset:
+ // https://github.com/BlockstreamResearch/secp256k1-zkp/blob/10366dbbbfeb11457f2aae3b23e154ab7d6a1fe4/CMakeLists.txt#L76-L88
+ .define("COMB_BLOCKS", Some("2"))
+ .define("COMB_TEETH", Some("5"))
.define("USE_EXTERNAL_DEFAULT_CALLBACKS", Some("1"))
.define("ENABLE_MODULE_RECOVERY", Some("1")) // needed only in Rust unit tests.
.define("ENABLE_MODULE_EXTRAKEYS", Some("1"))
### src/rust/bitbox-secp256k1/depend/secp256k1-zkp
@@ -1 +1 @@
-Subproject commit edc3c3e0e12da7831dffc00721664fc46c989c2d
+Subproject commit e54d68ea3ad14600839513473c2959ee414972dbWhy this scored 17/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.