Skip to content

Conversation

andrewwhitehead
Copy link
Contributor

This implementation is based on bingcd. It does not appear to affect the GCD performance, being optimized away when it is not needed. This would be useful in primefield for adding is_square/is_square_vartime methods which should be faster than sqrt.

Signed-off-by: Andrew Whitehead <[email protected]>
@tarcieri
Copy link
Member

@erik-3milabs can you take a look at the bingcd changes?

Signed-off-by: Andrew Whitehead <[email protected]>
Signed-off-by: Andrew Whitehead <[email protected]>
@@ -0,0 +1,63 @@
//! Modular symbol calculation for integers in Montgomery form with a constant modulus.
Copy link
Member

Choose a reason for hiding this comment

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

Nit: isn't the mod_ part implied by this being in modular?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I suppose so, but it's consistent with uint/mod_symbol and int/mod_symbol

@tarcieri tarcieri merged commit a13a59c into RustCrypto:master Aug 30, 2025
23 checks passed
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.

3 participants