Int wrapping multiplication improvements#998
Merged
tarcieri merged 5 commits intoRustCrypto:masterfrom Nov 25, 2025
Merged
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #998 +/- ##
==========================================
- Coverage 79.89% 79.87% -0.02%
==========================================
Files 163 163
Lines 17606 17709 +103
==========================================
+ Hits 14066 14145 +79
- Misses 3540 3564 +24 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
andrewwhitehead
commented
Nov 12, 2025
| pub const SIGN_MASK: Self = Self::MIN; // Bit sequence (be): 1000....0000 | ||
|
|
||
| /// All-one bit mask. | ||
| pub const FULL_MASK: Self = Self(Uint::MAX); // Bit sequence (be): 1111...1111 |
Contributor
Author
There was a problem hiding this comment.
This constant was public, but I can't imagine what it would be needed for, besides the internal usage in calculating MINUS_ONE which has been updated.
Member
There was a problem hiding this comment.
We should probably apply the unreachable_pub lint
Member
|
@andrewwhitehead looks like this now has a conflict, possibly from #1008. Can you rebase and I can do another pass on this? |
Signed-off-by: Andrew Whitehead <cywolf@gmail.com>
Signed-off-by: Andrew Whitehead <cywolf@gmail.com>
Signed-off-by: Andrew Whitehead <cywolf@gmail.com>
simplify Int::wrapping_mul and add test Signed-off-by: Andrew Whitehead <cywolf@gmail.com>
8b7d103 to
b474399
Compare
Signed-off-by: Andrew Whitehead <cywolf@gmail.com>
tarcieri
approved these changes
Nov 25, 2025
tarcieri
added a commit
that referenced
this pull request
Nov 26, 2025
This reverts commit 75001b2 (#998) We're noticing CI failures on cross which seem to be related to this change, e.g. https://github.com/RustCrypto/crypto-bigint/actions/runs/19647957432/job/56267760132 It looks like it's potentially getting stuck in an infinite loop.
This file contains hidden or 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
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 optimizes
Int::wrapping_mulandUint::checked_mul_intto make use ofUint::wrapping_mul, and addsInt::saturating_mul.