Why it matters

Quadratic residues underlie many algorithms. Understanding shapes number theory.

Advertisement

The architecture

Euler criterion: a^((p-1)/2) mod p = 1 iff QR.

Legendre symbol notation.

Quadratic residuesEuler criteriona^((p-1)/2)Result1 = QR, -1 = NRLegendre symbol(a/p)Jacobi symbol generalizes to composite modulus; foundation for Tonelli-Shanks
QR.
Advertisement

How it works end to end

Euler criterion via modexp.

Legendre symbol.

Jacobi symbol for composite.