Crate tonelli_rs

Source
Expand description

Tonelli-Shanks algorithm implementation for computing square roots modulo a prime.

This library provides functions to compute square roots in the finite field Z/pZ where p is an odd prime number.

Functionsยง

find_quadratic_non_residue
Finds the first quadratic non-residue modulo p
legendre_symbol
Computes the Legendre symbol (a/p)
pow_mod
Computes modular exponentiation: x^n mod p
square_roots
Computes both square roots of n modulo p
tonelli_shanks
Computes a square root of n modulo p using the Tonelli-Shanks algorithm