Improve checks for scalar _get_bits methods #1845

pull peterdettman wants to merge 1 commits into bitcoin-core:master from peterdettman:verify_get_bits changing 3 files +17 −6
  1. peterdettman commented at 10:55 AM on April 12, 2026: contributor

    Improves the VERIFY_CHECKs in all _scalar_get_bits_limb32 and _scalar_get_bits_var methods.

    The initial prompt was noticing that scalar_4x64_impl/secp256k1_scalar_get_bits_limb32 was not restricting to 32-bit limbs correctly. Then missing range checks for offset were added and all such checks rewritten to avoid overflow.

    With these changes, the _low and _4x64 impls of _get_bits_var can no longer forward to _get_bits_limb32, so those calls were inlined instead.

  2. Improve checks for scalar _get_bits methods 0cad3df503
Contributors

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-04-18 17:15 UTC

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