Skip to content

Conversation

tarcieri
Copy link
Member

Adds a method to the Zero trait for setting its value to zero in-place, subsuming the previous BoxedUint::set_to_zero function.

It's inspired by a similar method on num_traits::Zero (which we don't use so is_zero can return Choice and use ConstantTimeEq to compare values in constant-time).

https://docs.rs/num-traits/latest/num_traits/identities/trait.Zero.html#method.set_zero

Adds a method to the `Zero` trait for setting its value to zero
in-place, subsuming the previous `BoxedUint::set_to_zero` function.

It's inspired by a similar method on `num_traits::Zero` (which we don't
use so `is_zero` can return `Choice` and use `ConstantTimeEq` to compare
values in constant-time).

https://docs.rs/num-traits/latest/num_traits/identities/trait.Zero.html#method.set_zero
@tarcieri tarcieri merged commit 3094c66 into master Dec 14, 2023
@tarcieri tarcieri deleted the add-set-zero-to-zero-trait branch December 14, 2023 19:03
xuganyu96 pushed a commit to xuganyu96/crypto-bigint that referenced this pull request Dec 15, 2023
Adds a method to the `Zero` trait for setting its value to zero
in-place, subsuming the previous `BoxedUint::set_to_zero` function.

It's inspired by a similar method on `num_traits::Zero` (which we don't
use so `is_zero` can return `Choice` and use `ConstantTimeEq` to compare
values in constant-time).

https://docs.rs/num-traits/latest/num_traits/identities/trait.Zero.html#method.set_zero
@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