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

Merge bitcoin-core/secp256k1#1898: tests: Silent Payments ctime test never reaches a match or label lookup

Public commit record

What the developer wrote

Authored by merge-script

100/100 · Strong
Merge bitcoin-core/secp256k1#1898: tests: Silent Payments ctime test never reaches a match or label lookup

f391539a3b2d16059883dbd281bee33e1f995423 tests: cover Silent Payments label scanning (Lőrinc)
078f67f86bd07a25c2dbff2398965738f1f594ad tests: make Silent Payments ctime scan find output (Lőrinc)

Pull request description:

**Problem:** The constant-time test generates an output for one scan key, then mutates the key before scanning, so the scan cannot find it.
It also passes no label callback, so label-candidate serialization and batching never run.
The test still passes because it never checks the scan result.
Nothing verifies the match path, or that the label callback only receives public data, while the scan key is marked undefined.

**Fix:** Regenerate the output for the actual scan key, prepend a nonmatching output, and require one direct, unlabeled match.
Pass a label callback that verifies each serialized 33-byte candidate is defined and counts the misses.

ACKs for top commit:
fametrano:
ACK f391539a3b2d16059883dbd281bee33e1f995423
theStack:
re-ACK f391539a3b2d16059883dbd281bee33e1f995423

Tree-SHA512: 49b00182214cf910e94704c212750c3ba07de2ad33ea6ca0051e10dd5a6949b4825127574c439e61f07d81d88159cfc807e738b0bdc64a4ea8875f73e10a9aa4
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Explains rationale or failure mode✓ Mentions testing or verification✓ Links an issue, advisory, or supporting reference
The short version

What changed, and why it matters

This commit fixes a flawed test in the libsecp256k1 cryptographic library. The test was supposed to exercise the Silent Payments constant-time scanning code, but due to a bug in how the test was written, it never actually verified that the scanner found a matching output or exercised the label-lookup code path. The fix makes the test generate the output with the correct key, adds a non-matching output, supplies a label callback, and checks that exactly one unlabeled match is found. This is a test-only improvement; no production code behavior changes and no vulnerability is introduced or fixed in shipped software.

Recommended action

No urgent action. Treat as a normal test-quality improvement. If auditing constant-time properties of the Silent Payments module, note that this commit improves test coverage but does not itself change the implementation.

Security signals we found

01

Test-only change in ctime_tests.c

02

Fixes incorrect test key mutation that prevented matching output

03

Adds label callback to exercise label-candidate serialization/batching path

04

Adds assertions on scan result and label lookup count

05

No change to production secp256k1 or silentpayments implementation code

Risk score

Why this scored 16/100

Our methodology →
Potential impact 2/30
Exploitability 0/25
Stealth signal 0/15
Affected reach 0/15
Confidence 9/10
Evidence quality 5/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.