Skip to content

Improve checks for scalar _get_bits methods#1845

Open
peterdettman wants to merge 1 commit intobitcoin-core:masterfrom
peterdettman:verify_get_bits
Open

Improve checks for scalar _get_bits methods#1845
peterdettman wants to merge 1 commit intobitcoin-core:masterfrom
peterdettman:verify_get_bits

Conversation

@peterdettman
Copy link
Copy Markdown
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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant