Merge remote-tracking branch 'agent/benma-agent/secp256k1-22k'
What changed, and why it matters
This commit updates the secp256k1-zkp cryptographic library inside the BitBox02 firmware and changes how a key signing-speed optimization table is configured. The change replaces one table-size setting with two newer upstream settings and adds a Rust compiler flag needed for the new library version. There is no direct evidence in the commit that this fixes a security vulnerability; it appears to be a routine dependency update to keep the code aligned with upstream secp256k1-zkp.
Review the upstream secp256k1-zkp changelog and commits between edc3c3e0...e54d68ea for any security advisories or bug fixes. Verify that the new COMB_BLOCKS/COMB_TEETH configuration preserves the intended 2 KiB precomputation table size and does not introduce timing or side-channel regressions. Run the firmware's cryptographic test suite and, if available, perform side-channel analysis on signing operations.
Security signals we found
Cryptographic library dependency update (secp256k1-zkp submodule bump)
Change to elliptic-curve signing precomputation table configuration (ECMULT_GEN_PREC_BITS -> COMB_BLOCKS/COMB_TEETH)
Addition of rust_secp_no_symbol_renaming cfg flag required by updated dependency
Evidence from the diff
The commit merges a branch that bumps the secp256k1-zkp submodule from edc3c3e0e12da7831dffc00721664fc46c989c2d to e54d68ea3ad14600839513473c2959ee414972db. In build.rs, the old ECMULT_GEN_PREC_BITS=2 define is replaced with COMB_BLOCKS=2 and COMB_TEETH=5, matching an upstream ‘2 KiB signing-table’ preset. A Rust flag –cfg=rust_secp_no_symbol_renaming is added to CI’s RUSTFLAGS because that environment variable overrides .cargo/config.toml. The submodule bump likely contains upstream changes, but the diff itself does not show them.
Changed components
src/rust/bitbox-secp256k1/depend/secp256k1-zkp (submodule)src/rust/bitbox-secp256k1/build.rs.github/workflows/ci-common.ymlInspect captured patch +7 / −3
### .github/workflows/ci-common.yml
@@ -15,7 +15,8 @@ on:
type: string
env:
CARGOFLAGS: "--locked"
- RUSTFLAGS: "-Dwarnings"
+ # RUSTFLAGS replaces .cargo/config.toml, so repeat the required secp256k1 cfg.
+ RUSTFLAGS: "-Dwarnings --cfg=rust_secp_no_symbol_renaming"
CFLAGS: "-Werror"
jobs:
### 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 22/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.