AI-generated analysisPublished automatically and not human-verified. Validated context appears in community notes below.
← Watch feed
Informational 21 Bitcoin

factorysetup: use static secp context

Public commit record

What the developer wrote

Authored by benma's agent

78/100 · Adequate
factorysetup: use static secp context

ECDSA verification can use libsecp256k1’s built-in static context.

A dynamically created context links signing support and its
precomputation table, even when Rust requests a verification-only
context.

The previous context initialization reached
secp256k1_context_preallocated_create(), which runs
secp256k1_selftest() automatically. The static context skips
initialization, so run the self-test explicitly once during factory
setup startup, as recommended by libsecp256k1.

This reduces the factory-setup image by 35,728 bytes.
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Mentions testing or verification
The short version

What changed, and why it matters

This commit changes how the BitBox02 factory-setup program checks digital signatures. It switches from a dynamically created crypto context to a built-in, read-only verification context, which makes the factory-setup firmware about 35 KB smaller. The commit also adds an explicit self-test because the new static context skips the automatic self-test that the old path performed. The change is a size optimization, not a fix for an active security flaw, but it touches cryptographic verification code used during device manufacturing.

Recommended action

Review that the explicit self-test is always executed before any ECDSA verification in factory setup, and verify that the static context is appropriate for all code paths that may call `rust_secp256k1_verify`. Consider whether the same optimization should be applied consistently elsewhere or kept scoped to factory setup to avoid accidental signing-context misuse.

Security signals we found

01

Cryptographic context change in verification path

02

Removal of dynamic secp256k1 context creation in factory setup

03

Explicit addition of secp256k1_selftest() to compensate for skipped implicit self-test

04

Image size reduction of ~35 KB by excluding signing precomputation table

05

No change to runtime signature verification semantics if self-test passes

Risk score

Why this scored 21/100

Our methodology →
Potential impact 3/30
Exploitability 2/25
Stealth signal 2/15
Affected reach 3/15
Confidence 7/10
Evidence quality 4/5
Human-validated context

Community notes

Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.

No validated notes yet.

The AI analysis stands alone for now. Submit a note if you can add evidence or important context.