Algorithm Search⌘K

Proofs: Weil descent attack

These are the human proofs of Weil descent attack, at full length.

Correctness of the Weil descent attack full

This proof shows: correctness, termination.

Let K=Fq2K = \mathbb{F}_{q^2} with Frobenius σ\sigma, let E:y2=g(x)(x−β)E : y^2 = g(x)(x - \beta) be as on the page, T2=(β,0)T_2 = (\beta, 0), and let C0:Y2=H(u)C_0 : Y^2 = H(u) with H=−(T−2u)G(u)H = -(T - 2u)G(u). The code checks that HH is squarefree of degree 55, so C0C_0 is a smooth curve of genus 22 with one point ∞\infty at infinity. JJ is its Jacobian, and we use the standard facts on Mumford representation (Cantor, Mumford): every class of degree 00 is [D−(deg⁡D)∞][D - (\deg D)\infty] for a unique reduced divisor DD, and semi-reduced divisors DD correspond to pairs [U,V][U, V] with UU monic, deg⁡V<deg⁡U\deg V < \deg U and U∣H−V2U \mid H - V^2, where DD is the divisor of the ideal (U(u),Y−V(u))(U(u), Y - V(u)). Cantor's algorithm computes the sum of classes in this form. Since C0C_0 is defined over Fq\mathbb{F}_q, σ\sigma acts on classes over KK by acting on the coefficients of UU and VV, and a class fixed by σ\sigma has a reduced pair with coefficients in Fq\mathbb{F}_q, by uniqueness. For termination we treat the draws of line L15 as independent and uniform.

Lemma 1 (the frame). For each prime power re ∥ nr^e \,\|\, n put ur=n/reu_r = n / r^e, Pr=urPP_r = u_r P and Qr=urQQ_r = u_r Q. If nQ=OnQ = O, then Q∈⟨P⟩Q \in \langle P \rangle if and only if Qr∈⟨Pr⟩Q_r \in \langle P_r \rangle for every rr. In that case, if xrPr=Qrx_r P_r = Q_r for every rr, the xx of line L9 satisfies xP=QxP = Q, and it is the only such xx in [0,n)[0, n).

Proof. The uru_r have greatest common divisor 11, so there are integers wrw_r with ∑rwrur=1\sum_r w_r u_r = 1. If Q=yPQ = yP, then Qr=yPrQ_r = y P_r. Conversely, if Qr=xrPrQ_r = x_r P_r for every rr, then Q=∑rwrurQ=∑rwrQrQ = \sum_r w_r u_r Q = \sum_r w_r Q_r. For x≡xr(modre)x \equiv x_r \pmod{r^e}, xPr=xrPrx P_r = x_r P_r because PrP_r has order rer^e, so xP=∑rwrxPr=∑rwrQr=QxP = \sum_r w_r x P_r = \sum_r w_r Q_r = Q. Uniqueness in [0,n)[0, n) holds since PP has order nn. □\square

Lemma 2 (the cover). The map φ(u,Y)=((Nβ−u2)/(T−2u), Y(u−β)/(T−2u)2)\varphi(u, Y) = \big((N_\beta - u^2)/(T - 2u),\ Y(u - \beta)/(T - 2u)^2\big) sends C0C_0 to EE. It has degree 22, φ∗(O)=W+∞\varphi^*(O) = W + \infty with W=(T/2,0)W = (T/2, 0), and φ∗(T2)=B+ιB\varphi^*(T_2) = B + \iota B with B=(β,YB)B = (\beta, Y_B) and ι\iota the hyperelliptic involution.

Proof. Put x(u)=(Nβ−u2)/(T−2u)x(u) = (N_\beta - u^2)/(T - 2u). Since T=β+βqT = \beta + \beta^q and Nβ=ββqN_\beta = \beta \beta^q, we have βT−Nβ=β2\beta T - N_\beta = \beta^2, so x(u)−β=−(u−β)2/(T−2u)x(u) - \beta = -(u - \beta)^2/(T - 2u). Also (T−2u)2g(x(u))=G(u)(T - 2u)^2 g(x(u)) = G(u) by expanding. Hence g(x)(x−β)=−G(u)(u−β)2/(T−2u)3=H(u)(u−β)2/(T−2u)4g(x)(x - \beta) = -G(u)(u - \beta)^2/(T - 2u)^3 = H(u)(u - \beta)^2/(T - 2u)^4, which is the square of the second coordinate when Y2=H(u)Y^2 = H(u). The function x∘φx \circ \varphi has degree 22 in uu, which has degree 22 on C0C_0, and y∘φy \circ \varphi determines YY from uu, so φ\varphi has degree 22. The poles of x∘φx \circ \varphi lie at u=T/2u = T/2 and u=∞u = \infty. Here H(T/2)=0H(T/2) = 0, so u=T/2u = T/2 is the single point WW, and ∞\infty is a single point. The fibre over OO has degree 22 and contains both, so φ∗(O)=W+∞\varphi^*(O) = W + \infty. The zeros of x∘φ−βx \circ \varphi - \beta are where u=βu = \beta, that is at BB and ιB\iota B. They are distinct, because H(β)=−(T−2β)G(β)≠0H(\beta) = -(T - 2\beta)G(\beta) \ne 0: T−2β=βq−β≠0T - 2\beta = \beta^q - \beta \ne 0, and G(β)=(T−2β)2g(β)≠0G(\beta) = (T - 2\beta)^2 g(\beta) \ne 0 since x(β)=βx(\beta) = \beta. Both points map to T2T_2, and the fibre has degree 22. □\square

Lemma 3 (the descent map). Let ψ′(R)=(1+σ) φ∗[R−O]\psi'(R) = (1 + \sigma)\,\varphi^*[R - O]. Then ψ′\psi' is a homomorphism from E(K)E(K) to J(Fq)J(\mathbb{F}_q), and lines L10 to L12 compute ψ′(R)\psi'(R) for every R∈E(K)R \in E(K).

Proof. R↦[R−O]R \mapsto [R - O] is a group isomorphism from E(K)E(K) to the classes of degree 00 on EE over KK, and φ∗\varphi^* and σ\sigma are group homomorphisms on classes. So ψ′\psi' is a homomorphism, and its values are fixed by σ\sigma because σ2\sigma^2 is the identity on classes defined over KK. So they lie in J(Fq)J(\mathbb{F}_q). Since div⁡(u−T/2)=2W−2∞\operatorname{div}(u - T/2) = 2W - 2\infty, the class ω=[W−∞]\omega = [W - \infty] has 2ω=02\omega = 0, and σω=ω\sigma \omega = \omega because WW is defined over Fq\mathbb{F}_q. So (1+σ)ω=0(1 + \sigma)\omega = 0.

For R=OR = O, ψ′(O)=0\psi'(O) = 0. For R=T2R = T_2, Lemma 2 gives φ∗[T2−O]=[B+ιB−W−∞]\varphi^*[T_2 - O] = [B + \iota B - W - \infty], and B+ιB−2∞=div⁡(u−β)B + \iota B - 2\infty = \operatorname{div}(u - \beta), so this class is [∞−W]=ω[\infty - W] = \omega, and ψ′(T2)=0\psi'(T_2) = 0. This is line L10.

Let now R=(xR,yR)≠T2R = (x_R, y_R) \ne T_2. On the open set C′={T−2u≠0, u≠β}C' = \{T - 2u \ne 0,\ u \ne \beta\} of C0C_0 over KK, φ\varphi is given by regular functions. By Lemma 2 the points outside C′C' map to OO or T2T_2, so the fibre over RR lies in C′C', and φ∗(R)\varphi^*(R) is the divisor of the ideal I=(x∘φ−xR, y∘φ−yR)I = (x \circ \varphi - x_R,\ y \circ \varphi - y_R) in the coordinate ring of C′C'. Now x∘φ−xR=−U(u)/(T−2u)x \circ \varphi - x_R = -U(u)/(T - 2u) with the UU of line L11, and T−2uT - 2u is a unit on C′C'. Also y∘φ−yR=(u−β)(T−2u)−2(Y−yR(T−2u)2(u−β)−1)y \circ \varphi - y_R = (u - \beta)(T - 2u)^{-2}\big(Y - y_R (T - 2u)^2 (u - \beta)^{-1}\big) with a unit in front. The roots of UU are not β\beta, because x(β)=β≠xRx(\beta) = \beta \ne x_R, so u−βu - \beta is invertible modulo UU, and the polynomial VV of line L11 is congruent to yR(T−2u)2(u−β)−1y_R (T - 2u)^2 (u - \beta)^{-1} modulo UU in the ring of C′C'. So I=(U(u),Y−V(u))I = (U(u), Y - V(u)). It contains (Y−V)(Y+V)=H−V2(Y - V)(Y + V) = H - V^2, so U∣H−V2U \mid H - V^2, and [U,V][U, V] is the Mumford pair of φ∗(R)\varphi^*(R). Its class is [φ∗(R)−2∞]=φ∗[R−O]+[W+∞−2∞]=φ∗[R−O]+ω[\varphi^*(R) - 2\infty] = \varphi^*[R - O] + [W + \infty - 2\infty] = \varphi^*[R - O] + \omega. Line L12 returns [U,V]+σ[U,V]=ψ′(R)+(1+σ)ω=ψ′(R)[U, V] + \sigma[U, V] = \psi'(R) + (1 + \sigma)\omega = \psi'(R). □\square

Lemma 4 (rows are true). If line L16 produces a row ee for a class R=[U,V]R = [U, V], then R=∑u0∈Beu0Fu0R = \sum_{u_0 \in \mathcal{B}} e_{u_0} F_{u_0} in J(Fq)J(\mathbb{F}_q).

Proof. If U=1U = 1, then R=0R = 0 and the row is empty. Otherwise the reduced divisor of RR is D=∑i(ui,V(ui))D = \sum_i (u_i, V(u_i)) over the roots ui∈Fqu_i \in \mathbb{F}_q of UU with multiplicity, and R=∑i[(ui,V(ui))−∞]R = \sum_i [(u_i, V(u_i)) - \infty]. From U∣H−V2U \mid H - V^2 we get V(ui)2=H(ui)V(u_i)^2 = H(u_i), so ui∈Bu_i \in \mathcal{B} and V(ui)=±YuiV(u_i) = \pm Y_{u_i}. Since (ui,Y)+(ui,−Y)−2∞=div⁡(u−ui)(u_i, Y) + (u_i, -Y) - 2\infty = \operatorname{div}(u - u_i), the term is ±Fui\pm F_{u_i} with that sign. If Yui=0Y_{u_i} = 0 the two signs give the same class, and the root is simple, because (u−ui)2∣H−0(u - u_i)^2 \mid H - 0 is impossible for squarefree HH. A double root with V(ui)≠0V(u_i) \ne 0 gives ±2Fui\pm 2F_{u_i}. □\square

Lemma 5 (elimination). After kk relations have been processed in lines L18 to L20, every stored row vv satisfies v≡∑ici(v)ei(modr)v \equiv \sum_i c^{(v)}_i e_i \pmod r for the combination c(v)c^{(v)} kept with it, every dependency cc found satisfies ∑iciei≡0\sum_i c_i e_i \equiv 0, and the dependencies found so far form a basis of the left kernel {c∈(Z/r)k:∑iciei≡0}\{c \in (\mathbb{Z}/r)^k : \sum_i c_i e_i \equiv 0\}.

Proof. A new row eke_k starts with the unit vector at kk as its combination. Line L18 subtracts multiples of stored rows together with their combinations, and line L20 scales both by the same unit, so the relation is kept. The stored rows have distinct leading columns and zeros before them, and the new row is reduced column by column in increasing order, so a nonzero result has a new leading column. Hence the stored rows stay in echelon form, are independent, and span the same space as e1,…,eke_1, \dots, e_k, so their number is the rank ρk\rho_k. Each relation adds a stored row or a dependency, so k−ρkk - \rho_k dependencies were found. The one found at relation jj has coefficient 11 at jj and 00 after jj, so they are independent, and the left kernel has dimension k−ρkk - \rho_k. □\square

Lemma 6 (a dependency gives the logarithm). Let D1∈J(Fq)D_1 \in J(\mathbb{F}_q) have order rr with r ∥ #J(Fq)r \,\|\, \#J(\mathbb{F}_q), and D2=x∗D1D_2 = x^* D_1. If cc is a dependency with A=∑iciaiA = \sum_i c_i a_i and C=∑icibiC = \sum_i c_i b_i, then A+x∗C≡0(modr)A + x^* C \equiv 0 \pmod r. So if C≢0C \not\equiv 0, line L19 returns x∗ mod rx^* \bmod r.

Proof. Take the cic_i as integers in [0,r)[0, r). By Lemma 4, ∑iciRi=∑u0(∑iciei,u0)Fu0=r∑u0wu0Fu0\sum_i c_i R_i = \sum_{u_0} \big(\sum_i c_i e_{i, u_0}\big) F_{u_0} = r \sum_{u_0} w_{u_0} F_{u_0} for integers wu0w_{u_0}. Let h=#J(Fq)/rh = \#J(\mathbb{F}_q)/r. Then h∑iciRi=0h \sum_i c_i R_i = 0. On the other side, Ri=(ai+x∗bi)D1+rci′Fu∗R_i = (a_i + x^* b_i) D_1 + r c'_i F_{u^*} with the ci′c'_i drawn at line L15, so h∑iciRi=h(A+x∗C)D1+#J(Fq)∑icici′Fu∗=h(A+x∗C)D1h \sum_i c_i R_i = h(A + x^* C) D_1 + \#J(\mathbb{F}_q) \sum_i c_i c'_i F_{u^*} = h(A + x^* C) D_1. Hence r∣h(A+x∗C)r \mid h(A + x^* C), and r∤hr \nmid h. □\square

Lemma 7 (termination of GAUDRY). Under the hypotheses of Lemma 6, GAUDRY stops with probability 11, and the expected number of draws is finite.

Proof. Let m=#J(Fq)/rm = \#J(\mathbb{F}_q)/r and write ord⁡(Fu∗)=rεm′\operatorname{ord}(F_{u^*}) = r^{\varepsilon} m' with ε∈{0,1}\varepsilon \in \{0, 1\}, m′∣mm' \mid m and r∤m′r \nmid m'. Choose c∗∈[0,m′)c^* \in [0, m') with rc∗≡1(modm′)r c^* \equiv 1 \pmod{m'}. Then (1−rc∗)Fu∗(1 - r c^*) F_{u^*} has order dividing rr, and the elements of order dividing rr form a subgroup of the Sylow rr-subgroup, which has order rr, so it is ⟨D1⟩\langle D_1 \rangle. Write (1−rc∗)Fu∗=λD1(1 - r c^*) F_{u^*} = \lambda D_1. For each b∈[0,r)b \in [0, r), the draw a≡λ−bx∗a \equiv \lambda - b x^*, bj=bb_j = b and cj=c∗c_j = c^* gives Rj=λD1+rc∗Fu∗=Fu∗=[u−u∗,Yu∗]R_j = \lambda D_1 + r c^* F_{u^*} = F_{u^*} = [u - u^*, Y_{u^*}], whose row is +1+1 at u∗u^*. So each draw gives this row with a given bj=bb_j = b with probability at least 1/(r2m)1/(r^2 m), independently of the other draws. With probability 11 there are eventually draws j<kj < k with this row and bj≠bkb_j \ne b_k, after a finite expected number of draws. The vector cc with 11 at kk and −1-1 at jj is in the left kernel after relation kk, with ∑icibi=bk−bj≠0\sum_i c_i b_i = b_k - b_j \ne 0. CC is linear in cc, and by Lemma 5 the dependencies found by then form a basis of the kernel, so one of them has C≠0C \ne 0. Line L19 stops at the first such dependency. □\square

Correctness. If nQ≠OnQ \ne O, then Q∉⟨P⟩Q \notin \langle P \rangle and line L2 returns NONE correctly. Otherwise take a prime power re ∥ nr^e \,\|\, n. If the test of line L5 fails, baby-step giant-step on ⟨Pr⟩\langle P_r \rangle, of order rer^e, returns xrx_r with xrPr=Qrx_r P_r = Q_r or reports correctly that Qr∉⟨Pr⟩Q_r \notin \langle P_r \rangle. If it holds, then e=1e = 1, and D1=ψ(Pr)≠0D_1 = \psi(P_r) \ne 0 has rD1=ψ(rPr)=0r D_1 = \psi(r P_r) = 0 by Lemma 3, so D1D_1 has order rr, and r ∥ #J(Fq)r \,\|\, \#J(\mathbb{F}_q). Also rψ(Qr)=ψ(nQ)=0r \psi(Q_r) = \psi(nQ) = 0, so ψ(Qr)\psi(Q_r) lies in the subgroup of elements of order dividing rr, which is ⟨D1⟩\langle D_1 \rangle as in Lemma 7. By Lemmas 6 and 7, GAUDRY returns yy with ψ(Qr)=yD1\psi(Q_r) = y D_1. If Qr=y′PrQ_r = y' P_r, then y′D1=ψ(Qr)=yD1y' D_1 = \psi(Q_r) = y D_1, so y≡y′(modr)y \equiv y' \pmod r and line L7 accepts xr=yx_r = y. If Qr∉⟨Pr⟩Q_r \notin \langle P_r \rangle, then yPr≠Qry P_r \ne Q_r and line L7 returns NONE, which is correct by Lemma 1. When every prime power passes, Lemma 1 shows that line L9 returns the unique x∈[0,n)x \in [0, n) with xP=QxP = Q.

Termination. The loop of line L3 runs once for each prime dividing nn, baby-step giant-step terminates, and GAUDRY terminates with probability 11 by Lemma 7. ■\blacksquare

Back to Weil descent attack