Document that the sha256 compression override sees secret keys #1958

issue fametrano opened this issue on October 10, 2026
  1. fametrano commented at 11:16 PM on October 10, 2026: contributor

    secp256k1_context_set_sha256_compression (include/secp256k1.h) does not say that the supplied function hashes secret data. It does: it hashes the secret key, or a value masked with it, when deriving RFC 6979, BIP340 and MuSig nonces, and the seed of the ecmult_gen blinding. A function that is not constant-time, or that logs or keeps its input, therefore breaks the library's constant-time and memory-clearing properties.

    Could the header say that the function processes secret keys and nonces, must run in constant time with respect to its input, and must not keep or log it? I can open the pull request if that wording suits you.

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

  2. real-or-random commented at 6:40 AM on October 12, 2026: contributor

    Could the header say that the function processes secret keys and nonces, must run in constant time with respect to its input, and must not keep or log it? I can open the pull request if that wording suits you.

    Good point, yes. Maybe say "secrets such as secret keys" to keep it general.

  3. real-or-random added the label assurance on Oct 12, 2026
  4. real-or-random added the label user-documentation on Oct 12, 2026
  5. real-or-random added the label side-channel on Oct 12, 2026
  6. real-or-random added the label tweak/refactor on Oct 12, 2026
  7. theStack closed this on Oct 12, 2026


github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin-core/secp256k1. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-10-16 18:15 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me