doc: drop constant-time guarantee for auxrnd32 in `_ellswift_create` #2009

pull theStack wants to merge 1 commits into bitcoin-core:master from theStack:doc-ellswift-auxrnd_drop_ctime changing 3 files +7 −2
  1. theStack commented at 2:35 PM on November 25, 2026: contributor

    This PR is an alternative to #1969. It takes [option 1 in issue #1962](/bitcoin-core-secp256k1/1962/#issuecomment-6120121713): instead of adding further declassify calls, it drops the constant-time guarantee for auxrnd32 from the API docs of secp256k1_ellswift_create. The ctime test now passes a separate, non-secret buffer as auxrnd32 (previously it passed the output buffer, which is zeroed before auxrnd32 is read).

    In a recent out-of-band conversation between maintainers, this approach was preferred because (to the best of my memory) it is simpler, and there seems to be no good reason for callers to rely on constant-time behavior w.r.t. auxrnd32.

    If we follow this path, the main open question might be what to put in the changelog (do we even want to mention it? if yes, is it a fix or a change? users might be confused why we dropped the guarantee instead of treating auxrnd32 the same as seckey...)

  2. doc: drop constant-time guarantee for auxrnd32 in `_ellswift_create`
    The API docs claim that `secp256k1_ellswift_create` is constant time in
    auxrnd32, but the ctime tests never covered this: they passed the output
    buffer as auxrnd32, which is zeroed before auxrnd32 is read. With
    auxrnd32 marked as secret, the tests fail, as the rejection sampling
    branches on hash outputs that depend on it.
    
    This is not a security issue, since those hash outputs are also keyed
    with seckey32. Upholding the guarantee would only add declassify calls
    (see #1969) without changing the running time. As callers have no reason
    to treat auxrnd32 as a secret, drop the guarantee instead and pass a
    separate, non-secret buffer in the ctime test.
    1bd12cf851
  3. theStack added the label user-documentation on Nov 30, 2026
  4. theStack added the label side-channel on Nov 30, 2026
  5. Yudis-bit commented at 3:37 AM on December 1, 2026: contributor

    secp256k1_ellswift_prng doesn't clear its local hash copy either, so auxrnd32 already stays on the stack when non-NULL.

    For the changelog, keeping it under Changed makes sense to me since Fixed is usually for behavior fixes, and noting the code didn't change avoids confusion.


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-12-02 10:15 UTC

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