primalitytesting
Primality testing is the computational problem of determining whether a given integer n greater than 1 is prime. It is foundational in number theory and cryptography. A primality test may be probabilistic, returning prime with high confidence and a small chance of error, or deterministic, giving a definitive answer for all inputs. Some tests also produce a primality certificate that can be independently checked.
Historically, simple methods such as trial division are impractical for large n. Early probabilistic tests based
In 2002, the Agrawal–Kayal–Saxena (AKS) primality test showed that primality can be determined in deterministic polynomial
Applications of primality testing include key generation for public-key cryptography, primality pruning in algorithms, and various