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

Int - inv_mod #737

Merged
merged 2 commits into from
Jan 20, 2025
Merged

Int - inv_mod #737

merged 2 commits into from
Jan 20, 2025

Conversation

erik-3milabs
Copy link
Contributor

@erik-3milabs erik-3milabs commented Jan 10, 2025

Introduces the Int::inv_mod operation.

Replaces #727

src/traits.rs Outdated Show resolved Hide resolved
@erik-3milabs erik-3milabs marked this pull request as ready for review January 10, 2025 17:08
@erik-3milabs erik-3milabs marked this pull request as draft January 10, 2025 17:09
tarcieri added a commit that referenced this pull request Jan 20, 2025
As needed for #737.

This uses a shape similar to the `MulMod` trait.
tarcieri added a commit that referenced this pull request Jan 20, 2025
As needed for #737.

This uses a shape similar to the `MulMod` trait.
@erik-3milabs erik-3milabs marked this pull request as ready for review January 20, 2025 09:19
@erik-3milabs
Copy link
Contributor Author

@tarcieri, I rebased and think this PR is ready to be merged. Please have a look.

Note: I could not make Int::odd_inv_mod a const function since I don't see how I can manipulate a ConstCtOption to apply a wrapping_sub operation. Please let me know if there is any way so I can adjust things appropriately.

@erik-3milabs erik-3milabs mentioned this pull request Jan 9, 2025
10 tasks
Copy link
Member

@tarcieri tarcieri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will merge this for now with potential followup for making it const fn

@tarcieri tarcieri merged commit 03e1b3a into RustCrypto:master Jan 20, 2025
18 checks passed
@tarcieri
Copy link
Member

I don't see how I can manipulate a ConstCtOption to apply a wrapping_sub operation.

You'd need to add a map operation to ConstCtOption

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