Algorithmic Number Theory

Volume 1838 of the series Lecture Notes in Computer Science pp 423-437

On Probable Prime Testing and the Computation of Square Roots mod n

  • Siguna MüllerAffiliated withDept. of Math., University of Klagenfurt

* Final gross prices may vary according to local VAT.

Get Access


We will investigate two well-known square root finding algorithms which return the roots of some quadratic residue modulo a prime p. Instead of running the mechanisms modulo p we will investigate their behaviour when applied modulo any integer n. In most cases the results will not be the square roots, when n is composite. Since the results obtained can easily be verified for correctness we obtain a very rapid probable prime test. Based on the square root finding mechanisms we will introduce two pseudoprimality tests which will be shown to be extremely fast and very efficient. Moreover, the proposed test for n ≡1 mod 4 will be proven to be even more efficient than Grantham’s suggestion in [5].