Content deleted Content added
Remove UBASIC link, hand-written x86 FPU assembly doesn't have much place when you can buy one of a few GPUs that are capable of 7-12TFLOP FP64 on ebay for $500-$1000 since they're considered junk by industry now. The fastest Epyc processors still struggle to reach 1/4 of that and that's measured on the vectorized 64-bit float instructions, usually, since the metric is FMA and x87 FPU still needs to be issued two instructions (one of which is an insane latency multiply) to do that |
m Fixed grammar Tags: canned edit summary Mobile edit Mobile app edit iOS app edit App select source |
||
(7 intermediate revisions by 6 users not shown) | |||
Line 9:
The Lenstra elliptic-curve factorization method to find a factor of a given natural number <math>n</math> works as follows:
# Pick a random [[elliptic curve]] over <math>\mathbb{Z}/n\mathbb{Z}</math> (the integers modulo <math>n</math>), with equation of the form <math>y^2 = x^3 + ax + b \pmod n</math> together with a non-trivial [[Point (geometry)|point]] <math>P(x_0,y_0)</math> on it.
#:This can be done by first picking random <math>x_0,y_0,a \in \mathbb{Z}/n\mathbb{Z}</math>, and then setting <math>b = y_0^2 - x_0^3 - ax_0\pmod n</math> to
# One can define ''Addition'' of two points on the curve, to define a [[Group (mathematics)|group]]. The addition laws are given in the [[elliptic curve#The group law|article on elliptic curves]].
#:We can form repeated multiples of a point <math>P</math>: <math>[k]P = P + \ldots + P \text{ (k times)}</math>. The addition formulae involve taking the modular slope of a chord joining <math>P</math> and <math>Q</math>, and thus division between residue classes modulo <math>n</math>, performed using the [[extended Euclidean algorithm]]. In particular, division by some <math>v \bmod n</math> includes calculation of the <math>\gcd(v,n)</math>.
Line 23:
If ''p'' and ''q'' are two prime divisors of ''n'', then {{math|1=''y''<sup>2</sup> = ''x''<sup>3</sup> +}} {{math|1=''ax'' + ''b'' (mod ''n'')}} implies the same equation also {{math|1=modulo ''p''}} and {{math|1=modulo ''q''.}} These two smaller elliptic curves with the <math>\boxplus</math>-addition are now genuine [[group (mathematics)|groups]]. If these groups have ''N''<sub>''p''</sub> and ''N<sub>q</sub>'' elements, respectively, then for any point ''P'' on the original curve, by [[Lagrange's theorem (group theory)|Lagrange's theorem]], {{math|1=''k'' > 0}} is minimal such that <math>kP=\infty</math> on the curve modulo ''p'' implies that ''k'' divides ''N''<sub>''p''</sub>; moreover, <math>N_p P=\infty</math>. The analogous statement holds for the curve modulo ''q''. When the elliptic curve is chosen randomly, then ''N''<sub>''p''</sub> and ''N''<sub>''q''</sub> are random numbers close to {{math|1=''p'' + 1}} and {{math|1=''q'' + 1,}} respectively (see below). Hence it is unlikely that most of the prime factors of ''N''<sub>''p''</sub> and ''N''<sub>''q''</sub> are the same, and it is quite likely that while computing ''eP'', we will encounter some ''kP'' that is ∞ {{math|1=modulo ''p''}} but not {{math|1=modulo ''q'',}} or vice versa. When this is the case, ''kP'' does not exist on the original curve, and in the computations we found some ''v'' with either {{math|1=gcd(''v'',''p'') = ''p''}} or {{math|1=gcd(''v'', ''q'') = ''q'',}} but not both. That is, {{math|1=gcd(''v'', ''n'')}} gave a non-trivial factor {{math|1=of ''n''.}}
ECM is at its core an improvement of the older [[Pollard's p − 1 algorithm|{{math|1=''p'' − 1}} algorithm]]. The {{math|1=''p'' − 1}} algorithm finds prime factors ''p'' such that {{math|1=''p'' − 1}} is [[smooth number|b-powersmooth]] for small values of ''b''. For any ''e'', a multiple of {{math|1=''p'' − 1,}} and any ''a'' [[relatively prime]] to ''p'', by [[Fermat's little theorem]] we have {{math|1=''a''<sup>''e''</sup> ≡ 1 ([[modular arithmetic|mod]] ''p'')}}. Then {{math|1=[[greatest common divisor|gcd]](''a''<sup>''e''</sup> − 1, ''n'')}} is likely to produce a factor of ''n''. However, the algorithm fails when {{math|1=''p''
ECM gets around this obstacle by considering the [[group (mathematics)|group]] of a random [[elliptic curve]] over the [[finite field]] '''Z'''<sub>''p''</sub>, rather than considering the [[multiplicative group]] of '''Z'''<sub>''p''</sub> which always has order {{math|1=''p'' − 1.}}
Line 33:
The following example is from {{harvtxt|Trappe|Washington|2006}}, with some details added.
We want to factor
The slope of the tangent line at some point
First, we compute <math>2!P</math>. Using [[Elliptic_curve_point_multiplication#Point_doubling|
:<math>x'=4^2-2(1)=14</math>
:<math>y'=4(1-14)-1=-53</math>
yielding the point <math>2P=(14,-53)</math>.
Next, we compute <math>3!P</math>. We have <math>\lambda(2P)=\lambda(14,-53)=-593/106\ (\mathrm{mod}\ n)</math>. Since <math>\gcd(106,455839)=1</math>, the modular inverse of 106 exists. Using the [[extended Euclidean algorithm]], we can obtain that <math>\lambda=-593/106=322522\ (\mathrm{mod}\ 455839)</math>.
Given this, we can compute the coordinates of <math>2(2P)</math>, just as we did above. The coordinates of point <math>4P=(x',y')</math> are
We can similarly compute 4!''P'', and so on, but 8!''P'' requires inverting {{nowrap|1=599 (mod 455839).}} The Euclidean algorithm gives that 455839 is divisible by 599, and we have found a {{nowrap|1=factorization 455839 = 599·761.}}▼
:<math>x'=322522^2-2(14)=259851\pmod{455839}</math>
:<math>y'=322522(14-259851)-(-53)=116255\pmod{455839}</math>
This yields <math>4P=(259851,116255)</math>.
After this, we can compute <math>3(2P) = 4P + 2P</math> using [[Elliptic_curve_point_multiplication#Point_addition|point addition]]. The line joining <math>4P</math> and <math>2P</math> has slope <math>\lambda=116308/259837=206097\ (\mathrm{mod}\ n)</math>, so the coordinates of <math>6P=(x',y')</math> are
The reason that this worked is that the curve {{nowrap|1=(mod 599)}} has {{nowrap|1=640 = 2<sup>7</sup>·5}} points, while {{nowrap|1=(mod 761)}} it has {{nowrap|1=777 = 3·7·37}} points. Moreover, 640 and 777 are the smallest positive integers ''k'' such that {{math|1=''kP'' = ∞}} on the curve {{nowrap|1=(mod 599)}} and {{math|1=(mod 761),}} respectively. Since {{nowrap|8!}} is a multiple of 640 but not a multiple of 777, we have {{math|1=8!''P'' = ∞}} on the curve {{nowrap|1=(mod 599),}} but not on the curve {{nowrap|1=(mod 761),}} hence the repeated addition broke down here, yielding the factorization.▼
:<math>x'=206097^2-14-259851=179685\pmod{455839}</math>
:<math>y'=206097(14-179685)-(-53)=427131\pmod{455839}</math>
yielding the point <math>6P=(179685,427131)</math>
▲We can similarly compute points <math>4!
▲The reason
==The algorithm with projective coordinates==
Before considering the projective plane over <math>(\Z/n\Z)/\sim,</math> first consider a 'normal' [[projective space]] over
In the algorithm, only the group structure of an elliptic curve over the field
We now state the algorithm in projective coordinates. The neutral element is then given by the point at infinity <math>(0:1:0)</math>. Let {{mvar|n}} be a (positive) integer and consider the elliptic curve (a set of points with some structure on it) <math>E(\Z/n\Z)=\{(x:y:z) \in \mathbb{P}^2\ |\ y^2z=x^3+axz^2+bz^3\}</math>.
Line 117 ⟶ 130:
==GMP-ECM and EECM-MPFQ==
The use of Twisted Edwards elliptic curves, as well as other techniques were used by Bernstein et al<ref name=Bernstein2008 /> to provide an optimized implementation of ECM. Its only drawback is that it works on smaller composite numbers than the more general purpose implementation, GMP-ECM of
==Hyperelliptic-curve method (HECM)==
Line 133 ⟶ 146:
*{{cite book |last=Cohen |first=Henri |title=A Course in Computational Algebraic Number Theory |volume=138 |publisher=Springer-Verlag |___location=Berlin |year=1993 |isbn=978-0-387-55640-6 | mr=1228206 | doi=10.1007/978-3-662-02945-9|series=Graduate Texts in Mathematics |s2cid=118037646 }}
*{{cite journal |last=Cosset |first=R. |title=Factorization with genus 2 curves |journal=Mathematics of Computation |volume=79 |issue=270 |year=2010 |pages=1191–1208 |doi=10.1090/S0025-5718-09-02295-9 | mr=2600562|arxiv=0905.2325 |bibcode=2010MaCom..79.1191C |s2cid=914296 }}
*{{cite book |editor1-link=Arjen Lenstra |editor1-last=Lenstra |editor1-first=A. K. |editor2-last=Lenstra Jr. |editor2-first=H. W. |title=The development of the number field sieve |series=Lecture Notes in Mathematics |volume=1554 |publisher=Springer-Verlag |___location=Berlin |year=1993 |pages=11–42 |mr=1321216 | doi=10.1007/BFb0091534|isbn=978-3-540-57013-4 |url=http://infoscience.epfl.ch/record/164684 }}
*{{cite journal |last=Lenstra Jr. |first=H. W. |title=Factoring integers with elliptic curves |journal=[[Annals of Mathematics]] |volume=126 |year=1987 |issue=3 |pages=649–673 |mr=0916721 |doi=10.2307/1971363 |url=https://openaccess.leidenuniv.nl/bitstream/handle/1887/2140/346_079.pdf?sequence=1 |jstor=1971363 |hdl=1887/2140 |hdl-access=free }}
*{{cite book
Line 170 ⟶ 183:
* [http://ecm.gforge.inria.fr/ GMP-ECM] {{Webarchive|url=https://web.archive.org/web/20090912000929/http://ecm.gforge.inria.fr/ |date=2009-09-12 }}, an efficient implementation of ECM.
* [http://www.loria.fr/~zimmerma/records/ecmnet.html ECMNet], an easy client-server implementation that works with several factorization projects.
* [
* [http://www.rechenkraft.net/yoyo/ Distributed computing project yoyo@Home] Subproject ECM is a program for Elliptic Curve Factorization which is used to find factors for different kinds of numbers.
* [https://web.archive.org/web/20130811025532/http://ardoino.com/2008/03/large-integers-factorization/ Lenstra Elliptic Curve Factorization algorithm source code] Simple C and GMP Elliptic Curve Factorization Algorithm source code.
|