5 suggestions
Earlier concerns neither republished nor resolved: 1 suggestion. See the Run archive for their assessments.
Optional improvements
[suggestion] · Public context loses the static context's signing misuse check
A future generator-based signing call using this context would run with fixed blinding instead of aborting; no current caller passing the public context to such an operation was found.
Location: src/pubkey.cpp:40 (head).
Details and suggested fix
These public-data operations previously used secp256k1_context_static, whose unbuilt generator context causes secp256k1_ecdsa_sign and similar APIs to hit ARG_CHECK and abort through the default illegal callback. The SHA256 setter requires a proper context, so this getter now creates one with a built generator context and fixed NULL-seed blinding, then leaves it unrandomized. Misrouting a signing call here would therefore succeed without the signing context's randomized blinding. Add a lint or test that rejects the public context as the context argument to generator-multiplication APIs, giving this distinction an automated safeguard without adding randomness to verification.
[suggestion] · Context test does not observe the production SHA256 installation
The test installs its counting callback independently, so removing either production SHA256Transform installation would leave these assertions passing despite losing the optimization.
Location: src/test/key_tests.cpp:425 (head).
Details and suggested fix
secp256k1_context_set_sha256_compression self-tests the newly supplied callback and then overwrites the previous one. Here each count assertion follows installation of CountingSHA256Transform, while the earlier Schnorr assertion can also succeed with libsecp's built-in SHA256. The final setters would then install SHA256Transform for subsequent tests. These assertions establish ECDSA signing and Schnorr verification routing, not the production callback installation. Reword the comment accordingly. If installation coverage is intended too, supply a counting callback through a shared context-construction helper rather than reinstalling it on an existing context.
[suggestion] · DER-lax fuzz target retains unnecessary RNG setup
Removing the per-input ECC_Context removed this fuzz target's only global-PRNG consumer, leaving its seed call and associated includes unnecessary.
Location: src/test/fuzz/secp256k1_ecdsa_signature_parse_der_lax.cpp:29 (base).
Details and suggested fix
The removed ECC_Context construction called ECC_Start(), which consumed GetRandBytes for blinding. The remaining target only consumes fuzz-buffer bytes, parses a signature using the public context, and checks low R by serializing through secp256k1_context_static. None of those operations uses the global PRNG, and common fuzz initialization already creates both contexts before processing inputs. CheckGlobals only requires per-input seeding when that input uses the global PRNG. Remove SeedRandomStateForTest and the test/util/random.h and key.h includes; both signature helpers are declared locally, and parsing and low-R coverage remain unchanged.
[suggestion] · SHA256Transform declaration omits the compression contract
The header describes dispatch but not the raw compression interface libsecp relies on, leaving state, block units and input-alignment requirements undocumented.
Location: src/crypto/sha256.h:53 (head).
Details and suggested fix
SHA256Transform sits next to full-hash APIs, but its comment does not explain that it updates eight existing 32-bit state words in place using n_blocks complete 64-byte blocks. Document that it performs no initialization, length counting or padding and accepts unaligned blocks64 input, while retaining the dispatch note. This is the contract required by secp256k1_sha256_compression_function; libsecp also invokes compression from precomputed tagged-hash midstates. Stating it here makes the cross-library interface clear without requiring readers to consult the libsecp header.
[suggestion] · Benchmark includes span.h without using its helpers
The new benchmark has no direct use of span.h; its key and public-key headers already provide the dependencies needed by their APIs.
Location: src/bench/ecc_sign_verify.cpp:9 (head).
Details and suggested fix
The UCharCast use inside CKey::Set belongs to key.h, which already obtains span.h through pubkey.h. The benchmark's Schnorr calls only need implicit vector-to-std::span conversions for parameter types declared in key.h and pubkey.h, and both headers include <span>. Remove the direct #include <span.h>. The direct <span> include can also go unless IWYU requires it for those implicit conversions.
Earlier concerns
Earlier reports raised these, with the titles and severities shown there. This review neither republished nor resolved them.
- [suggestion]: Signing-context routing lacks regression coverage (earlier report)