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
27commits · 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 3 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.

Security candidatesilentpayments: sendingby josibake · b30ea3eb · Jul 14, 2026 · 4 filesMessage 41 · ThinInformational 15Details
Commit message · josibake

silentpayments: sending

Add a routine for the entire sending flow which takes a set of private keys,
the smallest outpoint, and list of recipients and returns a list of
x-only public keys by performing the following steps:

1. Sum up the private keys
2. Calculate the input_hash
3. For each recipient group:
3a. Calculate a shared secret
3b. Create the requested number of outputs

This function assumes a single sender context in that it requires the
sender to have access to all of the private keys. In the future, this
API may be expanded to allow for a multiple senders or for a single
sender who does not have access to all private keys at any given time,
but for now these modes are considered out of scope / unsafe.

Internal to the library, add:

1. A function for creating shared secrets (i.e., a*B or b*A)
2. A function for generating the "SharedSecret" tagged hash
3. A function for creating a single output public key

Co-authored-by: w0xlt <94266259+w0xlt@users.noreply.github.com>

41/100 · ThinMessage clarity
✓ Subject identifies a change✓ Provides detailed explanatory context! Too few words to establish purpose
Why it was queued
secret or key materialcryptography-sensitive path
AI analysis · Informational 15/100

This commit adds a new feature to the secp256k1 cryptographic library: the sender-side logic for Bitcoin Silent Payments (BIP352). It lets a wallet create special one-time payment addresses for recipients without revealing which recipient is being paid on the blockchain. The change is a normal, well-documented feature addition with no indication of a security bug or vulnerability fix.

Security candidatesilentpayments: respect per-group recipients protocol limit (K_max=2323)by Sebastian Falbesoner · 1c1b2753 · Jul 14, 2026 · 3 filesMessage 73 · AdequateLow 38Details
Commit message · Sebastian Falbesoner

silentpayments: respect per-group recipients protocol limit (K_max=2323)

This affects both the sending and scanning API functions:
* Sending fails if any group is exceeding the limit.
* Scanning doesn't look beyond the limit.

Also add a recommendation to the API docs to shuffle the
`tx_outputs` input array, which improves the worst-case by ~2x.

Co-authored-by: nymius <155548262+nymius@users.noreply.github.com>

73/100 · AdequateMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
Why it was queued
cryptography-sensitive path
AI analysis · Low 38/100

This commit fixes the libsecp256k1 Silent Payments implementation so it respects the protocol-defined maximum of 2,323 recipients that share the same scan public key. Previously, the code had a TODO warning about unbounded scanning that could lead to quadratic runtime and possible missed outputs. Now, sending fails if any group exceeds the limit, and scanning stops at the limit. It also documents a recommendation to shuffle transaction outputs to improve worst-case performance.

Lower-prioritysilentpayments: add examples/silentpayments.cby josibake · f0fdd99d · Jul 14, 2026 · 4 filesMessage 60 · AdequateInformational 15Details
Commit message · josibake

silentpayments: add examples/silentpayments.c

Demonstrate sending and scanning on full nodes.

60/100 · AdequateMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Provides an explanatory body
AI analysis · Informational 15/100

This commit adds a new example file (examples/silentpayments.c) showing how to use the Silent Payments feature in libsecp256k1. It is purely documentation and demonstration code, not a change to the cryptographic library itself. There is no indication of a security bug or vulnerability fix.

Lower-priorityfield: serialize elements by wordby Lőrinc · e217ead5 · Jul 13, 2026 · 2 filesMessage 78 · AdequateInformational 15Details
Commit message · Lőrinc

field: serialize elements by word

The byte assignments replaced nested nibble loops before the endian write helpers existed.
Pack the 5x52 limbs into four 64-bit words and the 10x26 limbs into eight 32-bit words, then use those helpers.
This matches the scalar serializers and keeps the output unchanged.
Benchmarks indicate no measurable performance regression.

78/100 · AdequateMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Mentions testing or verification
AI analysis · Informational 15/100

This commit is a clean-up rewrite of how internal numeric values are converted into 32-byte output inside the secp256k1 cryptography library. It replaces many byte-by-byte shift-and-mask operations with a smaller number of whole-word writes using existing helper functions. The commit message explicitly states the output is unchanged, and the diff shows a direct mechanical refactoring with no change to inputs, preconditions, or callers.

Lower-prioritySECURITY.md: Align the tableby Tim Ruffing · d5c64baf · Jul 9, 2026 · 1 fileMessage 50 · ThinInformational 15Details
Commit message · Tim Ruffing

SECURITY.md: Align the table

50/100 · ThinMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Names security-relevant behavior explicitly! No meaningful explanatory body
Why it was queued
documentation-only discount
AI analysis · Informational 15/100

This commit is purely cosmetic: it adjusts the spacing in a markdown table inside the SECURITY.md file so the columns line up visually. No code, keys, fingerprints, instructions, or security policy content were changed.

Lower-prioritySECURITY.md: Add theStack's keyby Tim Ruffing · 9bd50f0c · Jul 9, 2026 · 1 fileMessage 50 · ThinInformational 15Details
Commit message · Tim Ruffing

SECURITY.md: Add theStack's key

50/100 · ThinMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Names security-relevant behavior explicitly! No meaningful explanatory body
Why it was queued
documentation-only discount
AI analysis · Informational 15/100

This commit simply adds a new person's PGP key to the project's SECURITY.md file. It is an administrative documentation change with no code modifications and no security vulnerability.

Lower-prioritySECURITY.md: remove Jonas Nick from trusted keysby Jonas Nick · 21645c03 · Jun 29, 2026 · 2 filesMessage 50 · ThinInformational 18Details
Commit message · Jonas Nick

SECURITY.md: remove Jonas Nick from trusted keys

50/100 · ThinMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Names security-relevant behavior explicitly! No meaningful explanatory body
Why it was queued
documentation-only discount
AI analysis · Informational 18/100

This commit updates documentation to remove one person's cryptographic key from the project's list of trusted security contacts, and updates the README's example release tag and signature to reflect a newer release signed by a different trusted developer. It is a policy/documentation change, not a code fix for a software vulnerability.

Lower-priorityscalar: correct `_scalar_get_bits_{limb32,var}` input condition docsby Sebastian Falbesoner · 6a599a44 · Jun 26, 2026 · 1 fileMessage 50 · ThinInformational 15Details
Commit message · Sebastian Falbesoner

scalar: correct `_scalar_get_bits_{limb32,var}` input condition docs

50/100 · ThinMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component! No meaningful explanatory body
AI analysis · Informational 15/100

This commit only fixes two mistakes in the documentation comments above two internal helper functions. It changes the stated allowed ranges for the number of bits that can be read and the allowed sum of offset plus count. No actual code logic is modified, so there is no security-relevant behavior change in the program itself.

Lower-priorityfield: correct fe_equal's b magnitude boundby Lőrinc · 994b3501 · Jun 25, 2026 · 3 filesMessage 83 · StrongLow 27Details
Commit message · Lőrinc

field: correct fe_equal's b magnitude bound

`secp256k1_fe_equal` negates `a` before adding `b`.
That gives the temporary value magnitude 2, and the following field addition requires the input magnitudes to sum to at most 32.
So the largest `b` magnitude the implementation can accept is 30, not 31.

Lower the documented and checked bound for `b` to 30.
Adjust the focused test to use random field elements with randomized magnitudes within the accepted `a <= 1` and `b <= 30` bounds.

Co-authored-by: Sebastian Falbesoner <sebastian.falbesoner@gmail.com>
Co-authored-by: Tim Ruffing <me@real-or-random.org>

83/100 · StrongMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Mentions testing or verification✓ Names security-relevant behavior explicitly
AI analysis · Low 27/100

This commit fixes an off-by-one error in the documented and runtime-checked input limit for a low-level math helper called secp256k1_fe_equal. The function compares two finite-field values for equality. It first negates one input (which temporarily raises its internal 'magnitude' by 1) and then adds the other input. Because the addition can only safely accept inputs whose magnitudes sum to 32, the second input's magnitude must be at most 30, not 31. The previous bound of 31 was therefore one too high and could have allowed an internal overflow in the magnitude bookkeeping. The patch lowers the documented bound and the VERIFY_MAGNITUDE check from 31 to 30, and adds a focused test exercising the corrected boundary. This is a correctness/reliability fix in cryptographic arithmetic, not a directly exploitable remote vulnerability.

Lower-prioritytests: Fix GCC 17 snapshot warningby Tim Ruffing · 9d75769d · Jun 25, 2026 · 1 fileMessage 78 · AdequateInformational 17Details
Commit message · Tim Ruffing

tests: Fix GCC 17 snapshot warning

Passing a non-malloc pointer to free() would be UB. In this case, the
free() line is never actually reached (and GCC 17 fails to prove this)
in a correct implementation of secp256k1_scratch_space_destroy(), but
the test shouldn't rely on the correctness of the tested function.

78/100 · AdequateMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Mentions testing or verification
AI analysis · Informational 17/100

This is a test-only cleanup. The commit removes a unit test pattern that passed a stack-allocated (non-malloc) scratch-space object to a destroy function that could call free(), which is undefined behavior. The test logic is reimplemented using a heap-allocated object instead. It does not change the production library code that Bitcoin or other applications use.

Lower-priorityci: add 'brew trust' invocation to macOS CIby fanquake · 66260b78 · Jun 25, 2026 · 1 fileMessage 80 · StrongInformational 15Details
Commit message · fanquake

ci: add 'brew trust' invocation to macOS CI

Should fix issues like:

> Error: Refusing to load formula louisbrunner/valgrind/valgrind from untrusted tap louisbrunner/valgrind.
> Run `brew trust --formula louisbrunner/valgrind/valgrind` or `brew trust louisbrunner/valgrind` to trust it.
> Error: Process completed with exit code 1.

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
AI analysis · Informational 15/100

This commit is a routine fix to the project's automated macOS testing setup. Homebrew (a package manager for macOS) recently started refusing to load formulas from third-party sources unless explicitly trusted. The change simply tells Homebrew to trust the third-party tap that provides the Valgrind testing tool, so CI builds can continue. It does not change any cryptographic code, wallet handling, or network behavior in Bitcoin Core or libsecp256k1.

Security candidateinclude: Remove SECP256K1_GNUC_PREREQ macroby copilot-swe-agent[bot] · dba4d937 · Jun 17, 2026 · 1 fileMessage 63 · AdequateInformational 16Details
Commit message · copilot-swe-agent[bot]

include: Remove SECP256K1_GNUC_PREREQ macro

The macro is no longer used anywhere in the codebase. This is
technically a breaking change, but it's not expected any user code
actually uses this macro.

Co-authored-by: Tim Ruffing <me@real-or-random.org>

63/100 · AdequateMessage clarity
✓ Descriptive subject✓ Provides detailed explanatory context✓ Names security-relevant behavior explicitly
Why it was queued
cryptography-sensitive path
AI analysis · Informational 16/100

This commit removes an unused internal compiler-version-checking helper macro from the public header file. It is a cleanup change with no security implications. The commit message notes it is technically a breaking change for any external code that might have relied on this macro, but the authors do not expect such usage.

Security candidateUse __GNUC__ instead of SECP256K1_GNUC_PREREQby copilot-swe-agent[bot] · 09870e9c · Jun 17, 2026 · 2 filesMessage 85 · StrongInformational 15Details
Commit message · copilot-swe-agent[bot]

Use __GNUC__ instead of SECP256K1_GNUC_PREREQ

Replace all SECP256K1_GNUC_PREREQ version checks with plain
defined(__GNUC__) checks, since the macro was only used for ancient GCC
versions that are no longer worth supporting individually. Moreover, the
macro was misleading because Clang claims to be GCC 4.2 by default.

All GCC versions that we reasonably support have the features previously
gated behind these checks (__inline__, __builtin_expect, __restrict__,
__warn_unused_result__, __nonnull__, and the __builtin_ctz* family).

Co-authored-by: Tim Ruffing <me@real-or-random.org>

85/100 · StrongMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Explains rationale or failure mode✓ Names security-relevant behavior explicitly
Why it was queued
cryptography-sensitive path
AI analysis · Informational 15/100

This commit is a routine cleanup of compiler feature checks in the secp256k1 cryptographic library. It replaces a custom version-check macro with a simpler check for whether the compiler is GCC (or claims to be GCC, like Clang). The change does not fix a security bug and does not introduce a clear vulnerability; it removes support for very old GCC versions that are no longer targeted.

Lower-priorityhash: Include secp256k1.h directlyby copilot-swe-agent[bot] · ae075d7c · Jun 17, 2026 · 2 filesMessage 73 · AdequateInformational 15Details
Commit message · copilot-swe-agent[bot]

hash: Include secp256k1.h directly

Move the #include "../include/secp256k1.h" from src/util.h to
src/hash.h, which is the file that actually depends on the
secp256k1_sha256_compression_function type defined there.

Co-authored-by: Tim Ruffing <me@real-or-random.org>

73/100 · AdequateMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Names security-relevant behavior explicitly
AI analysis · Informational 15/100

This commit is a simple code cleanup: it moves an #include directive from one internal file to another so that each file only imports what it actually uses. There is no functional change, no bug fix, and no security relevance.

Lower-priorityfield: force-inline 5x52 mul and sqrby Lőrinc · 71fcd841 · Jun 15, 2026 · 4 filesMessage 78 · AdequateInformational 13Details
Commit message · Lőrinc

field: force-inline 5x52 mul and sqr

The 5x52 field multiplication and squaring routines are hot in group arithmetic and scalar multiplication.

Use the new `SECP256K1_FORCE_INLINE` for the thin wrappers and `int128` inner helpers so compilers can schedule the 64x64->128 arithmetic without a call boundary.

Across the measured GCC and MSVC Release builds, this improves ECDSA verification by 0.6% to 9.1%, ECDH by 0.7% to 9.3%, and Schnorr verification by 0.6% to 9.6%.

The direct field benchmarks generally show the intended effect on field squaring and multiplication, while Clang results are mostly flat and less consistently positive.

This is a code-size tradeoff: the tested static library builds grew by about 4.6% to 4.7%, and the tested Windows Release DLL grew by 14.1%.

Co-authored-by: Sebastian Falbesoner <sebastian.falbesoner@gmail.com>
Co-authored-by: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com>
Co-authored-by: Tim Ruffing <crypto@timruffing.de>

78/100 · AdequateMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Mentions testing or verification
Why it was queued
defensive validation
AI analysis · Informational 13/100

This commit is a performance optimization for Bitcoin's secp256k1 cryptographic library. It tells the compiler to always inline (embed directly into calling code) certain low-level multiplication and squaring routines used heavily in elliptic-curve operations. The stated goal is faster signature verification and key agreement, at the cost of slightly larger compiled binaries. There is no security fix or vulnerability indicated in the commit itself.

Lower-prioritytest: enable -Wunused-function in test suite (Fix #1831)by kallal79 · a77dacad · Jun 12, 2026 · 4 filesMessage 80 · StrongInformational 15Details
Commit message · kallal79

test: enable -Wunused-function in test suite (Fix #1831)

80/100 · StrongMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Uses a recognizable type or scope✓ Mentions testing or verification✓ Links an issue, advisory, or supporting reference! No meaningful explanatory body
AI analysis · Informational 15/100

This commit only changes compiler warning settings inside the project's test code. It turns on a warning for unused functions so the test suite catches dead code. It does not change any actual security logic, cryptography, or runtime behavior of the library.

Lower-prioritytest: add unit test for `_ecmult_gen_ge`by Sebastian Falbesoner · 2ee79e77 · Jun 11, 2026 · 1 fileMessage 67 · AdequateInformational 15Details
Commit message · Sebastian Falbesoner

test: add unit test for `_ecmult_gen_ge`

67/100 · AdequateMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Uses a recognizable type or scope✓ Mentions testing or verification! No meaningful explanatory body
AI analysis · Informational 15/100

This commit adds a new unit test to verify that two internal math functions in the secp256k1 library produce matching results. It does not change any production code, cryptographic logic, or fix a bug. It is purely a test addition.

Lower-prioritytest: musig: fix dead "aggnonce encodes two points at infinity" checkby Sebastian Falbesoner · d7125e51 · Jun 9, 2026 · 1 fileMessage 72 · AdequateInformational 15Details
Commit message · Sebastian Falbesoner

test: musig: fix dead "aggnonce encodes two points at infinity" check

72/100 · AdequateMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Uses a recognizable type or scope✓ Mentions testing or verification! No meaningful explanatory body
AI analysis · Informational 15/100

This is a one-line fix in a test file. The original code called a function that checks whether a point is infinity but threw away the result, so the check did nothing. The fix wraps it in a CHECK() macro so the test actually verifies the result. It does not change any production code and has no security impact on real users.

Lower-prioritycmake: Fix shared library versioning on OpenBSDby Hennadii Stepanov · 1eab7572 · Jun 9, 2026 · 1 fileMessage 45 · ThinInformational 19Details
Commit message · Hennadii Stepanov

cmake: Fix shared library versioning on OpenBSD

45/100 · ThinMessage clarity
✓ Descriptive subject✓ Names a concrete action or component! No meaningful explanatory body
AI analysis · Informational 19/100

This commit fixes how the shared library version number is set when building on OpenBSD. It adds an OpenBSD-specific branch in the CMake build logic so the library gets a proper version suffix. There is no direct security vulnerability here; it is a portability/build correctness fix. A wrong version could theoretically cause runtime linker confusion or load an unintended library, but the commit itself is defensive and small.

Lower-prioritycmake: Fix shared library versioning on NetBSDby Hennadii Stepanov · a401c514 · Jun 9, 2026 · 1 fileMessage 45 · ThinInformational 16Details
Commit message · Hennadii Stepanov

cmake: Fix shared library versioning on NetBSD

45/100 · ThinMessage clarity
✓ Descriptive subject✓ Names a concrete action or component! No meaningful explanatory body
AI analysis · Informational 16/100

This commit fixes how version numbers are assigned to the shared library when building on NetBSD. It is a build-system portability fix with no apparent security relevance.

Lower-prioritycmake, refactor: Improve documenting in `SetLibtoolAbiVersion` moduleby Hennadii Stepanov · 8a0f4002 · Jun 9, 2026 · 1 fileMessage 50 · ThinInformational 15Details
Commit message · Hennadii Stepanov

cmake, refactor: Improve documenting in `SetLibtoolAbiVersion` module

50/100 · ThinMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component! No meaningful explanatory body
AI analysis · Informational 15/100

This commit only improves comments and documentation inside a CMake build script. It does not change any actual build behavior or code that runs in the library. There is no security issue here.

Lower-prioritycmake, refactor: Introduce `SetLibtoolAbiVersion` moduleby Hennadii Stepanov · acf2084a · Jun 9, 2026 · 2 filesMessage 50 · ThinInformational 15Details
Commit message · Hennadii Stepanov

cmake, refactor: Introduce `SetLibtoolAbiVersion` module

50/100 · ThinMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component! No meaningful explanatory body
AI analysis · Informational 15/100

This commit is a straightforward cleanup of the build system. It moves existing logic for setting shared-library version numbers into a reusable CMake helper module, without changing the actual version-numbering behavior. There is no security-relevant change.

Lower-prioritytest: refactor: simplify tests by using `_ecmult_gen_ge` helperby Sebastian Falbesoner · ca68daf8 · Jun 8, 2026 · 2 filesMessage 100 · StrongInformational 15Details
Commit message · Sebastian Falbesoner

test: refactor: simplify tests by using `_ecmult_gen_ge` helper

If the generator point multiplication result in Jacobian coordinates is
immediately converted to affine coordinates after and is not needed for
anything else, we can deduplicate by using the helper introduced in #1861.

Note that in a very strict sense this is not a refactor, as the Jacobian
object is now cleared out which was not done on master, but for the logic
in the tests this shouldn't matter at all.

100/100 · StrongMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Uses a recognizable type or scope✓ Provides detailed explanatory context✓ Mentions testing or verification✓ Links an issue, advisory, or supporting reference
AI analysis · Informational 15/100

This commit is a minor cleanup in the project's internal test code. It replaces a two-step pattern (compute a point in one coordinate format, then convert it to another) with a single helper function that does the same thing. The author explicitly calls it a refactor and notes the only behavioral difference is that an intermediate variable is now cleared, which has no effect on test logic. There is no indication this changes any production cryptography or introduces a security issue.

Security candidaterefactor: introduce `_ecmult_gen_ge` helper (preventing accidental gej leaks)by Sebastian Falbesoner · a3296d5e · Jun 7, 2026 · 5 filesMessage 100 · StrongLow 36Details
Commit message · Sebastian Falbesoner

refactor: introduce `_ecmult_gen_ge` helper (preventing accidental gej leaks)

Scalar multiplication with the generator point 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 steps:
- secp256k1_ecmult_gen(ctx, &rj, ...)
- secp256k1_ge_set_gej(&r, &rj)
- secp256k1_gej_clear(&rj)

This commit introduces a corresponding helper to deduplicate code
and mitigate the risk that last step is forgotten (which can easily
happen and is not detected by tests).

The idea came up during a conversation with furszy, see
https://github.com/bitcoin-core/secp256k1/pull/1765#issuecomment-4482838033

100/100 · StrongMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Uses a recognizable type or scope✓ 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 materialcryptography-sensitive path
AI analysis · Low 36/100

This is a defensive code cleanup in a Bitcoin cryptography library. It introduces a helper function that wraps a common three-step pattern when multiplying by the generator point, ensuring that temporary sensitive Jacobian coordinate data is always wiped from memory. The change reduces the chance that a future developer forgets to clear that temporary data, which could theoretically leak tiny fragments of secret key information through memory side channels. It does not fix a known active bug or reported vulnerability.

Lower-priorityrefactor: rename `_ecmult_gen` -> `_ecmult_gen_gej` for consistencyby Sebastian Falbesoner · 9e017e50 · Jun 7, 2026 · 6 filesMessage 85 · StrongInformational 15Details
Commit message · Sebastian Falbesoner

refactor: rename `_ecmult_gen` -> `_ecmult_gen_gej` for consistency

Now that we have a function `_ecmult_gen_ge`, it makes sense to rename
the existing function `_ecmult_gen` to `_ecmult_gen_gej` for
consistency, to signal that the result is a Jacobian group element.

This diff was created by applying
```
$ sed -i s/secp256k1_ecmult_gen\(/secp256k1_ecmult_gen_gej\(/g $(git ls-files)
```

85/100 · StrongMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Uses a recognizable type or scope✓ Provides detailed explanatory context
AI analysis · Informational 15/100

This commit is a simple rename of an internal function from `secp256k1_ecmult_gen` to `secp256k1_ecmult_gen_gej` across six files. The change is purely cosmetic and intended to make the function name consistent with a newly added variant. No behavior, logic, or security properties of the code are changed.