Skip to content

Conversation

tarcieri
Copy link
Member

Adds the following methods:

  • bits: count the number of bits required to represent a given number in constant-time
  • bits_vartime: count the number of bits required to represent a given number in variable-time
  • leading_zeros: count the number of leading zeros in a number, implemented as a provided method which subtracts bits from bits_precision.

This also adds BoxedUint::bits_vartime, whereas previously it only had a constant-time implementation.

Adds the following methods:
- `bits`: count the number of bits required to represent a given number
  in constant-time
- `bits_vartime`: count the number of bits required to represent a given
  number in variable-time
- `leading_zeros`: count the number of leading zeros in a number,
  implemented as a provided method which subtracts `bits` from
  `bits_precision`.

This also adds `BoxedUint::bits_vartime`, whereas previously it only had
a constant-time implementation.
@tarcieri tarcieri requested a review from fjarri November 30, 2023 17:07
@tarcieri tarcieri merged commit 030f600 into master Nov 30, 2023
@tarcieri tarcieri deleted the integer/add-bits-and-leading-zeros branch November 30, 2023 17:15
@tarcieri tarcieri mentioned this pull request Jan 22, 2025
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