Correctness of the Weil descent attack full
This proof shows: correctness, termination.
Let K=Fq2 with Frobenius σ, let E:y2=g(x)(x−β) be as on the page, T2=(β,0), and let C0:Y2=H(u) with H=−(T−2u)G(u). The code checks that H is squarefree of degree 5, so C0 is a smooth curve of genus 2 with one point ∞ at infinity. J is its Jacobian, and we use the standard facts on Mumford representation (Cantor, Mumford): every class of degree 0 is [D−(degD)∞] for a unique reduced divisor D, and semi-reduced divisors D correspond to pairs [U,V] with U monic, degV<degU and U∣H−V2, where D is the divisor of the ideal (U(u),Y−V(u)). Cantor's algorithm computes the sum of classes in this form. Since C0 is defined over Fq, σ acts on classes over K by acting on the coefficients of U and V, and a class fixed by σ has a reduced pair with coefficients in Fq, by uniqueness. For termination we treat the draws of line L15 as independent and uniform.
Lemma 1 (the frame). For each prime power re∥n put ur=n/re, Pr=urP and Qr=urQ. If nQ=O, then Q∈⟨P⟩ if and only if Qr∈⟨Pr⟩ for every r. In that case, if xrPr=Qr for every r, the x of line L9 satisfies xP=Q, and it is the only such x in [0,n).
Proof. The ur have greatest common divisor 1, so there are integers wr with ∑rwrur=1. If Q=yP, then Qr=yPr. Conversely, if Qr=xrPr for every r, then Q=∑rwrurQ=∑rwrQr. For x≡xr(modre), xPr=xrPr because Pr has order re, so xP=∑rwrxPr=∑rwrQr=Q. Uniqueness in [0,n) holds since P has order n. □
Lemma 2 (the cover). The map φ(u,Y)=((Nβ−u2)/(T−2u), Y(u−β)/(T−2u)2) sends C0 to E. It has degree 2, φ∗(O)=W+∞ with W=(T/2,0), and φ∗(T2)=B+ιB with B=(β,YB) and ι the hyperelliptic involution.
Proof. Put x(u)=(Nβ−u2)/(T−2u). Since T=β+βq and Nβ=ββq, we have βT−Nβ=β2, so x(u)−β=−(u−β)2/(T−2u). Also (T−2u)2g(x(u))=G(u) by expanding. Hence g(x)(x−β)=−G(u)(u−β)2/(T−2u)3=H(u)(u−β)2/(T−2u)4, which is the square of the second coordinate when Y2=H(u). The function x∘φ has degree 2 in u, which has degree 2 on C0, and y∘φ determines Y from u, so φ has degree 2. The poles of x∘φ lie at u=T/2 and u=∞. Here H(T/2)=0, so u=T/2 is the single point W, and ∞ is a single point. The fibre over O has degree 2 and contains both, so φ∗(O)=W+∞. The zeros of x∘φ−β are where u=β, that is at B and ιB. They are distinct, because H(β)=−(T−2β)G(β)=0: T−2β=βq−β=0, and G(β)=(T−2β)2g(β)=0 since x(β)=β. Both points map to T2, and the fibre has degree 2. □
Lemma 3 (the descent map). Let ψ′(R)=(1+σ)φ∗[R−O]. Then ψ′ is a homomorphism from E(K) to J(Fq), and lines L10 to L12 compute ψ′(R) for every R∈E(K).
Proof. R↦[R−O] is a group isomorphism from E(K) to the classes of degree 0 on E over K, and φ∗ and σ are group homomorphisms on classes. So ψ′ is a homomorphism, and its values are fixed by σ because σ2 is the identity on classes defined over K. So they lie in J(Fq). Since div(u−T/2)=2W−2∞, the class ω=[W−∞] has 2ω=0, and σω=ω because W is defined over Fq. So (1+σ)ω=0.
For R=O, ψ′(O)=0. For R=T2, Lemma 2 gives φ∗[T2−O]=[B+ιB−W−∞], and B+ιB−2∞=div(u−β), so this class is [∞−W]=ω, and ψ′(T2)=0. This is line L10.
Let now R=(xR,yR)=T2. On the open set C′={T−2u=0, u=β} of C0 over K, φ is given by regular functions. By Lemma 2 the points outside C′ map to O or T2, so the fibre over R lies in C′, and φ∗(R) is the divisor of the ideal I=(x∘φ−xR, y∘φ−yR) in the coordinate ring of C′. Now x∘φ−xR=−U(u)/(T−2u) with the U of line L11, and T−2u is a unit on C′. Also y∘φ−yR=(u−β)(T−2u)−2(Y−yR(T−2u)2(u−β)−1) with a unit in front. The roots of U are not β, because x(β)=β=xR, so u−β is invertible modulo U, and the polynomial V of line L11 is congruent to yR(T−2u)2(u−β)−1 modulo U in the ring of C′. So I=(U(u),Y−V(u)). It contains (Y−V)(Y+V)=H−V2, so U∣H−V2, and [U,V] is the Mumford pair of φ∗(R). Its class is [φ∗(R)−2∞]=φ∗[R−O]+[W+∞−2∞]=φ∗[R−O]+ω. Line L12 returns [U,V]+σ[U,V]=ψ′(R)+(1+σ)ω=ψ′(R). □
Lemma 4 (rows are true). If line L16 produces a row e for a class R=[U,V], then R=∑u0∈Beu0Fu0 in J(Fq).
Proof. If U=1, then R=0 and the row is empty. Otherwise the reduced divisor of R is D=∑i(ui,V(ui)) over the roots ui∈Fq of U with multiplicity, and R=∑i[(ui,V(ui))−∞]. From U∣H−V2 we get V(ui)2=H(ui), so ui∈B and V(ui)=±Yui. Since (ui,Y)+(ui,−Y)−2∞=div(u−ui), the term is ±Fui with that sign. If Yui=0 the two signs give the same class, and the root is simple, because (u−ui)2∣H−0 is impossible for squarefree H. A double root with V(ui)=0 gives ±2Fui. □
Lemma 5 (elimination). After k relations have been processed in lines L18 to L20, every stored row v satisfies v≡∑ici(v)ei(modr) for the combination c(v) kept with it, every dependency c found satisfies ∑iciei≡0, and the dependencies found so far form a basis of the left kernel {c∈(Z/r)k:∑iciei≡0}.
Proof. A new row ek starts with the unit vector at k 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,…,ek, so their number is the rank ρk. Each relation adds a stored row or a dependency, so k−ρk dependencies were found. The one found at relation j has coefficient 1 at j and 0 after j, so they are independent, and the left kernel has dimension k−ρk. □
Lemma 6 (a dependency gives the logarithm). Let D1∈J(Fq) have order r with r∥#J(Fq), and D2=x∗D1. If c is a dependency with A=∑iciai and C=∑icibi, then A+x∗C≡0(modr). So if C≡0, line L19 returns x∗modr.
Proof. Take the ci as integers in [0,r). By Lemma 4, ∑iciRi=∑u0(∑iciei,u0)Fu0=r∑u0wu0Fu0 for integers wu0. Let h=#J(Fq)/r. Then h∑iciRi=0. On the other side, Ri=(ai+x∗bi)D1+rci′Fu∗ with the ci′ drawn at line L15, so h∑iciRi=h(A+x∗C)D1+#J(Fq)∑icici′Fu∗=h(A+x∗C)D1. Hence r∣h(A+x∗C), and r∤h. □
Lemma 7 (termination of GAUDRY). Under the hypotheses of Lemma 6, GAUDRY stops with probability 1, and the expected number of draws is finite.
Proof. Let m=#J(Fq)/r and write ord(Fu∗)=rεm′ with ε∈{0,1}, m′∣m and r∤m′. Choose c∗∈[0,m′) with rc∗≡1(modm′). Then (1−rc∗)Fu∗ has order dividing r, and the elements of order dividing r form a subgroup of the Sylow r-subgroup, which has order r, so it is ⟨D1⟩. Write (1−rc∗)Fu∗=λD1. For each b∈[0,r), the draw a≡λ−bx∗, bj=b and cj=c∗ gives Rj=λD1+rc∗Fu∗=Fu∗=[u−u∗,Yu∗], whose row is +1 at u∗. So each draw gives this row with a given bj=b with probability at least 1/(r2m), independently of the other draws. With probability 1 there are eventually draws j<k with this row and bj=bk, after a finite expected number of draws. The vector c with 1 at k and −1 at j is in the left kernel after relation k, with ∑icibi=bk−bj=0. C is linear in c, and by Lemma 5 the dependencies found by then form a basis of the kernel, so one of them has C=0. Line L19 stops at the first such dependency. □
Correctness. If nQ=O, then Q∈/⟨P⟩ and line L2 returns NONE correctly. Otherwise take a prime power re∥n. If the test of line L5 fails, baby-step giant-step on ⟨Pr⟩, of order re, returns xr with xrPr=Qr or reports correctly that Qr∈/⟨Pr⟩. If it holds, then e=1, and D1=ψ(Pr)=0 has rD1=ψ(rPr)=0 by Lemma 3, so D1 has order r, and r∥#J(Fq). Also rψ(Qr)=ψ(nQ)=0, so ψ(Qr) lies in the subgroup of elements of order dividing r, which is ⟨D1⟩ as in Lemma 7. By Lemmas 6 and 7, GAUDRY returns y with ψ(Qr)=yD1. If Qr=y′Pr, then y′D1=ψ(Qr)=yD1, so y≡y′(modr) and line L7 accepts xr=y. If Qr∈/⟨Pr⟩, then yPr=Qr 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) with xP=Q.
Termination. The loop of line L3 runs once for each prime dividing n, baby-step giant-step terminates, and GAUDRY terminates with probability 1 by Lemma 7. ■