-
Notifications
You must be signed in to change notification settings - Fork 56
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
docs: a few usage examples for div #540
docs: a few usage examples for div #540
Conversation
fix: wrapping_rem_vartime
src/uint/div.rs
Outdated
@@ -159,6 +159,19 @@ impl<const LIMBS: usize> Uint<LIMBS> { | |||
|
|||
/// Computes `self` % 2^k. Faster than reduce since its a power of 2. | |||
/// Limited to 2^16-1 since Uint doesn't support higher. | |||
/// TODO: this is not constant-time. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sidebar: we should perhaps consider renaming this rem2k_vartime
/cc @fjarri
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I imagine making it constant-time would also be pretty straightforward.
Although I am not sure we need it at all in the API.
I just want to reiterate my position (last time, I promise) that usage examples for simple arithmetic operations like these are entirely excessive. |
|
Adds a few usage examples for div operations. ref issue #283.
Additionally modifies:
into:
since it uses
rem_vartime
internally.