-
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
Faster constant-time division #643
Merged
tarcieri
merged 9 commits into
RustCrypto:master
from
andrewwhitehead:feat/fast-const-div
Aug 18, 2024
Merged
Faster constant-time division #643
tarcieri
merged 9 commits into
RustCrypto:master
from
andrewwhitehead:feat/fast-const-div
Aug 18, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Signed-off-by: Andrew Whitehead <cywolf@gmail.com>
Signed-off-by: Andrew Whitehead <cywolf@gmail.com>
Signed-off-by: Andrew Whitehead <cywolf@gmail.com>
Signed-off-by: Andrew Whitehead <cywolf@gmail.com>
Signed-off-by: Andrew Whitehead <cywolf@gmail.com>
Signed-off-by: Andrew Whitehead <cywolf@gmail.com>
Signed-off-by: Andrew Whitehead <cywolf@gmail.com>
Signed-off-by: Andrew Whitehead <cywolf@gmail.com>
andrewwhitehead
force-pushed
the
feat/fast-const-div
branch
2 times, most recently
from
August 16, 2024 00:19
5811643
to
858ffff
Compare
Signed-off-by: Andrew Whitehead <cywolf@gmail.com>
andrewwhitehead
force-pushed
the
feat/fast-const-div
branch
from
August 16, 2024 03:09
858ffff
to
5bf5f8b
Compare
fjarri
reviewed
Aug 16, 2024
fjarri
reviewed
Aug 16, 2024
fjarri
reviewed
Aug 16, 2024
tarcieri
approved these changes
Aug 18, 2024
I saw one |
Merged
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This replaces the
div_rem
method for Uint and BoxedUint with one based on the updated vartime division method.Unlike the old method, this one panics if
NonZero(0)
is given as the divisor. Thesqrt
method relied on the old behavior and is updated.The
Default
implementation ofNonZero
was also producing invalidNonZero(0)
values, which affected theNonZero::map
usage inchecked_div
. The trait implementation is updated to returnSelf::ONE
as the default.Some relevant benchmarks: