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 const fn constructors for NonZero<Uint> and NonZero<Limb> #266

Merged
merged 1 commit into from
Aug 28, 2023

Conversation

fjarri
Copy link
Contributor

@fjarri fjarri commented Aug 23, 2023

This will allow us to make a number of methods const fn (for example, various division methods) and introduce NonZero bounds where they were previously impossible (for example, inv_mod.rs methods where moduli are currently just &Self). Also it opens up a possibility to initialize a NonZero constant of a modulus/divisor known at compile-time, so that it doesn't have to be unwrapped every time on use.

@tarcieri tarcieri merged commit 3126405 into RustCrypto:master Aug 28, 2023
@fjarri fjarri deleted the const-nonzero branch August 28, 2023 20:25
@tarcieri tarcieri mentioned this pull request Sep 4, 2023
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.

2 participants