Square Roots Modulo p
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.
KeywordsPrime Number Arithmetic Progression Discrete Logarithm Absolute Constant Explicit Condition
Unable to display preview. Download preview PDF.
- 2.Bernstein, D.J.: Faster square roots in annoying finite fields, draft. Available from http://cr.yp.to/papers.html (2001)
- 3.Cipolla, M.: Un metodo per la risoluzione della congruenza di secondo grado. Rend. Accad. Sci. Fis. Mat. Napoli 9 (1903) 154–163Google Scholar
- 4.Heath-Brown, D.R.: Zero-free regions for Dirichlet L-functions, and the least prime in an arithmetic progression. Proc. London Math. Soc. (3) 64 (1992) 265–338Google Scholar
- 5.Lindhurst, S.: An analysis of Shanks’s algorithm for computing square roots in finite fields. In: Number theory (Ottawa, ON, 1996). Amer. Math. Soc., Providence, RI (1999) 231–242Google Scholar
- 8.Shanks, D.: Five number-theoretic algorithms. In: Proceedings of the Second Manitoba Conference on Numerical Mathematics (Univ. Manitoba, Winnipeg, Man., 1972). Utilitas Math., Winnipeg, Man. (1973) 51–70. Congressus Numerantium, No. VIIGoogle Scholar
- 9.Tonelli, A.: Bemerkung über die Auflösung quadratischer Congruenzen. Göttinger Nachrichten (1891) 344–346Google Scholar