Abstract

The algorithm of Tonelli and Shanks for computing square roots modulo a prime number is the most used, and probably the fastest among the known algorithms when averaged over all prime numbers. However, for some particular prime numbers, there are other algorithms which are considerably faster.In this paper we compare the algorithm of Tonelli and Shanks with an algorithm based in quadratic field extensions due to Cipolla, and give an explicit condition on a prime number to decide which algorithm is faster. Finally, we show that there exists an infinite sequence of prime numbers for which the algorithm of Tonelli and Shanks is asymptotically worse.

Talk to us

Join us for a 30 min session where you can share your feedback and ask us any queries you have

Schedule a call

Disclaimer: All third-party content on this website/platform is and will remain the property of their respective owners and is provided on "as is" basis without any warranties, express or implied. Use of third-party content does not indicate any affiliation, sponsorship with or endorsement by them. Any references to third-party content is to identify the corresponding services and shall be considered fair use under The CopyrightLaw.