BC
← All projectsBitcoin Core

libsecp256k1

High-assurance secp256k1 elliptic-curve library used throughout the Bitcoin ecosystem.

BitcoinCryptographic librariesNormal
Repository coverage

257 commits in the local evidence base

Every captured commit receives deterministic security triage and a separate communication-quality score. Security candidates and broader second-pass signals receive full-patch Ollama analysis.

85security candidates7second-pass queue215AI analyses
28commits · 30 days
53commits · 60 days
152commits · 180 days
206commits · 365 days
Backfill bands
Aug 5 → Feb 682 seen1 candidatesComplete
Feb 6 → Jun 625 seen2 candidatesComplete
Jun 6 → Jul 619 seen1 candidatesComplete
Jul 6 → Aug 548 seen1 candidatesComplete
Commit communication

Does the history explain itself?

Message quality measures whether a commit identifies its scope, purpose, rationale, testing, and supporting references. It does not change the security-severity score.

72/100 average clarity
100Strong · 80–100
89Adequate · 60–79
64Thin · 40–59
4Opaque · 0–39
Read the scoring rubric →
Developer activity

Who is changing the project?

Public Git author strings; identities are not independently verified.

DeveloperCommitsCandidatesAnalyzedHigh riskMessage avg.
merge-script482426193
Sebastian Falbesoner502145068
Hennadii Stepanov51746064
Tim Ruffing22622055
furszy13413087
josibake949066
Lőrinc13313077
kevkevinpal626064
Ferdinando Ametrano522074
John Moffett424069
copilot-swe-agent[bot]323074
Bruno Garcia322090
Analysis record

Published AI watches

Last scanned 35 minutes ago

Informational 21 AI analysisMessage 81 · Strong
BC Bitcoin Corelibsecp256k1 BitcoinCryptographic libraries

Merge bitcoin-core/secp256k1#1980: examples: randomize the context in musig, erase the keypair in schnorr

This change improves two example programs in the secp256k1 cryptographic library. It adds a recommended side-channel protection step to the multi-signature example (musig.c) and ensures the single-signature example (schnorr.c) also wipes a…

Context randomization added to protect against side-channel leakageSecret key material explicitly erased from keypair object after useChanges are confined to example code, not the core library
5959bed6by merge-script+14−12 files
No security note in commit
Low 36 AI analysisMessage 98 · Strong
BC Bitcoin Corelibsecp256k1 BitcoinCryptographic libraries

Merge bitcoin-core/secp256k1#1998: Avoid unsequenced accesses to volatile variables

This change fixes a subtle compiler-warning/undefined-behavior issue in the code that performs secret math inside Bitcoin's cryptographic library. The code uses 'volatile' variables to prevent the compiler from turning certain operations i…

Touches constant-time arithmetic paths (modular inversion normalization)Fixes undefined behavior involving volatile-qualified variablesCompiler warning (-Wunsequenced) treated as a correctness defect
a0e2e23aby merge-script+42−362 files
Vendor flagged security relevance
Low 32 AI analysisMessage 80 · Strong
BC Bitcoin Corelibsecp256k1 BitcoinCryptographic libraries

Avoid unsequenced accesses to volatile variables

This commit fixes a subtle C language rule violation in Bitcoin Core's libsecp256k1 cryptographic library. The code was reading a special 'volatile' variable multiple times within the same expression, which modern C standards treat as unde…

Undefined behavior in cryptographic constant-time codeCompiler warning (-Wunsequenced) in security-critical pathVolatile variable used as constant-time execution barrier
e7a34ba3by Hennadii Stepanov+20−142 files
No security note in commit
Informational 16 AI analysisMessage 100 · Strong
BC Bitcoin Corelibsecp256k1 BitcoinCryptographic libraries

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

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…

Test-only change in ctime_tests.cFixes incorrect test key mutation that prevented matching outputAdds label callback to exercise label-candidate serialization/batching path
5d2ff536by merge-script+27−131 file
No security note in commit
Informational 15 AI analysisMessage 98 · Strong
BC Bitcoin Corelibsecp256k1 BitcoinCryptographic libraries

ci: Run the Wine jobs on ubuntu-24.04

This is a routine continuous-integration (CI) maintenance change. It pins a Windows cross-compilation test job to an older Ubuntu version because the newer GitHub-hosted runner image breaks Wine's networking syscalls. There is no change to…

ecfe7ab8by Ferdinando Ametrano+2−11 file
No security note in commit
Informational 23 AI analysisMessage 96 · Strong
BC Bitcoin Corelibsecp256k1 BitcoinCryptographic libraries

Merge bitcoin-core/secp256k1#1986: examples: exit with failure if signature verification fails

This change fixes two example programs so they return a failure code when a signature check fails. Previously, the examples always reported success even if verification failed, which meant automated tests would pass even when the underlyin…

Incorrect return status masked verification failures in example/test programsAutomated tests would pass despite cryptographic verification failingFix aligns ECDSA and Schnorr examples with existing MuSig example behavior
b97f7f5fby merge-script+2−22 files
No security note in commit
Informational 18 AI analysisMessage 88 · Strong
BC Bitcoin Corelibsecp256k1 BitcoinCryptographic libraries

examples: exit with failure if signature verification fails

This is a small hardening fix to two example programs. Previously, the example programs for ECDSA and Schnorr signatures would print whether a signature was valid but always report success to the operating system. Because the project's bui…

Test/example code silently succeeded on verification failureRegression-test gap for signature verification behaviorFix hardens CI/test signal without changing cryptographic logic
900613a7by Amartya Singh+2−22 files
No security note in commit
Low 35 AI analysisMessage 96 · Strong
BC Bitcoin Corelibsecp256k1 BitcoinCryptographic libraries

Merge bitcoin-core/secp256k1#1974: silentpayments: reject label tweaks that overflow the group order

This change fixes a silent handling problem in Bitcoin's silent payments feature. When a user-supplied label tweak value was larger than the cryptographic group order, the code previously reduced it silently, which could lead to incorrect …

silent modular reduction of attacker/caller-controlled scalarAPI misuse now rejected via ARG_CHECKsensitive scalar clearing before early return to avoid leaking transaction indistinguishability data
1c088b64by merge-script+13−22 files
Vendor flagged security relevance
High 76 AI analysisMessage 86 · Strong
BC Bitcoin Corelibsecp256k1 BitcoinCryptographic libraries

Merge bitcoin-core/secp256k1#1983: silentpayments: return 0 instead of `ARG_CHECK`ing for empty inputs/outputs

This update fixes a crash risk in Bitcoin's silent payments scanning code. Before the change, if a transaction had no suitable inputs or no taproot outputs, the library treated that as an illegal argument and could call abort(), killing th…

Denial-of-service vector: maliciously crafted transaction could trigger abort() in a scanning/indexing processAPI contract violation: documented return-0 behavior was not implemented for empty inputs/outputsARG_CHECK removal in two public silentpayments functions
a3a5cd45by merge-script+46−334 files
Vendor flagged security relevance
Low 30 AI analysisMessage 73 · Adequate
BC Bitcoin Corelibsecp256k1 BitcoinCryptographic libraries

silentpayments: allow NULL arrays in scan_outputs if n_tx_outputs is 0

This commit fixes a minor API usability issue in the experimental silent payments module. Previously, a function that scans transaction outputs for silent payments would crash if given empty arrays represented as NULL pointers, even though…

NULL pointer argument check relaxed for empty arraysSECP256K1_ARG_NONNULL attributes removed for two parametersNew API test verifying NULL-with-zero-length behavior
e7bb0112by Sebastian Falbesoner+18−113 files
No security note in commit
Moderate 60 AI analysisMessage 78 · Adequate
BC Bitcoin Corelibsecp256k1 BitcoinCryptographic libraries

silentpayments: return 0 instead of `ARG_CHECK`ing for empty inputs/outputs

This change fixes two functions in the Silent Payments module so they return a normal failure value (0) instead of triggering an internal abort when given a transaction with no eligible inputs or no taproot outputs. Previously, callers sca…

ARG_CHECK default behavior is abort(), turning an expected non-Silent-Payments transaction into a potential DoS crashAPI contract promised return 0 for non-Silent-Payments transactions, but implementation violated it for empty input/output edge casesCallers scanning blocks would need special-case handling before the fix to avoid crashes
d7821f4aby Sebastian Falbesoner+27−223 files
Vendor flagged security relevance
Low 31 AI analysisMessage 100 · Strong
BC Bitcoin Corelibsecp256k1 BitcoinCryptographic libraries

silentpayments: reject label tweaks that overflow the group order

This change tightens error handling in the silent payments scanning code. Previously, if a caller-supplied label tweak was as large as or larger than the elliptic curve group order, it was silently wrapped around (reduced modulo the order)…

silent reduction modulo group order replaced with explicit overflow rejectionsensitive scalars and shared secret explicitly cleared before aborting on invalid inputoutput assignment reordered to avoid partial state update on failure path
95552e16by Sebastian Falbesoner+13−22 files
No security note in commit
Informational 15 AI analysisMessage 35 · Opaque
BC Bitcoin Corelibsecp256k1 BitcoinCryptographic libraries

remove unused SECP256K1_GE_CONST_INFINITY

This commit simply deletes an unused macro named SECP256K1_GE_CONST_INFINITY from a header file. A macro is a shorthand definition for code, and this one was no longer referenced anywhere in the project. Removing dead code has no functiona…

7b59e1fcby fanquake+0−11 file
No security note in commit
Low 26 AI analysisMessage 100 · Strong
BC Bitcoin Corelibsecp256k1 BitcoinCryptographic libraries

Merge bitcoin-core/secp256k1#1929: silentpayments: perform tweak addition with actual scalars

This change simplifies how Silent Payments scanning adds a small tweak value to a secret-derived value. It replaces a function meant for secret-key tweaking with plain scalar (modular number) addition. The old code had a special case that …

Behavior change: zero-result tweak addition is no longer forced to zero; scalar addition allows zeroBehavior change: label tweaks >= group order N are no longer rejected by the secret-key APIRemoval of defensive comment explaining failure modes of secret-key tweak addition
04b91ce2by merge-script+7−161 file
No security note in commit
Informational 15 AI analysisMessage 86 · Strong
BC Bitcoin Corelibsecp256k1 BitcoinCryptographic libraries

Merge bitcoin-core/secp256k1#1963: doc: say the sha256 compression callback processes secrets

This commit only adds a documentation comment to a public header file. It reminds developers that a special callback function used for SHA256 hashing may receive secret data such as private keys, so any custom implementation must be consta…

31716e4bby merge-script+3−01 file
No security note in commit
Informational 18 AI analysisMessage 81 · Strong
BC Bitcoin Corelibsecp256k1 BitcoinCryptographic libraries

doc: say the sha256 compression callback processes secrets

This is a documentation-only change. It adds a warning to the public header file telling developers that the optional SHA256 compression callback may receive secret key material, and therefore any custom implementation must run in constant…

Documentation clarifies that a pluggable cryptographic callback receives secret materialDocumentation imposes constant-time and no-logging requirements on callback implementersReferences RFC 6979 nonce derivation as an example of secret-key processing
494d3053by Ferdinando Ametrano+3−01 file
Vendor flagged security relevance
Informational 15 AI analysisMessage 96 · Strong
BC Bitcoin Corelibsecp256k1 BitcoinCryptographic libraries

Merge bitcoin-core/secp256k1#1946: doc: clean up lingering ECMULT_WINDOW_SIZE comment

This is a documentation-only cleanup. It moves a comment about the ECMULT_WINDOW_SIZE setting to a better location and fixes an outdated formula in the comment. No code behavior changes.

6f065e9aby merge-script+10−112 files
No security note in commit
Low 37 AI analysisMessage 100 · Strong
BC Bitcoin Corelibsecp256k1 BitcoinCryptographic libraries

Merge bitcoin-core/secp256k1#1933: refactor: introduce `ecmult_const_ge` helper (preventing accidential gej leaks)

This commit is a defensive code cleanup in Bitcoin Core's secp256k1 cryptography library. It introduces a helper function that automatically clears temporary secret data after a constant-time elliptic curve multiplication, and switches exi…

Defensive refactoring to prevent accidental leakage of secret scalar information from Jacobian coordinatesNew helper enforces memory clearing of intermediate group element after constant-time scalar multiplicationAdoption in ECDH and silentpayments modules, which process secret keys
2365dc64by merge-script+35−427 files
Vendor flagged security relevance
Informational 15 AI analysisMessage 93 · Strong
BC Bitcoin Corelibsecp256k1 BitcoinCryptographic libraries

Merge bitcoin-core/secp256k1#1949: ecdsa: Clarify derivation of the r check in `_sig_verify`

This commit only rewrites comments in the source code to make the mathematical explanation clearer. It does not change any actual code instructions, function behavior, or security properties. There is no vulnerability or fix here.

4a264a93by merge-script+21−151 file
No security note in commit
Informational 12 AI analysisMessage 100 · Strong
BC Bitcoin Corelibsecp256k1 BitcoinCryptographic libraries

Merge bitcoin-core/secp256k1#1948: tests: add ECDSA verify case where r + n overflows p

This commit only adds a new test case to the project's test suite. It does not change any production cryptographic code. The new test verifies that the ECDSA signature verification function correctly rejects a crafted invalid signature in …

Adds test coverage for ECDSA verification edge case involving r + n overflow against field order pReferences a surviving mutant where the early-rejection check in secp256k1_ecdsa_sig_verify is removedDoes not modify production code; purely a test-suite enhancement
e23e9201by merge-script+28−01 file
No security note in commit
Repository ledger

Explore captured commits

Expand any commit for its author, full message, clarity score, changed files, triage signals, analysis, and source link.

Lower-priorityMerge bitcoin-core/secp256k1#1978: ci: Run ctime_tests in the arm64 Debian jobby merge-script · 1b4181f9 · Oct 26, 2026 · 1 fileMessage 86 · StrongTriage 0Details
Commit message · merge-script

Merge bitcoin-core/secp256k1#1978: ci: Run ctime_tests in the arm64 Debian job

1c1d8494912d2791e9d1f525de55ea10126f027c ci: Run ctime_tests in the arm64 Debian job (Ferdinando Ametrano)

Pull request description:

This drops the `WITH_VALGRIND: 'no'` and `CTIMETESTS: 'no'` overrides from the arm64-debian job. They are left over from when the job ran under QEMU. Without them, the job runs `ctime_tests` under Valgrind for gcc, clang and both snapshots, as theStack suggested in #1975.

I ran `ci/ci.sh` with the job's settings on aarch64 (Debian trixie, Valgrind 3.24) with gcc 14.2 and clang 19.1. `ctime_tests` passes with both. It fails with both after I plant a secret-dependent branch in `secp256k1_ecdsa_sig_sign`.

ACKs for top commit:
real-or-random:
ACK 1c1d8494912d2791e9d1f525de55ea10126f027c
theStack:
ACK 1c1d8494912d2791e9d1f525de55ea10126f027c

Tree-SHA512: ae2729bf03e14eccbfb7ee0f4a148c06a85072bc79c25176e912d249c2c7ce6aaf585aeae6d464c12714dfadb34fdba1dc1e2ffeabe2cd48f9256c51f3b3fb38

86/100 · StrongMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Links an issue, advisory, or supporting reference✓ Names security-relevant behavior explicitly
Why it was queued
documentation-only discountmerge-commit duplicate discount
Lower-priorityMerge bitcoin-core/secp256k1#1961: ci: run exhaustive_tests for group orders 7 and 199by merge-script · 95798f5f · Oct 25, 2026 · 3 filesMessage 100 · StrongTriage 0Details
Commit message · merge-script

Merge bitcoin-core/secp256k1#1961: ci: run exhaustive_tests for group orders 7 and 199

a3fcbeafe3cb1414ea337d506381836595d88a87 ci: run exhaustive_tests for group orders 7 and 199 (Ferdinando Ametrano)
32099110d63a1dec1a7d27067450fd97d20ea30f tests: don't define the ellswift exhaustive test for even-order curves (Ferdinando Ametrano)

Pull request description:

CI builds `exhaustive_tests` only for its default group order, 13. The other two orders in `src/group_impl.h`, 7 and 199, are never compiled. Order 7 is the even-order curve, where the ellswift tests are skipped.

`ci/ci.sh` now rebuilds `exhaustive_tests` for `EXHAUSTIVE_TEST_ORDER` and runs it with `EXHAUSTIVE_TEST_ARGS`. A new job, `exhaustive_debian`, has two rows: order 7, and order 199.

A full run at order 199 would take about 7 weeks on my machine: one part in 100000 takes 51 s, of which about 10 s is fixed cost. So the order 199 row runs one part in 20000, using the existing `numcores` and `thiscore` arguments. These come after the seed argument, so the seed is fixed. Every run still builds the order 199 tables and checks the whole group against `ecmult_gen`.

The first commit removes an unused-function warning that order 7 would otherwise add to the CI log.

I ran `ci/ci.sh` as the new rows do, with clang on an Apple M5 (macOS, no Docker): order 7 takes 15 s and order 199 takes 230 s, both including the build. I did not run the job on GitHub Actions or on Linux.

*Assisted-by: my usual tools (LLM, Internet, computer). Mistakes are mine.*

ACKs for top commit:
real-or-random:
ACK a3fcbeafe3cb1414ea337d506381836595d88a87
theStack:
ACK a3fcbeafe3cb1414ea337d506381836595d88a87

Tree-SHA512: 9a090f50f116311ba90f8abad8efb301972badab0b4faddf99a9591d1b17a5ecf19ef80d6641b521f46a2ec2c7a8c5672869f4232b27dc9723d3230b06ad958e

100/100 · StrongMessage clarity
✓ 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✓ Names security-relevant behavior explicitly
Why it was queued
merge-commit duplicate discount
Lower-priorityMerge bitcoin-core/secp256k1#1975: ci: Run ctime_tests under Valgrind on arm64by merge-script · 307035b3 · Oct 23, 2026 · 1 fileMessage 86 · StrongTriage 0Details
Commit message · merge-script

Merge bitcoin-core/secp256k1#1975: ci: Run ctime_tests under Valgrind on arm64

26299c7672d4b61d2e17feecd97532d9abdb32c8 ci: Run ctime_tests under Valgrind on arm64 (Ferdinando Ametrano)

Pull request description:

No CI job runs `ctime_tests` on ARM64. The Cirrus "ARM64: Linux (Debian stable), Valgrind" task did. #1689 moved it into `valgrind_debian`, whose job-wide `CTIMETESTS: 'no'` turned it off. This sets `CTIMETESTS: 'yes'` on the two arm64 entries.

I ran `ci/ci.sh` for both entries on aarch64 (Debian trixie, Valgrind 3.24, clang 19). Both pass. Both fail under Valgrind after I replace `secp256k1_scalar_cond_negate` in `secp256k1_ecdsa_sig_sign` with `if (high) negate`. Logs on request.

ACKs for top commit:
real-or-random:
ACK 26299c7672d4b61d2e17feecd97532d9abdb32c8
theStack:
ACK 26299c7672d4b61d2e17feecd97532d9abdb32c8

Tree-SHA512: f58327acadcad676e52add03583bd13c45ca0fd44c8d58e5301b2d1dbe3e58009d12a010145db35186189cad2e6cc408cba74d9988b5296992b354b87c18ec21

86/100 · StrongMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Links an issue, advisory, or supporting reference✓ Names security-relevant behavior explicitly
Why it was queued
documentation-only discountmerge-commit duplicate discount
Lower-priorityci: Run ctime_tests under Valgrind on arm64by Ferdinando Ametrano · 26299c76 · Oct 22, 2026 · 1 fileMessage 80 · StrongTriage 0Details
Commit message · Ferdinando Ametrano

ci: Run ctime_tests under Valgrind on arm64

The Cirrus "ARM64: Linux (Debian stable), Valgrind" task ran
ctime_tests. 004f57fcd86d moved it into the `valgrind_debian` job,
whose `CTIMETESTS: 'no'` turned them off. No other arm64 job runs
ctime_tests.

80/100 · StrongMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Uses a recognizable type or scope✓ Provides detailed explanatory context
Why it was queued
documentation-only discount
Security candidatesilentpayments: reject label tweaks that overflow the group orderby Sebastian Falbesoner · 95552e16 · Oct 22, 2026 · 2 filesMessage 100 · StrongLow 31Details
Commit message · Sebastian Falbesoner

silentpayments: reject label tweaks that overflow the group order

Previously, a label tweak returned by the `label_lookup` callback that
is not smaller than the group order was silently reduced modulo the
group order. Such a tweak can never be produced by
`secp256k1_silentpayments_recipient_label_create`, so it indicates a
corrupted or improperly constructed label cache, i.e., a bug on the
caller side rather than invalid data from an untrusted source. Treat
this as an API misuse (similar to the magic byte checks on the
`prevouts_summary` argument), and add a test.

The assignment of the found output is moved after the label tweak
check, so that the found_outputs[k] entry is left untouched if the
scan is aborted due to an invalid label tweak.

100/100 · StrongMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Explains rationale or failure mode✓ Mentions testing or verification✓ Names security-relevant behavior explicitly
Why it was queued
memory safety
AI analysis · Low 31/100

This change tightens error handling in the silent payments scanning code. Previously, if a caller-supplied label tweak was as large as or larger than the elliptic curve group order, it was silently wrapped around (reduced modulo the order). Now the function rejects such tweaks and aborts scanning. The tweak value comes from a caller-provided callback/cache, not from untrusted network data, so this is treated as a caller bug rather than an externally exploitable vulnerability. The patch also ensures that if this rejection happens, sensitive intermediate values are cleared from memory and the output entry is not partially written.

Lower-priorityMerge bitcoin-core/secp256k1#1965: remove unused SECP256K1_GE_CONST_INFINITYby merge-script · e74a0187 · Oct 19, 2026 · 1 fileMessage 81 · StrongTriage 0Details
Commit message · merge-script

Merge bitcoin-core/secp256k1#1965: remove unused SECP256K1_GE_CONST_INFINITY

7b59e1fc42520766bd44a613151f9f2909de2dd1 remove unused SECP256K1_GE_CONST_INFINITY (fanquake)

Pull request description:

ACKs for top commit:
theStack:
ACK 7b59e1fc42520766bd44a613151f9f2909de2dd1

Tree-SHA512: 2961883d32c4bdfdb5276f17bef8bd05dcdbb29d7936839377b0206826da02506f08c8e0c4f515d46c27eef204471d0313a75f56f3287beebf7a26e7be2a89c8

81/100 · StrongMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Links an issue, advisory, or supporting reference
Why it was queued
merge-commit duplicate discount
Lower-priorityMerge bitcoin-core/secp256k1#1952: util: make STATIC_ASSERT usable at file scopeby merge-script · d2cbca37 · Oct 19, 2026 · 3 filesMessage 93 · StrongTriage 0Details
Commit message · merge-script

Merge bitcoin-core/secp256k1#1952: util: make STATIC_ASSERT usable at file scope

20fcbae2197486b5dce996eb246677c2c7b73595 assumptions: move static assertions to file scope (Tim Ruffing)
7d53109b85ecf975ebe4425bd692ed01bc2eba87 util: make STATIC_ASSERT usable at file scope (Tim Ruffing)

Pull request description:

Replace the switch-based STATIC_ASSERT, which is a statement and thus only usable inside functions, with a declaration-like macro. It uses _Static_assert in C11 mode and, as an extension, with GCC >= 4.6 and Clang in pre-C11 modes. Other compilers fall back to declaring an extern array whose size is negative if the assertion fails.

Since STATIC_ASSERT now expands to a declaration, move its use in secp256k1_ge_impl_to_bytes before VERIFY_CHECK to avoid mixing declarations and code, which C89 forbids.

ACKs for top commit:
theStack:
ACK 20fcbae2197486b5dce996eb246677c2c7b73595

Tree-SHA512: a9637539ce8ba8918aaa94b703cdc59ac7518173003729691b733aacba6db19be00c5d15434871985b157f4f173f7781c39bba09b1609422af5b5afa43b0e743

93/100 · StrongMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Explains rationale or failure mode✓ Links an issue, advisory, or supporting reference
Why it was queued
merge-commit duplicate discount
Lower-priorityMerge bitcoin-core/secp256k1#1943: tests: silentpayments: cover labeled output beyond the first label batchby merge-script · 60804dc2 · Oct 19, 2026 · 1 fileMessage 91 · StrongTriage 0Details
Commit message · merge-script

Merge bitcoin-core/secp256k1#1943: tests: silentpayments: cover labeled output beyond the first label batch

0c3c70d5f70d09bddf3e9ed5247d382ebe8d577e tests: silentpayments: cover labeled output beyond the first label batch (ViniciusCestarii)

Pull request description:

`secp256k1_silentpayments_check_label_batch` maps a candidate index within a batch back to a tx output index via `j_start + i / 2`. In the first batch j_start == 0, so an incorrect mapping is indistinguishable from the correct one. The only existing test with labeled outputs past the first batch is the K_max test vector, which only checks the number of found outputs. For example, this mutant survives the current tests:

```diff
diff --git a/src/modules/silentpayments/main_impl.h b/src/modules/silentpayments/main_impl.h
index 0ea3ee1..533be40 100644
--- a/src/modules/silentpayments/main_impl.h
+++ b/src/modules/silentpayments/main_impl.h
@@ -589,7 +589,7 @@ static int secp256k1_silentpayments_check_label_batch(
*label_tweak = label_lookup(label33, label_context);
if (*label_tweak != NULL) {
*label_ge = label_candidates_ge[i];
- return (int)(j_start + i / 2);
+ return (int)((j_start + i) / 2);
}
}
return -1;
```

This PR adds `test_recipient_scan_label_batch_index`. It puts LABEL_BATCH_SIZE non-matching outputs before a labeled output, so the match lands in the second batch.

ACKs for top commit:
Yudis-bit:
Tested ACK 0c3c70d on Windows. Confirmed the test catches the mutant.
fametrano:
ACK 0c3c70d5f70d09bddf3e9ed5247d382ebe8d577e
theStack:
ACK 0c3c70d5f70d09bddf3e9ed5247d382ebe8d577e

Tree-SHA512: 86a48b72093ff6a66333e4df5de6ae8330ec2d23fbbcedb9de6b4bccd95a791c2e4b42de981317511a35111cf61559ebe45e51179131c0a6aa1683f145747289

91/100 · StrongMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Mentions testing or verification✓ Links an issue, advisory, or supporting reference
Why it was queued
fuzzing or regression evidencemerge-commit duplicate discount
AI review queuedremove unused SECP256K1_GE_CONST_INFINITYby fanquake · 7b59e1fc · Oct 14, 2026 · 1 fileMessage 35 · OpaqueInformational 15Details
Commit message · fanquake

remove unused SECP256K1_GE_CONST_INFINITY

35/100 · OpaqueMessage clarity
✓ Descriptive subject! No meaningful explanatory body
Why it was queued
second-pass: opaque commit message
AI analysis · Informational 15/100

This commit simply deletes an unused macro named SECP256K1_GE_CONST_INFINITY from a header file. A macro is a shorthand definition for code, and this one was no longer referenced anywhere in the project. Removing dead code has no functional effect and does not change how the library behaves or how it handles secrets.

Security candidateMerge bitcoin-core/secp256k1#1929: silentpayments: perform tweak addition with actual scalarsby merge-script · 04b91ce2 · Oct 12, 2026 · 1 fileMessage 100 · StrongLow 26Details
Commit message · merge-script

Merge bitcoin-core/secp256k1#1929: silentpayments: perform tweak addition with actual scalars

11e9c6ede7f0e68e42aa7cd018702bcf88e48ca8 silentpayments: perform tweak addition with actual scalars (Sebastian Falbesoner)

Pull request description:

When having a labeled match in the silentpayments scanning function (`_silentpayments_recipient_scan_outputs`), the addition of the [spending tweak (being t_k + label_tweak)](https://github.com/bitcoin/bips/blob/09e21036a4001fe6c9ba65c1d3a39b737768132f/bip-0352.mediawiki?plain=1#L367) is currently done using the secret key tweaking function `secp256k1_ec_seckey_tweak_add`. This, and the long comment explaining why this call could fail, stem from what I'd argue is ultimately a type mismatch: a tweak is not a secret key, and the value 0, both for individual tweaks and for the result, is just fine for additive tweaking. Simplify by just using scalar addition instead, so the long comment and the branch can be removed.

There is one subtle behavior change in the case a label tweak is returned from the label cache that is overflowing (i.e. larger than or equal than the group order N). As this is an user error, I'd argue that the concrete tweak output doesn't matter in this case. If anything, we should consider if we return 0 in this case to indicate that the user did something wrong (though I don't think it's needed).

ACKs for top commit:
Yudis-bit:
Tested ACK 11e9c6e.
nymius:
ACK 11e9c6ede7f0e68e42aa7cd018702bcf88e48ca8

Tree-SHA512: 7a53bee44e405ae5bec3c6fdb21d1ad5929a5794779036f1a057140f679ef23c7660d2ac8b6ff12f398a233de36967464004ea425c3d233dfacca8cd12b081cb

100/100 · StrongMessage clarity
✓ 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
Why it was queued
secret or key materialmemory safetymerge-commit duplicate discount
AI analysis · Low 26/100

This change simplifies how Silent Payments scanning adds a small tweak value to a secret-derived value. It replaces a function meant for secret-key tweaking with plain scalar (modular number) addition. The old code had a special case that set the result to zero if the addition 'failed' (produced zero). The new code no longer does that, and it also no longer rejects malformed tweak values larger than the group order. The commit author treats these as user errors with no meaningful security difference, but the behavior does change subtly.

Lower-priorityMerge bitcoin-core/secp256k1#1866: musig: Add hash context testsby merge-script · 0283a11d · Oct 12, 2026 · 1 fileMessage 91 · StrongTriage 0Details
Commit message · merge-script

Merge bitcoin-core/secp256k1#1866: musig: Add hash context tests

fac66a1b4e4cdc65ad635cbdd1dc2acf31ece35b musig: add hash context tests (mllwchrry)

Pull request description:

Adds missing hash context tests for the musig module, covering the`pubkey_agg`, `nonce_gen`, and `nonce_process` functions. Follows the same pattern as the hash context tests for other modules added in #1777.

ACKs for top commit:
theStack:
ACK fac66a1b4e4cdc65ad635cbdd1dc2acf31ece35b
furszy:
utACK fac66a1b4e4cdc65ad635cbdd1dc2acf31ece35b

Tree-SHA512: 917327a63e62d7e78887092ff02ab2f2691ab84e4a46b513f9471202d1d1b8920f5f7cd90fd6801bea9a09b5499eec50b263dcbe2ae17dad7caa66e1d9752460

91/100 · StrongMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Mentions testing or verification✓ Links an issue, advisory, or supporting reference
Why it was queued
merge-commit duplicate discount
Security candidateMerge bitcoin-core/secp256k1#1963: doc: say the sha256 compression callback processes secretsby merge-script · 31716e4b · Oct 12, 2026 · 1 fileMessage 86 · StrongInformational 15Details
Commit message · merge-script

Merge bitcoin-core/secp256k1#1963: doc: say the sha256 compression callback processes secrets

494d3053c0cb4d28c7015a088f8c6270063fd017 doc: say the sha256 compression callback processes secrets (Ferdinando Ametrano)

Pull request description:

As agreed in #1958, this notes in the header that the callback sees secrets such as secret keys, so it must run in constant time and must not keep or log its input.

Fixes #1958.

*Assisted-by: my usual tools (LLM, Internet, computer). Mistakes are mine.*

ACKs for top commit:
real-or-random:
ACK 494d3053c0cb4d28c7015a088f8c6270063fd017
furszy:
utACK 494d3053c0cb4d28c7015a088f8c6270063fd017
theStack:
ACK 494d3053c0cb4d28c7015a088f8c6270063fd017

Tree-SHA512: 90f14ab91bdf1f9f30aea67afe3eed561726312ec046728be08856065bb8bdb6b1c83efe84ea5af450c6339666fd749ca596e68867feffee3e157d6e50fff897

86/100 · StrongMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Links an issue, advisory, or supporting reference✓ Names security-relevant behavior explicitly
Why it was queued
secret or key materialconstant-time or timing behaviorcryptography-sensitive pathmerge-commit duplicate discount
AI analysis · Informational 15/100

This commit only adds a documentation comment to a public header file. It reminds developers that a special callback function used for SHA256 hashing may receive secret data such as private keys, so any custom implementation must be constant-time and must not leak or store the input. No code behavior was changed.

Security candidatedoc: say the sha256 compression callback processes secretsby Ferdinando Ametrano · 494d3053 · Oct 12, 2026 · 1 fileMessage 81 · StrongInformational 18Details
Commit message · Ferdinando Ametrano

doc: say the sha256 compression callback processes secrets

The function set by secp256k1_context_set_sha256_compression hashes
secret keys, for example when deriving RFC 6979 nonces. Say so, and
require it to run in constant time and not to keep or log its input.

Fixes #1958.

Assisted-by: my usual tools (LLM, Internet, computer). Mistakes are mine.
Signed-off-by: Ferdinando Ametrano <ferdinando@ametrano.net>

81/100 · StrongMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Links an issue, advisory, or supporting reference
Why it was queued
secret or key materialconstant-time or timing behaviorcryptography-sensitive path
AI analysis · Informational 18/100

This is a documentation-only change. It adds a warning to the public header file telling developers that the optional SHA256 compression callback may receive secret key material, and therefore any custom implementation must run in constant time and must not retain or log its input. The change itself does not alter any code behavior, fix a bug, or add a security control. It only clarifies a security requirement that was already implicit in the API design.

Lower-priorityMerge bitcoin-core/secp256k1#1953: ci: bump macOS ARM64 runner to macos-15by merge-script · 22245aed · Oct 3, 2026 · 1 fileMessage 98 · StrongTriage 0Details
Commit message · merge-script

Merge bitcoin-core/secp256k1#1953: ci: bump macOS ARM64 runner to macos-15

146def981272c196111d3bf1644a7ded84df3f51 ci: bump macOS ARM64 runner to macos-15 (Sebastian Falbesoner)

Pull request description:

The `macos-14` image is deprecated and approaching retirement on November 2nd, 2026. GitHub has scheduled daily brownouts beginning October 5th that will fail jobs still using `macos-14`. Migrate the ARM64 native job to `macos-15` to avoid CI disruptions.

See https://github.com/actions/runner-images/issues/13518

ACKs for top commit:
hebasto:
ACK 146def981272c196111d3bf1644a7ded84df3f51.
real-or-random:
ACK 146def981272c196111d3bf1644a7ded84df3f51

Tree-SHA512: 1b340d6bb72fb7a1f23ce462fb91d02ff6b6653fa3ca83ae6000ceb7447cfec4183126de7f1ca71ffe50da143803e7ad62d17bcfce6e9839ec2144d41dbe5bbb

98/100 · StrongMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Explains rationale or failure mode✓ Links an issue, advisory, or supporting reference✓ Names security-relevant behavior explicitly
Why it was queued
documentation-only discountmerge-commit duplicate discount
Lower-priorityci: bump macOS ARM64 runner to macos-15by Sebastian Falbesoner · 146def98 · Oct 2, 2026 · 1 fileMessage 100 · StrongTriage 0Details
Commit message · Sebastian Falbesoner

ci: bump macOS ARM64 runner to macos-15

The `macos-14` image is deprecated and approaching retirement on
November 2nd, 2026. GitHub has scheduled daily brownouts beginning
October 5th that will fail jobs still using `macos-14`. Migrate the
ARM64 native job to `macos-15` to avoid CI disruptions.

See https://github.com/actions/runner-images/issues/13518

100/100 · StrongMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Uses a recognizable type or scope✓ Provides detailed explanatory context✓ Explains rationale or failure mode✓ Links an issue, advisory, or supporting reference
Why it was queued
documentation-only discount
Lower-priorityMerge bitcoin-core/secp256k1#1950: tests: silentpayments: check found outputs are distinct in vector testsby merge-script · 186eec1c · Oct 2, 2026 · 1 fileMessage 96 · StrongTriage 0Details
Commit message · merge-script

Merge bitcoin-core/secp256k1#1950: tests: silentpayments: check found outputs are distinct in vector tests

1c6f7930848009281edc468b547dd2056c175901 tests: silentpayments: check found outputs are distinct in vector tests (ViniciusCestarii)

Pull request description:

[Suggested](https://github.com/bitcoin-core/secp256k1/pull/1943#issuecomment-5902032203) by theStack: add a new check on silent payments vector tests: if N outputs are found, ensure they all have distinct x-only pubkeys.

This catches the mutant from #1943 (`j_start + i / 2` -> `(j_start + i) / 2` in `secp256k1_silentpayments_check_label_batch`), which maps several matches to the same tx output and previously went undetected.

ACKs for top commit:
real-or-random:
utACK 1c6f7930848009281edc468b547dd2056c175901
theStack:
re-ACK 1c6f7930848009281edc468b547dd2056c175901

Tree-SHA512: d267b7878b8a1dc146490431760d877fd01322869229bfac72737eff786ec11fcb63fabddb1f620114d4f180f2afb2c8b30bc26d1b342b164f1d4a82fb18e4d1

96/100 · StrongMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Mentions testing or verification✓ Links an issue, advisory, or supporting reference✓ Names security-relevant behavior explicitly
Why it was queued
merge-commit duplicate discount
Security candidateMerge bitcoin-core/secp256k1#1946: doc: clean up lingering ECMULT_WINDOW_SIZE commentby merge-script · 6f065e9a · Oct 1, 2026 · 2 filesMessage 96 · StrongInformational 15Details
Commit message · merge-script

Merge bitcoin-core/secp256k1#1946: doc: clean up lingering ECMULT_WINDOW_SIZE comment

685247a3817cdb932fa21c785c64a60bc0e9f135 doc: correct ecmult table storage size (Yudistira Putra)
cc0e03ffd4ddfce3663dc807a10cc4e3d0132d79 doc: clean up lingering ECMULT_WINDOW_SIZE comment (Yudistira Putra)

Pull request description:

Move the `ECMULT_WINDOW_SIZE` comment from under `WINDOW_A` in `src/ecmult_impl.h` to the window-size setting in `src/ecmult.h`, and replace the stale `WINDOW_G` references.

The second commit corrects the table-size formula to `ECMULT_TABLE_SIZE(ECMULT_WINDOW_SIZE) * 64` bytes. A comment above it points to the existing `STATIC_ASSERT` in `group_impl.h` that guarantees the storage size. The macro can only be used inside functions.

Tested on Windows x64 with GCC 16.2.0, C90, `-Werror -pedantic-errors`, and all modules enabled. All 237 CTest tests passed, including exhaustive tests and examples.

Closes #1766.

ACKs for top commit:
real-or-random:
ACK 685247a3817cdb932fa21c785c64a60bc0e9f135
theStack:
ACK 685247a3817cdb932fa21c785c64a60bc0e9f135

Tree-SHA512: e54dc1cd9f27da491d3ab60a1b1265f4e30397528e7146c04e608616badc6ad3c3b88f1e67f37d42d124feea8f36a3ed8bcf9f199d0289b5dd75bbbcec42eccf

96/100 · StrongMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Mentions testing or verification✓ Links an issue, advisory, or supporting reference✓ Names security-relevant behavior explicitly
Why it was queued
access controlmerge-commit duplicate discount
AI analysis · Informational 15/100

This is a documentation-only cleanup. It moves a comment about the ECMULT_WINDOW_SIZE setting to a better location and fixes an outdated formula in the comment. No code behavior changes.

Lower-prioritydoc: correct ecmult table storage sizeby Yudistira Putra · 685247a3 · Oct 1, 2026 · 1 fileMessage 68 · AdequateTriage 0Details
Commit message · Yudistira Putra

doc: correct ecmult table storage size

The storage type is required to be exactly 64 bytes, as enforced by
STATIC_ASSERT in group_impl.h. Drop the outdated padding caveat and
point to that assertion above the table-size comment.

68/100 · AdequateMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
Security candidateMerge bitcoin-core/secp256k1#1933: refactor: introduce `ecmult_const_ge` helper (preventing accidential gej leaks)by merge-script · 2365dc64 · Oct 1, 2026 · 7 filesMessage 100 · StrongLow 37Details
Commit message · merge-script

Merge bitcoin-core/secp256k1#1933: refactor: introduce `ecmult_const_ge` helper (preventing accidential gej leaks)

02e00f54a0e0ac72c74eb4f5b84855b290bba124 test: refactor: simplify tests by using `_ecmult_const_ge` helper (Sebastian Falbesoner)
b4fbee61e91d30aedbe0e84f407393e0c27c8c55 refactor: rename `_ecmult_const` -> `_ecmult_const_gej` for consistency (Sebastian Falbesoner)
ace566f66c1b75d929c367612abf22944d81fb8e refactor: introduce `_ecmult_const_ge` helper (preventing accidental gej leaks) (Sebastian Falbesoner)

Pull request description:

This PR is the counterpart of #1861 for `_ecmult_const`: constant-time scalar multiplication with arbitrary points frequently involves a conversion to affine coordinates and clearing out the temporary Jacobian group element object after to avoid leaking secret key material, i.e. executing the following three functions:
* `secp256k1_ecmult_const(&rj, ...)`
* `secp256k1_ge_set_gej(&r, &rj)`
* `secp256k1_gej_clear(&rj)`

A helper `ecmult_const_ge` is introduced to deduplicate code and mitigate the risk that the last step is forgotten (which can easily happen, as it would not be detected by tests). It is applied in the ECDH and silentpayments modules.

The idea came up in the course of reviewing the DLEQ module, where a gej clearing was missing, see https://github.com/bitcoin-core/secp256k1/pull/1802#discussion_r3960829657.

ACKs for top commit:
real-or-random:
utACK 02e00f54a0e0ac72c74eb4f5b84855b290bba124

Tree-SHA512: dadfbace89875d50c331170738ebc413516a01d8b05a1e75a3d9c10ade194772633920a3ea0592c4b709cfb78b86a3bc72806e3f06f3ba5567a42e17ae1e2309

100/100 · StrongMessage clarity
✓ 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✓ Names security-relevant behavior explicitly
Why it was queued
secret or key materialconstant-time or timing behaviormerge-commit duplicate discount
AI analysis · Low 37/100

This commit is a defensive code cleanup in Bitcoin Core's secp256k1 cryptography library. It introduces a helper function that automatically clears temporary secret data after a constant-time elliptic curve multiplication, and switches existing code to use it. The change prevents future mistakes where sensitive intermediate values could be left in memory, but the commit itself does not claim to fix an active vulnerability in the current code.

Lower-prioritytests: silentpayments: check found outputs are distinct in vector testsby ViniciusCestarii · 1c6f7930 · Sep 30, 2026 · 1 fileMessage 68 · AdequateTriage 0Details
Commit message · ViniciusCestarii

tests: silentpayments: check found outputs are distinct in vector tests

Suggested by theStack in #1943.

68/100 · AdequateMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Mentions testing or verification✓ Links an issue, advisory, or supporting reference! No meaningful explanatory body
Security candidateMerge bitcoin-core/secp256k1#1949: ecdsa: Clarify derivation of the r check in `_sig_verify`by merge-script · 4a264a93 · Sep 30, 2026 · 1 fileMessage 93 · StrongInformational 15Details
Commit message · merge-script

Merge bitcoin-core/secp256k1#1949: ecdsa: Clarify derivation of the r check in `_sig_verify`

93987567a1bf2bb5d3ea1492c286cd2b5a76f544 ecdsa: Clarify derivation of the r check in `_sig_verify` (Tim Ruffing)

Pull request description:

Introduce the `xr + n < p` condition in the step where it is needed, namely right before switching from integer equality to equality modulo p, and explain why it is required there. Write congruences as `a == b (mod m)`, because `a mod p == b` reads as if `mod p` were an operator applied to the left-hand side only.

Also reword the comment at the `p - n` check: the check is needed for correctness, not merely an optimization.

Made these improvements when trying to understand the background of #1948.

ACKs for top commit:
theStack:
re-ACK 93987567a1bf2bb5d3ea1492c286cd2b5a76f544

Tree-SHA512: 162508706fdb3c912c71de5935f276f24ed31c62620eee513896c4058327a697f3c9f9250634d65bcd1687a716f0347e8775b3382dade5ea77ede17759e70ad4

93/100 · StrongMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Explains rationale or failure mode✓ Links an issue, advisory, or supporting reference
Why it was queued
cryptography-sensitive pathmerge-commit duplicate discount
AI analysis · Informational 15/100

This commit only rewrites comments in the source code to make the mathematical explanation clearer. It does not change any actual code instructions, function behavior, or security properties. There is no vulnerability or fix here.

Security candidateMerge bitcoin-core/secp256k1#1948: tests: add ECDSA verify case where r + n overflows pby merge-script · e23e9201 · Sep 30, 2026 · 1 fileMessage 100 · StrongInformational 12Details
Commit message · merge-script

Merge bitcoin-core/secp256k1#1948: tests: add ECDSA verify case where r + n overflows p

fc88acc3e2e2cbba7ee202634eb73d5d21694126 tests: add ECDSA verify case where r + n overflows p (ViniciusCestarii)

Pull request description:

Currently no test checks that ECDSA verify rejects a signature where r + n ≥ p and (r + n) mod p equals x(R), so the following mutant lives:

```diff
diff --git a/src/ecdsa_impl.h b/src/ecdsa_impl.h
index 5963877..5301eaa 100644
--- a/src/ecdsa_impl.h
+++ b/src/ecdsa_impl.h
@@ -258,10 +258,6 @@ static int secp256k1_ecdsa_sig_verify(const secp256k1_scalar *sigr, const secp25
/* xr * pr.z^2 mod p == pr.x, so the signature is valid. */
return 1;
}
- if (secp256k1_fe_cmp_var(&xr, &secp256k1_ecdsa_const_p_minus_order) >= 0) {
- /* xr + n >= p, so we can skip testing the second case. */
- return 0;
- }
secp256k1_fe_add(&xr, &secp256k1_ecdsa_const_order_as_fe);
if (secp256k1_gej_eq_x_var(&xr, &pr)) {
/* (xr + n) * pr.z^2 mod p == pr.x, so the signature is valid. */
```

This adds a case with r = p - n + 1, so that (r + n) mod p = 1, and a pubkey chosen so that x(R) = 1, covering this gap.

ACKs for top commit:
real-or-random:
utACK fc88acc3e2e2cbba7ee202634eb73d5d21694126
theStack:
re-ACK fc88acc3e2e2cbba7ee202634eb73d5d21694126

Tree-SHA512: b9ab5ff0e7312e3ff8b5667eed56f616f7fc59ad8d1777fd54d70fcb3342b5084dc8915c0638a6486fdfe4522da5905521dd32622a64d5a2b5d0a3385e381098

100/100 · StrongMessage clarity
✓ 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✓ Names security-relevant behavior explicitly
Why it was queued
signing boundarymemory safetymerge-commit duplicate discount
AI analysis · Informational 12/100

This commit only adds a new test case to the project's test suite. It does not change any production cryptographic code. The new test verifies that the ECDSA signature verification function correctly rejects a crafted invalid signature in a rare edge case where a mathematical overflow condition occurs. It closes a testing gap that could otherwise allow a subtle code mutation to go undetected, but it is not a security fix by itself.

Security candidatetests: add ECDSA verify case where r + n overflows pby ViniciusCestarii · fc88acc3 · Sep 30, 2026 · 1 fileMessage 60 · AdequateInformational 20Details
Commit message · ViniciusCestarii

tests: add ECDSA verify case where r + n overflows p

60/100 · AdequateMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Mentions testing or verification! No meaningful explanatory body
Why it was queued
memory safety
AI analysis · Informational 20/100

This commit adds a new test case to the secp256k1 cryptographic library's test suite. It checks that ECDSA signature verification correctly rejects a crafted edge case where a mathematical value (r + n) overflows the prime field boundary. The change only adds tests; it does not modify the verification logic itself, so it is not a fix for a known vulnerability but rather a regression test for a subtle boundary condition.

Security candidateMerge bitcoin-core/secp256k1#1947: musig: test nonce_gen_counter with random countersby merge-script · 2b4a7b90 · Sep 29, 2026 · 1 fileMessage 100 · StrongInformational 12Details
Commit message · merge-script

Merge bitcoin-core/secp256k1#1947: musig: test nonce_gen_counter with random counters

b819a790f06122d5a53c0320e79c0dc486349fbd musig: test nonce_gen_counter with random counters (ViniciusCestarii)

Pull request description:

The only output check of `nonce_gen_counter` uses `nonrepeating_cnt = 0`, so the following mutant replacing `secp256k1_write_be64` with `secp256k1_write_be32` (which could enable nonce reuse) survived because zero serializes the same either way.

```diff
diff --git a/src/modules/musig/session_impl.h b/src/modules/musig/session_impl.h
index d8a3cca..710c4c5 100644
--- a/src/modules/musig/session_impl.h
+++ b/src/modules/musig/session_impl.h
@@ -447,7 +447,7 @@ int secp256k1_musig_nonce_gen_counter(const secp256k1_context* ctx, secp256k1_mu
memset(secnonce, 0, sizeof(*secnonce));
ARG_CHECK(keypair != NULL);

- secp256k1_write_be64(buf, nonrepeating_cnt);
+ secp256k1_write_be32(buf, nonrepeating_cnt);
/* keypair_sec and keypair_pub do not fail if the arguments are not NULL */
ret = secp256k1_keypair_sec(ctx, seckey, keypair);
VERIFY_CHECK(ret);
```

This add a new test, which checks that for random 64-bit counters, `nonce_gen_counter` gives the same nonce as `nonce_gen`.

ACKs for top commit:
real-or-random:
utACK b819a790f06122d5a53c0320e79c0dc486349fbd

Tree-SHA512: 1f16375880808eacea1f4db9931f345f2f1b44a2724d61710beb5e39e956d4f28bd6707c90b8300f033282bee207fd2f44c039cb01ef0675858d415ad6ea2978

100/100 · StrongMessage clarity
✓ 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✓ Names security-relevant behavior explicitly
Why it was queued
nonce handlingmerge-commit duplicate discount
AI analysis · Informational 12/100

This commit only adds a new test to the MuSig cryptographic module. It does not change any production code. The new test verifies that two different nonce-generation functions produce matching results when given equivalent random 64-bit counters. The pull request description mentions a hypothetical mutation (replacing a 64-bit write with a 32-bit write) that could survive testing if only zero-valued counters were used, but that mutation is not present in the code and is only described as motivation for stronger testing.

Lower-prioritymusig: test nonce_gen_counter with random countersby ViniciusCestarii · b819a790 · Sep 28, 2026 · 1 fileMessage 65 · AdequateTriage 0Details
Commit message · ViniciusCestarii

musig: test nonce_gen_counter with random counters

65/100 · AdequateMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Mentions testing or verification✓ Names security-relevant behavior explicitly! No meaningful explanatory body