The Lenstra elliptic-curve factorization or the elliptic-curve factorization method (ECM) is a fast, sub-
exponential running time
In computational complexity theory, the complexity class EXPTIME (sometimes called EXP or DEXPTIME) is the set of all decision problems that are solvable by a deterministic Turing machine in exponential time, i.e., in O(2''p''(''n'')) time, wh ...
, algorithm for
integer factorization, which employs
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 ...
s. For
general-purpose factoring, ECM is the third-fastest known factoring method. The second-fastest is the
multiple polynomial quadratic sieve The quadratic sieve algorithm (QS) is an integer factorization algorithm and, in practice, the second fastest method known (after the general number field sieve). It is still the fastest for integers under 100 decimal digits or so, and is considerab ...
, and the fastest is the
general number field sieve
In number theory, the general number field sieve (GNFS) is the most efficient classical algorithm known for factoring integers larger than . Heuristically, its complexity for factoring an integer (consisting of bits) is of the form
:\exp\le ...
. The Lenstra elliptic-curve factorization is named after
Hendrik 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 faculty o ...
.
Practically speaking, ECM is considered a special-purpose factoring algorithm, as it is most suitable for finding small factors. , it is still the best algorithm for
divisor
In mathematics, a divisor of an integer n, also called a factor of n, is an integer m that may be multiplied by some integer to produce n. In this case, one also says that n is a multiple of m. An integer n is divisible or evenly divisible by ...
s not exceeding 50 to 60
digits, as its running time is dominated by the size of the smallest factor ''p'' rather than by the size of the number ''n'' to be factored. Frequently, ECM is used to remove small factors from a very large integer with many factors; if the remaining integer is still composite, then it has only large factors and is factored using general-purpose techniques. The largest factor found using ECM so far has 83 decimal digits and was discovered on 7 September 2013 by R. Propper. Increasing the number of curves tested improves the chances of finding a factor, but they are not
linear
Linearity is the property of a mathematical relationship ('' function'') that can be graphically represented as a straight line. Linearity is closely related to '' proportionality''. Examples in physics include rectilinear motion, the linear ...
with the increase in the number of digits.
Algorithm
The Lenstra elliptic-curve factorization method to find a factor of a given natural number
works as follows:
# Pick a random
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 ...
over
, with equation of the form
together with a non-trivial
point on it.
#:This can be done by first picking random
, and then setting
to assure the point is on the curve.
# One can define ''Addition'' of two points on the curve, to define a
Group. The addition laws are given in the
article on elliptic curves.
#:We can form repeated multiples of a point
:
. The addition formulae involve taking the modular slope of a chord joining
and
, and thus division between residue classes modulo
, performed using the
extended Euclidean algorithm
In arithmetic and computer programming, the extended Euclidean algorithm is an extension to the Euclidean algorithm, and computes, in addition to the greatest common divisor (gcd) of integers ''a'' and ''b'', also the coefficients of Bézout's ...
. In particular, division by some
includes calculation of the
.
#: Assuming we calculate a slope of the form
with
, then if
, the result of the point addition will be
, the point "at infinity" corresponding to the intersection of the "vertical" line joining
and the curve. However, if
, then the point addition will not produce a meaningful point on the curve; but, more importantly,
is a non-trivial factor of
.
# Compute
on the elliptic curve (
), where
is a product of many small numbers: say, a product of small primes raised to small powers, as in the
p-1 algorithm, or the
factorial
In mathematics, the factorial of a non-negative denoted is the product of all positive integers less than or equal The factorial also equals the product of n with the next smaller factorial:
\begin
n! &= n \times (n-1) \times (n-2) ...
for some not too large
. This can be done efficiently, one small factor at a time. Say, to get
, first compute
, then
, then
, and so on.
is picked to be small enough so that
-wise point addition can be performed in reasonable time.
#*If we finish all the calculations above without encountering non-invertible elements (
), it means that the elliptic curves' (modulo primes) order is not
smooth enough, so we need to try again with a different curve and starting point.
#*If we encounter a
we are done: it is a non-trivial factor of
.
The time complexity depends on the size of the number's smallest prime factor and can be represented by , where ''p'' is the smallest factor of ''n'', or