Merge bitcoin-core/secp256k1#1963: doc: say the sha256 compression callback processes secrets
What changed, and why it matters
This commit only adds a documentation comment to a public header file. It reminds developers that a special callback function used for SHA256 hashing may receive secret data such as private keys, so any custom implementation must be constant-time and must not leak or store the input. No code behavior was changed.
No action required. This is a documentation-only clarification for developers implementing custom SHA256 compression callbacks.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The change is a three-line addition to include/secp256k1.h documenting the secp256k1_sha256_compression_function callback. It states that the callback processes secrets (e.g., secret keys) and therefore must be constant-time with respect to its input and must not retain or log it. There are no functional modifications to the library.
Changed components
include/secp256k1.h documentationInspect captured patch +3 / −0
### include/secp256k1.h
@@ -418,6 +418,9 @@ typedef void (*secp256k1_sha256_compression_function)(
* The provided callback must exactly implement the effect of n_blocks
* repeated applications of the SHA256 compression function.
*
+ * The callback processes secrets such as secret keys, so it must run in
+ * constant time with respect to its input and must not keep or log it.
+ *
* This API exists to support environments that wish to route the
* SHA256 compression step through a hardware-accelerated or otherwise
* specialized implementation. It is NOT meant for replacing SHA256Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.