Algorithm Search⌘K

Proofs: Elliptic curve factorization method

These are the human proofs of Elliptic curve factorization method, at full length.

Correctness of the elliptic curve method full

This proof shows: correctness, termination.

Throughout, N>1N > 1 with gcd⁡(N,6)=1\gcd(N, 6) = 1, and a curve y2=x3+ax+by^2 = x^3 + ax + b with gcd⁡(4a3+27b2,N)=1\gcd(4a^3 + 27b^2, N) = 1 is fixed, as after line L3. For a prime p∣Np \mid N, p≥5p \ge 5 and 4a3+27b2≢0(modp)4a^3 + 27b^2 \not\equiv 0 \pmod p, so the curve modulo pp is an elliptic curve and its points form the group E(Fp)E(\mathbb{F}_p) under the chord and tangent rules, with zero OpO_p. For a point P=(x,y)P = (x, y) modulo NN write Pp=(x mod p,y mod p)P_p = (x \bmod p, y \bmod p), and OO reduces to OpO_p.

The addition P1+P2P_1 + P_2 of the algorithm is: O+P2=P2O + P_2 = P_2 and P1+O=P1P_1 + O = P_1; otherwise (case 1) if x1≢x2(modN)x_1 \not\equiv x_2 \pmod N, the slope λ=(y2−y1)d−1\lambda = (y_2 - y_1) d^{-1} with d=x2−x1d = x_2 - x_1; (case 2) if x1≡x2x_1 \equiv x_2 and y1+y2≡0(modN)y_1 + y_2 \equiv 0 \pmod N, the sum OO; (case 3) otherwise the slope λ=(3x12+a)d−1\lambda = (3x_1^2 + a) d^{-1} with d=y1+y2d = y_1 + y_2. In cases 1 and 3 the addition fails if gcd⁡(d,N)>1\gcd(d, N) > 1, and otherwise returns (λ2−x1−x2,λ(x1−x3)−y1)(\lambda^2 - x_1 - x_2, \lambda(x_1 - x_3) - y_1) modulo NN.

Lemma 1 (reduction). Let pp be a prime factor of NN, and let P1,P2P_1, P_2 be OO or pairs modulo NN such that (P1)p(P_1)_p and (P2)p(P_2)_p are in E(Fp)E(\mathbb{F}_p). If the addition P1+P2P_1 + P_2 does not fail, then (P1+P2)p=(P1)p+(P2)p(P_1 + P_2)_p = (P_1)_p + (P_2)_p in E(Fp)E(\mathbb{F}_p).

Proof. If P1P_1 or P2P_2 is OO this is the rule for the zero. Case 1: dd is invertible modulo NN, hence modulo pp, so x1≢x2(modp)x_1 \not\equiv x_2 \pmod p, and the group law in E(Fp)E(\mathbb{F}_p) uses the chord slope (y2−y1)(x2−x1)−1(y_2 - y_1)(x_2 - x_1)^{-1}, which is λ mod p\lambda \bmod p; the formulas for x3x_3 and y3y_3 reduce to those of the group law. Case 2: x1≡x2x_1 \equiv x_2 and y1≡−y2(modp)y_1 \equiv -y_2 \pmod p, so (P1)p=−(P2)p(P_1)_p = -(P_2)_p and the sum is OpO_p. Case 3: d=y1+y2d = y_1 + y_2 is invertible modulo NN, hence y1+y2≢0(modp)y_1 + y_2 \not\equiv 0 \pmod p. Both reduced points lie on the curve modulo pp and x1≡x2x_1 \equiv x_2, so y12≡x13+ax1+b≡y22y_1^2 \equiv x_1^3 + ax_1 + b \equiv y_2^2, and (y1−y2)(y1+y2)≡0(modp)(y_1 - y_2)(y_1 + y_2) \equiv 0 \pmod p gives y1≡y2(modp)y_1 \equiv y_2 \pmod p. So (P1)p=(P2)p(P_1)_p = (P_2)_p with 2y1≡y1+y2≢02y_1 \equiv y_1 + y_2 \not\equiv 0, and the group law uses the tangent slope (3x12+a)(2y1)−1≡λ(modp)(3x_1^2 + a)(2y_1)^{-1} \equiv \lambda \pmod p. The formulas for x3,y3x_3, y_3 again reduce to those of the group law. □\square

Lemma 2 (multiples). Let PP be a point modulo NN with Pp∈E(Fp)P_p \in E(\mathbb{F}_p) for every prime p∣Np \mid N. If the computation of [m]P[m]P by double and add (or of [m]P[m]P as a chain of additions of earlier computed multiples, as in stage two) does not fail, then its result RR satisfies Rp=[m]PpR_p = [m]P_p in E(Fp)E(\mathbb{F}_p) for every prime p∣Np \mid N.

Proof. By induction over the additions of the chain. Every intermediate point is a sum of two earlier points of the chain, each of which reduces modulo pp to the corresponding multiple of PpP_p, which is in E(Fp)E(\mathbb{F}_p). Lemma 1 then shows that the sum reduces to the sum of the multiples. Double and add computes [2j][2j] from [j][j] and [j+1][j + 1] from [j][j] and [1][1], so the final point reduces to [m]Pp[m]P_p. □\square

The point P=(x,y)P = (x, y) of line L2 satisfies the curve equation modulo NN by the choice of bb, so modulo each pp as well, and Lemma 2 applies to it and to all its computed multiples.

Lemma 3 (detection). Let pp be a prime factor of NN and let mm be a multiplier that the algorithm computes, [m]P[m]P in stage one or [m]P[m]P with m=kqim = k q_i in stage two. If the order of PpP_p in E(Fp)E(\mathbb{F}_p) divides mm, then the computation of [m]P[m]P fails, or it gives the point OO modulo NN, or an earlier step does one of these.

Proof. Suppose no step fails and the result RR is a pair (x,y)(x, y). By Lemma 2, Rp=[m]Pp=OpR_p = [m]P_p = O_p, as the order divides mm. But the reduction of a pair is a pair, not OpO_p. This contradiction shows that a step fails or R=OR = O. □\square

Lemma 4 (a failure gives a proper factor). If an addition fails, then 1<gcd⁡(d,N)<N1 < \gcd(d, N) < N.

Proof. A failure means gcd⁡(d,N)>1\gcd(d, N) > 1. In case 1, d=x2−x1≢0(modN)d = x_2 - x_1 \not\equiv 0 \pmod N by the case condition, so N∤dN \nmid d and gcd⁡(d,N)<N\gcd(d, N) < N. In case 3, d=y1+y2≢0(modN)d = y_1 + y_2 \not\equiv 0 \pmod N, since d≡0d \equiv 0 would be case 2, so again gcd⁡(d,N)<N\gcd(d, N) < N. The test g<Ng < N of line L6 is therefore a safeguard that never rejects. □\square

Theorem. ECM stops, and it returns 11 or a proper factor gg of NN. If for some curve and some prime p∣Np \mid N the order of PpP_p divides kk, or divides kqkq for a prime q∈(B1,B2]q \in (B_1, B_2], then that curve ends in a failure that returns a proper factor, or with a point OO modulo NN.

Proof. Termination. There are CC curves. For each, line L4 does ∑qeq\sum_q e_q multiplications with O(log⁡q)O(\log q) additions each, and line L5 builds a table of at most G/2G/2 points and does one addition per prime in (B1,B2](B_1, B_2], so each curve does finitely many additions, each of finitely many operations modulo NN.

Correctness. Line L3 returns g=gcd⁡(4a3+27b2,N)g = \gcd(4a^3 + 27b^2, N) only if 1<g<N1 < g < N. Line L6 returns g=gcd⁡(d,N)g = \gcd(d, N) only if 1<g<N1 < g < N, and a gcd with NN divides NN. So any value returned other than 11 is a proper factor. A prime NN has none, so then the output is 11.

Detection. Stage one computes [q][q] of the current point for each prime power step, so its last point is [k]P[k]P; stage two computes [qi]([k]P)=[kqi]P[q_i]([k]P) = [kq_i]P by the chain [kq1]P[k q_1]P, [kq1]P+[k(q2−q1)]P[k q_1]P + [k(q_2 - q_1)]P, and so on, where each table entry [2j]([k]P)[2j]([k]P) is a chain of additions of [2]([k]P)[2]([k]P). By Lemma 3, if the order of PpP_p divides kk or kqikq_i, a failure or the point OO happens no later than that multiple. By Lemma 4, a failure returns a proper factor. ■\blacksquare

Back to Elliptic curve factorization method