Lably
Skip to content

Elliptic curve primality

Methods to test or prove primality

  • 14 min read
  • 6 chapters

Related on Lably

Through Mathematics, Algorithm and Primality test

Primality testing is a field that has been around since the time of Fermat, in whose time most algorithms were based on factoring, which become unwieldy with large input; modern algorithms treat the problems of determining whether a number is prime and what its factors are separately. It became of practical importance with the advent of modern cryptography. Although many current tests result in a probabilistic output (N is either shown composite, or probably prime, such as with the Baillie–PSW primality test or the Miller–Rabin test), the elliptic curve test proves primality (or compositeness) with a quickly verifiable certificate.

Previously-known prime-proving methods such as the Pocklington n − 1 primality test required at least partial factorization of N−1 and the Morrison n + 1 primality test required at least partial factorization of N+1, in order to prove that N is prime. As a result, these methods required some luck and are generally slow in practice.

Elliptic curve primality proving

It is a general-purpose algorithm, meaning it does not depend on the number being of a special form. ECPP is currently in practice the fastest known algorithm for testing the primality of general numbers, but the worst-case execution time is not known. The fastest variant executes in Õ(L4) time, where L=⌈log2⁡n⌉ is the bit-length of the number to be tested. Parallelization is possible for all steps to L cores so the wall-clock time is actually around Õ(L3).

ECPP works the same way as most other primality tests do, finding a group and showing its size is such that p is prime. For ECPP the group is an elliptic curve over a finite set of quadratic forms such that p−1 is trivial to factor over the group.

ECPP generates an Atkin–Goldwasser–Kilian–Morain certificate of primality by recursion and then attempts to verify the certificate. The step that takes the most CPU time is the certificate generation, because factoring over a class field must be performed. The certificate can be verified quickly, allowing a check of operation to take very little time.

As of November 2025, the largest prime that has been proved with ECPP method is R(109297) = (10109297−1)/9, a repunit of 109297 digits. The certification was performed Paul Underwood using Andreas Enge's fastECPP software CM. It was submitted in May 2025. Enge himself has set a few records using his software, which he details on his software website.

Sign in to keep reading

5 more chapters are free with a Lably account.

More in Topics in mathematics