Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Zero::set_zero method #426

Merged
merged 1 commit into from
Dec 14, 2023
Merged

Add Zero::set_zero method #426

merged 1 commit into from
Dec 14, 2023

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
16 checks passed
@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