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
math/big: infinite loop in Int.ModSqrt for p = 1 #51747
Comments
It does indeed go into an infinite loop. Thanks for reporting. The method's documentation says
and 1 is not a prime, but going into an infinite loop is still not the best way to handle an invalid parameter. |
cc @griesemer @FiloSottile as per owners. |
Change https://go.dev/cl/394077 mentions this issue: |
Other examples of causing infinite loop in Int.ModSqrt:
|
Change https://go.dev/cl/402457 mentions this issue: |
Rolling forward to 1.20. |
When passing p=1 in ModSqrt function, the code goes in infinite loop:
go/src/math/big/int.go
Line 940 in 3463852
The Jacobi symbol will gives one for ever.
For example: https://go.dev/play/p/37ExZ6Y-Hdp
The text was updated successfully, but these errors were encountered: