In
mathematics,
elliptic curve
In mathematics, an elliptic curve is a smooth, projective, algebraic curve of genus one, on which there is a specified point . An elliptic curve is defined over a field and describes points in , the Cartesian product of with itself. If ...
primality testing techniques, or elliptic curve primality proving (ECPP), are among the quickest and most widely used methods in primality proving.
It is an idea put forward by
Shafi Goldwasser
en, Shafrira Goldwasser
, name = Shafi Goldwasser
, image = Shafi Goldwasser.JPG
, caption = Shafi Goldwasser in 2010
, birth_place = New York City, New York, U.S.
, birth_date =
, death_dat ...
and
Joe Kilian in 1986 and turned into an algorithm by
A. O. L. Atkin the same year. The algorithm was altered and improved by several collaborators subsequently, and notably by Atkin and , in 1993. The concept of using
elliptic curves in factorization had been developed by
H. W. Lenstra
Hendrik Willem Lenstra Jr. (born 16 April 1949, Zaandam) is a Dutch mathematician.
Biography
Lenstra received his doctorate from the University of Amsterdam in 1977 and became a professor there in 1978. In 1987 he was appointed to the facult ...
in 1985, and the implications for its use in primality testing (and proving) followed quickly.
Primality testing
A primality test is an algorithm for determining whether an input number is prime. Among other fields of mathematics, it is used for cryptography. Unlike integer factorization, primality tests do not generally give prime factors, only stating wheth ...
is a field that has been around since the time of
Fermat
Pierre de Fermat (; between 31 October and 6 December 1607 – 12 January 1665) was a French mathematician who is given credit for early developments that led to infinitesimal calculus, including his technique of adequality. In particular, he i ...
, 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 The Baillie–PSW primality test is a probabilistic primality testing algorithm that determines whether a number is composite or is a probable prime. It is named after Robert Baillie, Carl Pomerance, John Selfridge, and Samuel Wagstaff.
The Bailli ...
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 primality test required at least partial factorization of
in order to prove that
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
In mathematics and computer science, an algorithm () is a finite sequence of rigorous instructions, typically used to solve a class of specific problems or to perform a computation. Algorithms are used as specifications for performing ...
, 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. ECPP
heuristically
A heuristic (; ), or heuristic technique, is any approach to problem solving or self-discovery that employs a practical method that is not guaranteed to be optimal, perfect, or rational, but is nevertheless sufficient for reaching an immediate, ...
runs in time:
:
for some
.
This exponent may be decreased to
for some versions by heuristic arguments. ECPP works the same way as most other
primality test
A primality test is an algorithm for determining whether an input number is prime. Among other fields of mathematics, it is used for cryptography. Unlike integer factorization, primality tests do not generally give prime factors, only stating wh ...
s do, finding a
group and showing its size is such that
is prime. For ECPP the group is an elliptic curve over a finite set of quadratic forms such that
is trivial to factor over the group.
ECPP generates an
Atkin–
Goldwasser–Kilian–Morain
certificate
Certificate may refer to:
* Birth certificate
* Marriage certificate
* Death certificate
* Gift certificate
* Certificate of authenticity, a document or seal certifying the authenticity of something
* Certificate of deposit, or CD, a financial pro ...
of primality by
recursion
Recursion (adjective: ''recursive'') occurs when a thing is defined in terms of itself or of its type. Recursion is used in a variety of disciplines ranging from linguistics to logic. The most common application of recursion is in mathematic ...
and then
attempts to verify the certificate. The step that takes the most
CPU
A central processing unit (CPU), also called a central processor, main processor or just processor, is the electronic circuitry that executes instructions comprising a computer program. The CPU performs basic arithmetic, logic, controlling, and ...
time is the certificate generation, because factoring over a
class field
In mathematics, class field theory (CFT) is the fundamental branch of algebraic number theory whose goal is to describe all the abelian Galois extensions of local and global fields using objects associated to the ground field.
Hilbert is credited ...
must be performed. The certificate can be verified quickly, allowing a check of operation to take very little time.
, the largest prime that has been proved with ECPP method is
. The certification was performed by Andreas Enge using his fastECPP software ''CM''.
Proposition
The elliptic curve primality tests are based on criteria analogous to the Pocklington criterion, on which that test is based,
[ Washington, Lawrence C., Elliptic Curves: Number Theory and Cryptography, Chapman & Hall/CRC, 2003] where the group
is replaced by
and ''E'' is a properly chosen elliptic curve. We will now state a proposition on which to base our test, which is analogous to the Pocklington criterion, and gives rise to the Goldwasser–Kilian–Atkin form of the elliptic curve primality test.
Let ''N'' be a positive integer, and ''E'' be the set which is defined by the equation
Consider ''E'' over
use the
usual addition law on ''E'', and write 0 for the neutral element on ''E''.
Let ''m'' be an integer. If there is a prime ''q'' which divides ''m'', and is greater than
and there exists a point ''P'' on ''E'' such that
(1) ''mP'' = 0
(2) (''m''/''q'')''P'' is defined and not equal to 0
Then ''N'' is prime.
Proof
If ''N'' is composite, then there exists a prime
that divides ''N''. Define
as the elliptic curve defined by the same equation as ''E'' but evaluated modulo ''p'' rather than modulo ''N''. Define
as the order of the group
. By
Hasse's theorem on elliptic curves we know
:
and thus
and there exists an integer ''u'' with the property that
:
Let
be the point ''P'' evaluated modulo ''p''. Thus, on
we have
:
by (1), as
is calculated using the same method as ''mP'', except modulo ''p'' rather than modulo ''N'' (and
).
This contradicts (2), because if (''m''/''q'')''P'' is defined and not equal to 0 (mod ''N''), then the same method calculated modulo ''p'' instead of modulo ''N'' will yield:
[Koblitz, Neal, Introduction to Number Theory and Cryptography, 2nd Ed, Springer, 1994]
:
Goldwasser–Kilian algorithm
From this proposition an algorithm can be constructed to prove an integer, ''N'', is prime. This is done as follows:
Choose three integers at random, ''a, x, y'' and set
:
Now ''P'' = (''x'',''y'') is a point on ''E'', where we have that ''E'' is defined by
. Next we need an algorithm to count the number of points on ''E''. Applied to ''E'', this algorithm (Koblitz and others suggest
Schoof's algorithm) produces a number ''m'' which is the number of points on curve ''E'' over F
''N'', provided ''N'' is prime. If the point-counting algorithm stops at an undefined expression this allows to determine a non-trivial factor of ''N''. If it succeeds, we apply a criterion for deciding whether our curve ''E'' is acceptable.
If we can write ''m'' in the form
where
is a small integer and ''q'' a large probable prime (a number that passes a probabilistic
primality test
A primality test is an algorithm for determining whether an input number is prime. Among other fields of mathematics, it is used for cryptography. Unlike integer factorization, primality tests do not generally give prime factors, only stating wh ...
, for example), then we do not discard ''E''. Otherwise, we discard our curve and randomly select another triple ''(a, x, y)'' to start over. The idea here is to find an ''m'' that is divisible by a large prime number ''q''. This prime is a few digits smaller than ''m'' (or ''N'') so ''q'' will be easier to prove prime than ''N''.
Assuming we find a curve which passes the criterion, proceed to calculate ''mP'' and ''kP''. If any of the two calculations produce an undefined expression, we can get a non-trivial factor of ''N''. If both calculations succeed, we examine the results.
If
it is clear that ''N'' is not prime, because if ''N'' were prime then ''E'' would have order ''m'', and any element of ''E'' would become 0 on multiplication by ''m''. If ''kP'' = 0, then the algorithm discards ''E'' and starts over with a different ''a, x, y'' triple.
Now if
and
then our previous proposition tells us that ''N'' is prime. However, there is one possible problem, which is the primality of ''q''. This is verified using the same algorithm. So we have described a
recursive algorithm, where the primality of ''N'' depends on the primality of ''q'' and indeed smaller 'probable primes' until some threshold is reached where ''q'' is considered small enough to apply a non-recursive deterministic algorithm.
Problems with the algorithm
Atkin and Morain state "the problem with GK is that Schoof's algorithm seems almost impossible to implement."
It is very slow and cumbersome to count all of the points on ''E'' using Schoof's algorithm, which is the preferred algorithm for the Goldwasser–Kilian algorithm. However, the original algorithm by Schoof is not efficient enough to provide the number of points in short time.
[Lenstra, Hendrik W., ''Efficient Algorithms in Number Theory'', https://openaccess.leidenuniv.nl/bitstream/1887/2141/1/346_081.pdf] These comments have
to be seen in the historical context, before the improvements by Elkies and Atkin to Schoof's method.
A second problem Koblitz notes is the difficulty of finding the curve ''E'' whose number of points is of the form ''kq'', as above. There is no known theorem which guarantees we can find a suitable ''E'' in polynomially many attempts. The distribution of primes on the Hasse interval