Skip to content

Conversation

d-torrance
Copy link
Member

We use the Tonelli-Shanks algorithm to find solutions to $x^2\equiv n\pmod p$ for prime $p$.

i1 : sqrt(5, 41)

o1 = 13

i2 : sqrt(5_(ZZ/41))

o2 = 13

     ZZ
o2 : --
     41

i3 : sqrt(5_(GF 41))

o3 = 13

o3 : GF 41

This at least partially addresses #3941. It's all implemented at top-level and doesn't use flint. It also doesn't work modulo a composite number yet.

@d-torrance d-torrance requested a review from mahrud October 2, 2025 17:20
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.

1 participant