-
Notifications
You must be signed in to change notification settings - Fork 68
Add Jacobi symbol calculation #927
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 Jacobi symbol calculation #927
Conversation
Signed-off-by: Andrew Whitehead <[email protected]>
3580460
to
a56616a
Compare
@erik-3milabs can you take a look at the |
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. |
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.
Nit: isn't the mod_
part implied by this being in modular
?
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.
I suppose so, but it's consistent with uint/mod_symbol
and int/mod_symbol
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 inprimefield
for addingis_square
/is_square_vartime
methods which should be faster thansqrt
.