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 43 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#1942: unit_test: fix help text claiming unknown args are ignoredby merge-script · f14d2992 · Sep 25, 2026 · 1 fileMessage 86 · StrongTriage 0Details
Commit message · merge-script

Merge bitcoin-core/secp256k1#1942: unit_test: fix help text claiming unknown args are ignored

9495f867e724bc2aae37e3d8c350be0954c767b2 unit_test: fix help text claiming unknown args are ignored (anshikakalpana)

Pull request description:

parse_arg() has intentionally treated unknown arguments as fatal errors. Update the --help text to match this behavior instead of the outdated 'reported but ignored' claim.

Fixes #1939

ACKs for top commit:
real-or-random:
utACK 9495f867e724bc2aae37e3d8c350be0954c767b2

Tree-SHA512: 430ff2e19282e5d5f1481fd9b321819f4cca103907971c2a83c64a1a286709fed9a5e93d3b100b5356286e249ce1fc9dafc6bf524172dcc378f2d4d4ef4db75b

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
merge-commit duplicate discount
Lower-priorityunit_test: fix help text claiming unknown args are ignoredby anshikakalpana · 9495f867 · Sep 24, 2026 · 1 fileMessage 81 · StrongTriage 0Details
Commit message · anshikakalpana

unit_test: fix help text claiming unknown args are ignored

parse_arg() has intentionally treated unknown arguments as fatal
errors since #1734. Update the --help text to match this behavior
instead of the outdated 'reported but ignored' claim.

Fixes #1939

81/100 · StrongMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Links an issue, advisory, or supporting reference
Lower-priorityMerge bitcoin-core/secp256k1#1934: Clear secret-dependent variables in `_ecmult_const_xonly`by merge-script · b63c6afb · Sep 23, 2026 · 1 fileMessage 98 · StrongTriage 0Details
Commit message · merge-script

Merge bitcoin-core/secp256k1#1934: Clear secret-dependent variables in `_ecmult_const_xonly`

9e65f6ac9b714b85bf03338ffb900a6aeebed800 Clear secret-dependent variables in `_ecmult_const_xonly` (Sebastian Falbesoner)

Pull request description:

While working on the refactoring PR #1933, I noticed that there is no `_gej` clearing of the point multiplication result in `_ecmult_const_xonly` (apparently this was missed back then when looking for instances in https://github.com/bitcoin-core/secp256k1/pull/1579#issuecomment-2405693607, likely because in this case there is no `_ge_set_gej` call involved).

Note that for `_ecmult_const` itself there is already a separate PR: https://github.com/bitcoin-core/secp256k1/pull/1885

ACKs for top commit:
real-or-random:
utACK 9e65f6ac9b714b85bf03338ffb900a6aeebed800

Tree-SHA512: 60312e5daa5b088c6006d7748cfef0d554991ef459aca5746911124760736b8c866357e490a56fc94aa2f827027d5c7bd84a35e4b9e9733d22ec40f7f547f733

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
merge-commit duplicate discount
AI review queuedMerge bitcoin-core/secp256k1#1840: ci: Simplify module configuration and extend test coverageby merge-script · 9701113f · Sep 22, 2026 · 1 fileMessage 91 · StrongInformational 15Details
Commit message · merge-script

Merge bitcoin-core/secp256k1#1840: ci: Simplify module configuration and extend test coverage

63f7e222c9d78550f70365f2ac57d24158ad3447 ci: Simplify module configuration (mllwchrry)

Pull request description:

Enables all modules by default, and tests the disabling of each module separately (respecting the dependency chain). This simplifies the configuration of modules in CI and extends the test coverage.

The extended coverage is proven by exposing pre-existing issues fixed in #1837 and #1839.

ACKs for top commit:
hebasto:
re-ACK 63f7e222c9d78550f70365f2ac57d24158ad3447.
theStack:
Concept and code-review ACK 63f7e222c9d78550f70365f2ac57d24158ad3447

Tree-SHA512: 4817c46eeb18d1d565fdcf91e9cd40d3b57ca9fb6c71a74940ed46631deb55bf54b3ef8dbbb3cf548721ce05ad7e1ea724421349f3a1d1c54badea98a5859e04

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
documentation-only discountmerge-commit duplicate discountsecond-pass: broader security terminology
AI analysis · Informational 15/100

This change only edits the project's automated continuous-integration (CI) configuration file. It turns on all optional cryptographic modules by default in CI and adds test runs that disable each module one at a time. There is no change to the actual library source code, build scripts, or released binaries, so it cannot directly introduce a runtime security vulnerability or fix one in shipped code. It is a testing-infrastructure cleanup that also increases coverage of build configurations.

Security candidateMerge bitcoin-core/secp256k1#1918: refactor: split `ge_parse` into explicit variants (compressed, uncompressed, uncompressed+hybrid)by merge-script · 46db7871 · Sep 11, 2026 · 6 filesMessage 100 · StrongInformational 15Details
Commit message · merge-script

Merge bitcoin-core/secp256k1#1918: refactor: split `ge_parse` into explicit variants (compressed, uncompressed, uncompressed+hybrid)

de02108c51ca052245c7ba154b02a890e6815fdb tests: cover compressed pubkey parsing/serialization in `_ec_pubkey_parse` test (Sebastian Falbesoner)
31b1b300e812038e5b52f534370f7bd0cae01a79 refactor: split `ge_parse` helper into explicit variants (Sebastian Falbesoner)

Pull request description:

This PR is a follow-up to #1915, see the suggestion https://github.com/bitcoin-core/secp256k1/pull/1915#pullrequestreview-4962713401.

Splits the `ge_parse` function into three explicit variants for parsing from:
- compressed public keys (33-bytes, prefixes 0x02 or 0x03)
- uncompressed public keys (65-bytes, prefix 0x04)
- uncompressed and hybrid public keys (65-bytes, prefixes 0x04, 0x06 or 0x07)

The first two are the counter-parts for the existing serialization functions `ge_serialize{33,65}`. The latter one is only needed for legacy reasons and likely not needed in the future. Having it named explicitly helps to avoid accepting hybrid pubkeys unintentionally. `ge_parse65` is currently unused outside of tests, but one potential use-case would be the serialization of the prevouts_summary in the silentpayments light-client API PR #1912 (see commit https://github.com/bitcoin-core/secp256k1/pull/1912/changes/82b95fde6fe2c75ec940ade339013939b8ecc5ea), unless we want to define a custom serialization there (where we e.g. remove the constant prefix byte).

ACKs for top commit:
fjahr:
Code review ACK de02108c51ca052245c7ba154b02a890e6815fdb
real-or-random:
utACK de02108c51ca052245c7ba154b02a890e6815fdb

Tree-SHA512: 8bc92f6f53eb5ce3546ecf0a1fa72a909ee6231a08e25a3a9f4070e7d630379fc3e5b2f9bc6dea25726b7d9c97c2cfd8ee39be413328c4159134ec55ec1a59c6

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
cryptography-sensitive pathmerge-commit duplicate discount
AI analysis · Informational 15/100

This commit is a code cleanup (refactor) that splits one internal public-key parsing helper into three clearly named versions. It does not change what keys the public API accepts or rejects, and it adds more tests. There is no security vulnerability being fixed here.

Lower-prioritytests: cover compressed pubkey parsing/serialization in `_ec_pubkey_parse` testby Sebastian Falbesoner · de02108c · Sep 10, 2026 · 1 fileMessage 60 · AdequateTriage 0Details
Commit message · Sebastian Falbesoner

tests: cover compressed pubkey parsing/serialization in `_ec_pubkey_parse` test

60/100 · AdequateMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Mentions testing or verification! No meaningful explanatory body
Lower-priorityMerge bitcoin-core/secp256k1#1935: tests: generate scalars_near_split_bounds instead of hardcodingby merge-script · d01de271 · Sep 10, 2026 · 1 fileMessage 96 · StrongTriage 0Details
Commit message · merge-script

Merge bitcoin-core/secp256k1#1935: tests: generate scalars_near_split_bounds instead of hardcoding

014825f0a30f3968efe51bf782ac2d4662841a41 tests: generate scalars_near_split_bounds instead of hardcoding (anshikakalpana)

Pull request description:

tests: generate scalars_near_split_bounds instead of hardcoding

The hardcoded scalars_near_split_bounds array didn't match its documented formula (a*LAMBDA + (ORDER+b)/2) % ORDER. All 20 entries were off in the same 32-bit window, likely a transcription error.
As a result the vectors only reached ~126-bit outputs through secp256k1_scalar_split_lambda instead of the intended ~127-128-bit boundary, so the case they exist to test was never exercised.

Generate the values at runtime from the formula via fill_scalars_near_split_bounds(), which writes into a caller-provided
array rather than a file-scope static. It is called at each of the three sites that use the array, so the values can no longer drift
from their formula.

Verified the generated values reach within 1-2 units of the true k1_bound/k2_bound from the split_lambda_verify proof, confirming theexisting a/b ranges are sufficient.

Fixes #1920.

ACKs for top commit:
real-or-random:
utACK 014825f0a30f3968efe51bf782ac2d4662841a41

Tree-SHA512: 5ea71b0eefd882711378362968fe1fef078d5b7913a36c11c500d2f91244cfe6b9483ef274096ec9545c13216eb6e4203a7409212d85b39e7ee44b6b63d172cf

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
Lower-prioritytests: generate scalars_near_split_bounds instead of hardcodingby anshikakalpana · 014825f0 · Sep 9, 2026 · 1 fileMessage 91 · StrongTriage 0Details
Commit message · anshikakalpana

tests: generate scalars_near_split_bounds instead of hardcoding

The hardcoded scalars_near_split_bounds array didn't match its
documented formula (a*LAMBDA + (ORDER+b)/2) % ORDER. All 20 entries
were off in the same 32-bit window, likely a transcription error.
As a result the vectors only reached ~126-bit outputs through
secp256k1_scalar_split_lambda instead of the intended ~127-128-bit
boundary, so the case they exist to test was never exercised.

Generate the values at runtime from the formula via
fill_scalars_near_split_bounds(), which writes into a caller-provided
array rather than a file-scope static. It is called at each of the
three sites that use the array, so the values can no longer drift
from their formula.

Verified the generated values reach within 1-2 units of the true
k1_bound/k2_bound from the split_lambda_verify proof, confirming the
existing a/b ranges are sufficient.

Fixes #1920.

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
Security candidateMerge bitcoin-core/secp256k1#1893: test: cover schnorrsig_sign_custom in constant-time testsby merge-script · 99ae2312 · Sep 9, 2026 · 1 fileMessage 96 · StrongInformational 15Details
Commit message · merge-script

Merge bitcoin-core/secp256k1#1893: test: cover schnorrsig_sign_custom in constant-time tests

38255a943f09831c7615bad854e9b827f6c994fa test: cover custom Schnorr nonce callback in ctime tests (Yudistira Putra)
2a3780d73ffcceda5fa113b5a6ca38fb236ca51b test: cover schnorrsig_sign_custom in constant-time tests (Yudistira Putra)

Pull request description:

### Description

`src/ctime_tests.c` covers `secp256k1_schnorrsig_sign32` and `secp256k1_schnorrsig_sign_custom` entry points under Valgrind/CHECKMEM.

`secp256k1_schnorrsig_sign_custom` accepts optional `extraparams`, including a custom nonce function, before calling the shared internal signer. Functional tests cover this API, but previously it was not exercised under the constant-time CHECKMEM harness.

This PR adds coverage for:

- `secp256k1_schnorrsig_sign_custom(..., NULL)` using the default nonce path with NULL extraparams.
- The default BIP340 nonce function with non-NULL `extraparams.ndata`.
- The custom nonce callback dispatch path via a distinct `nonce_function_custom` callback that delegates to `secp256k1_nonce_function_bip340`.
- Secret key material and keypair state under CHECKMEM for these signing paths.

Message and auxiliary data are not treated as secret inputs in these tests.

### Coverage gap

The existing constant-time test suite exercised `secp256k1_schnorrsig_sign32`, but did not exercise the public `secp256k1_schnorrsig_sign_custom` entry point and its custom nonce callback dispatch path under CHECKMEM.

Local synthetic mutations were used during development to verify that the added coverage reaches these paths. These mutations are not included in this branch.

This is a test-coverage improvement. No production cryptographic code is modified, and this PR does not claim a production vulnerability in unmodified libsecp256k1.

### Change

- `src/ctime_tests.c` only
- No production code changes
- No new dependencies

### Build / test

```sh
cmake -B build \
-DSECP256K1_VALGRIND=ON \
-DSECP256K1_BUILD_CTIME_TESTS=ON \
-DSECP256K1_ENABLE_MODULE_SCHNORRSIG=ON \
-DSECP256K1_ENABLE_MODULE_EXTRAKEYS=ON

cmake --build build --parallel
ctest --test-dir build --output-on-failure
valgrind --error-exitcode=42 ./build/bin/ctime_tests
```

Local validation after addressing review feedback:

- 207/207 CTest tests passed.
- `ctime_tests` passed under Valgrind.
- Valgrind reported `ERROR SUMMARY: 0 errors`.
- Valgrind process exited with code 0.

ACKs for top commit:
real-or-random:
utACK 38255a943f09831c7615bad854e9b827f6c994fa

Tree-SHA512: d53655ddebe1444c004cb256e0c68cbf14d7741f67ebcec36eb860af2d27320abba0ab8c0ef04a6c7753ad0b5de49f79bd3c425695c7aebebb32d72f3152c99b

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
explicit security languagesecret or key materialsigning boundaryconstant-time or timing behaviormerge-commit duplicate discount
AI analysis · Informational 15/100

This commit only adds new test code to check that a specific Schnorr signing function behaves in a constant-time manner under Valgrind. It does not change any production cryptographic code, so it cannot introduce or fix a security vulnerability in the library itself. It is a test-coverage improvement.

Security candidateMerge bitcoin-core/secp256k1#1923: group: VERIFY input/output ge/gej/fe exhaustivelyby merge-script · a7f26437 · Sep 9, 2026 · 2 filesMessage 100 · StrongInformational 14Details
Commit message · merge-script

Merge bitcoin-core/secp256k1#1923: group: VERIFY input/output ge/gej/fe exhaustively

c36269ef95da99498b3b62736f09dc42ffe5d094 group/refactor: Use constant expression for readability (Tim Ruffing)
031dbae6591664cf321bd9b09dd12535a5087533 group: Export secp256k1_ge_set_ge(j)_zinv properly in group.h (Tim Ruffing)
4f3bd158d5edd69cc66f39f20c42c72c776fa2d4 group: Cover all input/output ge/gej/fe with VERIFY calls (Tim Ruffing)
0711443e6da39cc98660fbeef3f989935443caa6 group: Add missing FE_VERIFY checks on rzr outputs (Tim Ruffing)
1bd7492181aca5967bbc690a4b81560101b1408b group: Remove redundant SECP256K1_GEJ_VERIFY (Tim Ruffing)
cddd125f72f6156b360edb760d4ae089c3ae7a0f group: Split functions into pre/post VERIFY and _impl (Tim Ruffing)

Pull request description:

This PR splits the functions in group_impl.h in a wrapper that only performs VERIFY and an `_impl` function that has the actual code. This ensures that the post VERIFY calls are not skipped in case of early returns.

Also, this PR adds VERIFY calls wherever they were missing (inside group_impl.h)

The new structure is similar to field_impl.h but a bit simpler because we don't need to deal with two different implementations. A real difference is that, in non-VERIFY mode, field_impl.h delegates via #defines (ensure there's no overhead due to a function call) and here I decided to delegate via function calls. It keeps the code a bit simpler to read (and maybe also simpler to parser for tools such as language servers). The _impl functions all have SECP256K1_INLINE. I think every sane compiler will inline the function calls in non-VERIFY mode (even without SECP256K1_INLINE) because the body of the wrapper is really just a single function call then with the same signature.

Follow-up PR can cover modifications of ges and fes outside the group and field modules, e.g., ecmult modifies ges/gejs directly. Maybe it will be good that it does this only through group functions but we'll need to see; in C++ this module could legitimately be considered a "friend" of group.

ACKs for top commit:
theStack:
ACK c36269ef95da99498b3b62736f09dc42ffe5d094

Tree-SHA512: 7b5a74de1823434037ba0cf84f0e3a8aba56479da508014b8a4c738dd55c5a437edce5255cb45bf067a437bbf3912bc0f6c4c558dda589b0c2dc4dd6b2a0ed06

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 boundarymerge-commit duplicate discount
AI analysis · Informational 14/100

This commit is a code-quality and defensive-programming change. It restructures internal elliptic-curve helper functions so that runtime consistency checks (VERIFY macros) wrap the real implementation and cannot be skipped by an early 'return' statement. It also adds a few missing checks. These VERIFY macros are debug/test-only assertions; they are disabled in production builds, so the change does not alter normal behavior and is not a security fix for a live vulnerability.

Lower-priorityMerge bitcoin-core/secp256k1#1931: tests: cover rejection of invalid plain seckey alongside a valid oneby merge-script · 3f6ee3e9 · Sep 9, 2026 · 1 fileMessage 100 · StrongTriage 0Details
Commit message · merge-script

Merge bitcoin-core/secp256k1#1931: tests: cover rejection of invalid plain seckey alongside a valid one

05f92899846f098623b3f2d392b58b887699b4b8 tests: silentpayments: cover rejection of invalid plain seckey alongside a valid one (Bruno Garcia)

Pull request description:

The existing silentpayment sender tests only pass a single invalid plain seckey, which parses to a zero scalar and is therefore also rejected by the later zero-sum check. Add a test with a valid key followed by an invalid one so that the early return in the seckey loop itself is exercised.

It kills the following mutant, the only one remaining within 229 ones :) - https://secp256k1.space/src/modules/silentpayments/main_impl.h

```diff
diff --git a/src/modules/silentpayments/main_impl.h b/src/modules/silentpayments/main_impl.h
index 415f2d2..489ec91 100644
--- a/src/modules/silentpayments/main_impl.h
+++ b/src/modules/silentpayments/main_impl.h
@@ -237,7 +237,7 @@ int secp256k1_silentpayments_sender_create_outputs(
for (i = 0; i < n_seckeys; i++) {
ret = secp256k1_scalar_set_b32_seckey(&addend, seckeys[i]);
secp256k1_declassify(ctx, &ret, sizeof(ret));
- if (!ret) {
+ if (1==0) {
secp256k1_scalar_clear(&addend);
secp256k1_scalar_clear(&seckey_sum_scalar);
return 0;
```

ACKs for top commit:
real-or-random:
utACK 05f92899846f098623b3f2d392b58b887699b4b8

Tree-SHA512: 41f5da022f5c50f7585813b716b1a35bf3bbf5a42d9fe5ee97a5af94899003107287f243c8a909b8901b5599166eef1c13baa67885d028d58549b624d8d30a31

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#1932: silentpayments: drop "empty key arrays must be NULL" requirementby merge-script · 978d3fa7 · Sep 8, 2026 · 3 filesMessage 86 · StrongTriage 0Details
Commit message · merge-script

Merge bitcoin-core/secp256k1#1932: silentpayments: drop "empty key arrays must be NULL" requirement

ad3688d1e5a1b2afdbc613b2489e2fdb2ec4121d changelog: mention dropped NULL requirement for silentpayments key arrays (Sebastian Falbesoner)
89e3a7066234b3141ea3c97b7db56538c950cc62 silentpayments: drop "empty key arrays must be NULL" requirement (Sebastian Falbesoner)

Pull request description:

Resolves #1930.

ACKs for top commit:
real-or-random:
utACK ad3688d1e5a1b2afdbc613b2489e2fdb2ec4121d
nymius:
ACK ad3688d1e5a1b2afdbc613b2489e2fdb2ec4121d

Tree-SHA512: d7f52c6ffd1db13435c871b12b8c8c4a8756d43f567f07f68c3915c079517fefa1fda175f6c73a2b544a5e7931ad215cdb4c25c002019e236af7b02b682c680a

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
merge-commit duplicate discount
Lower-prioritychangelog: mention dropped NULL requirement for silentpayments key arraysby Sebastian Falbesoner · ad3688d1 · Sep 7, 2026 · 1 fileMessage 50 · ThinTriage 0Details
Commit message · Sebastian Falbesoner

changelog: mention dropped NULL requirement for silentpayments key arrays

50/100 · ThinMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component! No meaningful explanatory body
Why it was queued
documentation-only discount
Lower-prioritytests: silentpayments: cover rejection of invalid plain seckey alongside a valid oneby Bruno Garcia · 05f92899 · Sep 7, 2026 · 1 fileMessage 95 · StrongTriage 0Details
Commit message · Bruno Garcia

tests: silentpayments: cover rejection of invalid plain seckey alongside a valid one

The existing sender tests only pass a single invalid plain seckey, which
parses to a zero scalar and is therefore also rejected by the later
zero-sum check. Add tests with a valid key and an invalid one so that
the early return in the seckey loop itself is exercised. The invalid key
is placed at both the first and the last index, so that skipping the
check for either position would be caught.

95/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
Security candidateMerge bitcoin-core/secp256k1#1928: tests: add coverage for exact-size DER signature serializationby merge-script · aa0af2fa · Sep 7, 2026 · 1 fileMessage 96 · StrongInformational 15Details
Commit message · merge-script

Merge bitcoin-core/secp256k1#1928: tests: add coverage for exact-size DER signature serialization

500ccb60f70550332adf6b6f894ce84659cd6831 tests: add coverage for exact-size DER signature serialization (Bruno Garcia)

Pull request description:

The existing tests only serialize into oversized buffers or one that is far too small, so the boundary case where the output buffer is exactly the required size was untested. Check that this succeeds with identical output, and that one byte less fails while reporting the required size.

Kills the following mutant (https://secp256k1.space/src/ecdsa_impl.h#1141):
```diff
diff --git a/src/ecdsa_impl.h b/src/ecdsa_impl.h
index 5963877..499fe03 100644
--- a/src/ecdsa_impl.h
+++ b/src/ecdsa_impl.h
@@ -176,7 +176,7 @@ static int secp256k1_ecdsa_sig_serialize(unsigned char *sig, size_t *size, const
secp256k1_scalar_get_b32(&s[1], as);
while (lenR > 1 && rp[0] == 0 && rp[1] < 0x80) { lenR--; rp++; }
while (lenS > 1 && sp[0] == 0 && sp[1] < 0x80) { lenS--; sp++; }
- if (*size < 6+lenS+lenR) {
+ if (*size <= 6+lenS+lenR) {
*size = 6 + lenS + lenR;
return 0;
}
```

ACKs for top commit:
real-or-random:
utACK 500ccb60f70550332adf6b6f894ce84659cd6831
theStack:
ACK 500ccb60f70550332adf6b6f894ce84659cd6831

Tree-SHA512: 8ac002a9e67729f5cb09a9ba8244e926e81898abb273ae4f43a13ccf981322e434caee06d27dcae9b840e0b850908c2281399d48a444319bcc11a0af82bb52a3

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
signing boundarymerge-commit duplicate discount
AI analysis · Informational 15/100

This commit only adds new test code to check that a specific function behaves correctly when given a buffer of exactly the right size. It does not change any production code, fix a bug, or introduce a vulnerability. It is a routine improvement to the test suite.

Lower-prioritysilentpayments: drop "empty key arrays must be NULL" requirementby Sebastian Falbesoner · 89e3a706 · Sep 7, 2026 · 2 filesMessage 73 · AdequateTriage 0Details
Commit message · Sebastian Falbesoner

silentpayments: drop "empty key arrays must be NULL" requirement

Enforcing this doesn't have much value and is in the end just making
things slightly more inconvenient for the API user, forcing them to use
conditional constructs like `keys_size == 0 ? NULL : keys_ptrs` for the
call-sites, so removing it seems reasonable.

73/100 · AdequateMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
Security candidatetests: add coverage for exact-size DER signature serializationby Bruno Garcia · 500ccb60 · Sep 3, 2026 · 1 fileMessage 88 · StrongInformational 13Details
Commit message · Bruno Garcia

tests: add coverage for exact-size DER signature serialization

The existing tests only serialize into oversized buffers or one that is
far too small, so the boundary case where the output buffer is exactly
the required size was untested. Check that this succeeds with identical
output, and that one byte less fails while reporting the required size.

88/100 · StrongMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Mentions testing or verification✓ Names security-relevant behavior explicitly
Why it was queued
signing boundary
AI analysis · Informational 13/100

This commit only adds a new test case. It checks that a DER signature can be written into a buffer that is exactly the right size, and that writing into a buffer one byte too small fails correctly. There is no change to the actual library code that handles signatures, so this does not fix or introduce a security issue by itself.

Security candidateMerge bitcoin-core/secp256k1#1924: tests: add coverage for the DER long form length encodingby merge-script · a9a61831 · Aug 30, 2026 · 1 fileMessage 96 · StrongInformational 19Details
Commit message · merge-script

Merge bitcoin-core/secp256k1#1924: tests: add coverage for the DER long form length encoding

ddb1dfa77038442dff86ba90e6d0a30adfddef17 tests: add coverage for the DER long form length encoding (Bruno Garcia)

Pull request description:

random_ber_signature only emits long form lengths in signatures it marks as certainly_not_der, so run_ecdsa_der_parse asserts that such inputs are rejected but never that a well-formed long form length is accepted. As a result, inverting any of the four conditions in secp256k1_der_read_len that govern the long form goes unnoticed by the test suite.

Add the accepting cases, together with the two rejecting ones that share their boundaries: a length below 128, which must use the short form, and length octets with a leading zero. Since DER permits the long form only for lengths of at least 128, which a signature with two in-range scalars never reaches, the R integers in the accepting cases necessarily overflow to zero; the test checks the parsed values so this stays pinned down.

I noticed this lack in the tests while working on mutation testing for the ecdsa impl. So these tests kill the following mutants: https://secp256k1.space/src/ecdsa_impl.h#863, https://secp256k1.space/src/ecdsa_impl.h#878 and https://secp256k1.space/src/ecdsa_impl.h#896

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

Tree-SHA512: 281460890a96f3beaa294e3a14dc447316cc698f36f9087b36ae8e2bbaa422152588f083c4b293cad7fe4b84497a24fde55d04977e8f306f35fd51353f41cc28

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
signing boundarymemory safetymerge-commit duplicate discount
AI analysis · Informational 19/100

This commit only adds new test cases to the libsecp256k1 test suite. It does not change any production cryptographic code. The new tests check that the DER signature parser correctly handles an unusual but valid length-encoding format (the 'long form'), and that it rejects certain invalid variants. It is a hardening of test coverage, not a fix for a known bug or vulnerability.

Security candidatetests: add coverage for the DER long form length encodingby Bruno Garcia · ddb1dfa7 · Aug 26, 2026 · 1 fileMessage 88 · StrongInformational 15Details
Commit message · Bruno Garcia

tests: add coverage for the DER long form length encoding

random_ber_signature only emits long form lengths in signatures it marks
as certainly_not_der, so run_ecdsa_der_parse asserts that such inputs are
rejected but never that a well-formed long form length is accepted. As a
result, inverting any of the four conditions in secp256k1_der_read_len
that govern the long form goes unnoticed by the test suite.

Add the accepting cases, together with the two rejecting ones that share
their boundaries: a length below 128, which must use the short form, and
length octets with a leading zero. Since DER permits the long form only
for lengths of at least 128, which a signature with two in-range scalars
never reaches, the R integers in the accepting cases are longer than 32
bytes and are therefore parsed as zero; the test checks the parsed values
so this stays pinned down.

88/100 · StrongMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Mentions testing or verification✓ Names security-relevant behavior explicitly
Why it was queued
signing boundary
AI analysis · Informational 15/100

This commit only adds new test cases to the project's test suite. It does not change any production parsing code. The tests verify that the existing DER signature parser correctly accepts valid long-form length encodings and rejects invalid ones. There is no security vulnerability being fixed here.

Lower-priorityMerge bitcoin-core/secp256k1#1922: field: Check that argument of _fe_set_int() is a constantby merge-script · 1c8babcd · Aug 25, 2026 · 5 filesMessage 81 · StrongTriage 0Details
Commit message · merge-script

Merge bitcoin-core/secp256k1#1922: field: Check that argument of _fe_set_int() is a constant

f6d821db032d494daf3bcfe56c0b3e711c06973f field: Fix typo in comment (Tim Ruffing)
1ce0066e6035df1e590178b21e38107115d5f971 field: Check that argument of _fe_set_int() is a constant (Tim Ruffing)

Pull request description:

Solves part of https://github.com/bitcoin-core/secp256k1/issues/1001. Overlooked in https://github.com/bitcoin-core/secp256k1/pull/1345.

ACKs for top commit:
theStack:
ACK f6d821db032d494daf3bcfe56c0b3e711c06973f

Tree-SHA512: dc1b3fe44e1089c5157a550cbcb695e2d7b60a94cde6fa46eed8efd31779f890d996d2b45319a5b12384dd4a47f4ad92854393c3861ec51fd0e5d81dc82a7ec4

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
Security candidateMerge bitcoin-core/secp256k1#1908: refactor: replace `_get_hash_context` with direct `->hash_ctx` accessby merge-script · bae6b89a · Aug 24, 2026 · 16 filesMessage 96 · StrongInformational 15Details
Commit message · merge-script

Merge bitcoin-core/secp256k1#1908: refactor: replace `_get_hash_context` with direct `->hash_ctx` access

c8745f6b3ad88a8e2b0ee2953ed3cc099dc9e15c refactor: replace `_get_hash_context` with direct `->hash_ctx` access (Sebastian Falbesoner)

Pull request description:

See issue #1835: https://github.com/bitcoin-core/secp256k1/issues/1835#issue-4046371933.

ACKs for top commit:
apoelstra:
ACK c8745f6b3ad88a8e2b0ee2953ed3cc099dc9e15c; successfully ran local tests
real-or-random:
utACK c8745f6b3ad88a8e2b0ee2953ed3cc099dc9e15c

Tree-SHA512: 521189c776bae669e43bb5e6ebe6a80668c484701d94320c83403ed30babb08962d61a0d674921481daa68b308ac82bf3fe7f460a15f6451b0be16ab5486dad7

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
cryptography-sensitive pathmerge-commit duplicate discount
AI analysis · Informational 15/100

This commit is a straightforward code cleanup: it removes a small internal helper function named secp256k1_get_hash_context() and replaces every call with direct access to the context's hash_ctx field. The behavior is identical; no security bug is fixed or introduced.

Lower-priorityMerge bitcoin-core/secp256k1#1878: field: correct `_fe_half` docs (output is not normalized, input requires magnitude <= 31)by merge-script · 3397f3cb · Aug 21, 2026 · 1 fileMessage 86 · StrongTriage 0Details
Commit message · merge-script

Merge bitcoin-core/secp256k1#1878: field: correct `_fe_half` docs (output is not normalized, input requires magnitude <= 31)

56e031a14828a3b0e9a0b3d3626ca48e76716d98 field: correct `_fe_half` docs (output is not normalized, input requires magnitude <= 31) (Sebastian Falbesoner)

Pull request description:

After reviewing #1877, I took a look at the other field module function docs w.r.t. their normalized/magnitude promises and found this mismatch: the `secp256k1_fe_half` docs state the output is normalized, but the impl sets r->normalized = 0 (it only halves the limbs, without a reduction):

https://github.com/bitcoin-core/secp256k1/blob/bd0287d650c24dc41e0362675a9f6a49ee952def/src/field_impl.h#L448-L450

This is a minimum-diff fix to match the implementation, with a similar "On output" structure as used for `_fe_add`:
https://github.com/bitcoin-core/secp256k1/blob/bd0287d650c24dc41e0362675a9f6a49ee952def/src/field.h#L246

ACKs for top commit:
real-or-random:
ACK 56e031a14828a3b0e9a0b3d3626ca48e76716d98

Tree-SHA512: 4d045fd87d20b2a668269a4ad17213e1163093c46d77191b09b7d9e15b7d81dfc0bec25928974bf6fbf8967422060749103d95892517ec4f223b917fd7bd7aa3

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
merge-commit duplicate discount
Security candidateMerge bitcoin-core/secp256k1#1915: refactor: Move (de)ser helpers from musig and eckey to groupby merge-script · 86c7cbaf · Aug 19, 2026 · 10 filesMessage 98 · StrongInformational 15Details
Commit message · merge-script

Merge bitcoin-core/secp256k1#1915: refactor: Move (de)ser helpers from musig and eckey to group

bfd40bd0ce0e7cac4f6bb395ccfe90eaf625feb1 refactor: Rename privkey to seckey in eckey helpers (Fabian Jahr)
d8ee6e6cf6706c00562a584715cb2b8c41df7cb2 refactor: Move parsing helpers from musig to group (Fabian Jahr)
2577fb1888c021752dc6edbfa6df3216daa9ccb1 refactor: Move pubkey parsing and serialization from eckey to group (Fabian Jahr)

Pull request description:

These two helpers, `secp256k1_musig_ge_serialize_ext` and `secp256k1_musig_ge_parse_ext`, aren't really musig-specific. They (de)serialize a group element that can also be the point at infinity. This moves them to `eckey` as `secp256k1_eckey_serialize_ext` and `secp256k1_eckey_parse_ext`. They can't move further down to group.h because they depend on other `eckey` functions internally. There should be no functional change here.

I stumbled upon this while working on #1754 where I would want to reuse these helpers in that module, so it is split out of that. But the change seems to make sense on its own as well, so I wouldn't consider this prep work alone.

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

Tree-SHA512: 9e6445e480495baaf14b6d435a513d465116ae517b47b3f76c317e6aa70e9f1bcc0ce3f92498e008d5aa38d8fbeebe4fdf69a0bf90b05da9da084242b9170b01

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
cryptography-sensitive pathmerge-commit duplicate discount
AI analysis · Informational 15/100

This is a routine internal code cleanup: it moves helper functions that convert between group elements and byte strings from one internal file to another, and renames a couple of private-key tweak helpers from 'privkey' to 'seckey'. The public behavior of the library is unchanged, and the commit message explicitly states there should be no functional change.

Security candidaterefactor: Rename privkey to seckey in eckey helpersby Fabian Jahr · bfd40bd0 · Aug 17, 2026 · 3 filesMessage 62 · AdequateInformational 15Details
Commit message · Fabian Jahr

refactor: Rename privkey to seckey in eckey helpers

62/100 · AdequateMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Uses a recognizable type or scope! No meaningful explanatory body
Why it was queued
cryptography-sensitive path
AI analysis · Informational 15/100

This commit is a simple renaming of internal function names from 'privkey' to 'seckey' to match current project terminology. No behavior of the code changes, and there is no security fix or vulnerability introduced.

Security candidateMerge bitcoin-core/secp256k1#1916: ecdh/ellswift: simplify seckey loading with `_scalar_set_b32_seckey`by merge-script · a37d7cc0 · Aug 17, 2026 · 2 filesMessage 98 · StrongInformational 18Details
Commit message · merge-script

Merge bitcoin-core/secp256k1#1916: ecdh/ellswift: simplify seckey loading with `_scalar_set_b32_seckey`

c00dc8181054fb31a0149ce03ef8413300a3a8bf ecdh/ellswift: simplify seckey loading with `_scalar_set_b32_seckey` (Sebastian Falbesoner)

Pull request description:

Instead of checking for overflow and zero manually, use the existing `_scalar_set_b32_seckey` helper which does both and returns zero if either of these two conditions apply. This can be seen as a very late follow-up to PR #701, commit 3fec9826086aa45ebbac1ff6fc3bb7b25ca78b1d, where the helper has been introduced and applied to the functions `_ecdsa_sign`, `_pubkey_create` and `_seckey_verify`. The variable name `is_sec_valid` has been chosen as it is currently also used in [`secp256k1_ecdsa_sign_inner`](https://github.com/bitcoin-core/secp256k1/blob/439278a649d3099d62dde966a76dc04aaca7ccb3/src/secp256k1.c#L555).

Note that introducing parantheses around `!!ret` was necessary to avoid warnings in the following form:
```
/home/thestack/secp256k1_master/src/modules/ecdh/main_impl.h: In function ‘secp256k1_ecdh’:
/home/thestack/secp256k1_master/src/modules/ecdh/main_impl.h:74:12: warning: suggest parentheses around operand of ‘!’ or change ‘&’ to ‘&&’ or ‘
!’ to ‘~’ [-Wparentheses]
74 | return !!ret & is_sec_valid;
| ^~~~~
```

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

Tree-SHA512: fc28140b09b0d8143b05a21f83b9d24f424384823ca26b8b3fbe103156b2bd2d8d7df76468002d794c43a73d4d7c0532420e2396f2b604a7e65d467baba51600

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
memory safetymerge-commit duplicate discount
AI analysis · Informational 18/100

This is a small internal cleanup in Bitcoin Core's secp256k1 cryptography library. It replaces a manual secret-key validity check (overflow plus zero) with an existing helper function that does the same thing. The behavior is intended to be identical; no security vulnerability is described or visible in the code change.