-
Notifications
You must be signed in to change notification settings - Fork 75
Int wrapping multiplication improvements #998
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
Int wrapping multiplication improvements #998
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:
|
| 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 |
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.
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.
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.
We should probably apply the unreachable_pub lint
|
@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>
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 optimizes
Int::wrapping_mulandUint::checked_mul_intto make use ofUint::wrapping_mul, and addsInt::saturating_mul.