The Zcash ArboretumThe Complete Arboretum PDF

10 Elliptic curves

The multiplicative groups of the preceding sections harbour a structural weakness. As 7.22 recorded, the discrete logarithm in 𝔽p× does not resist attack at the generic square-root cost: the index-calculus family of algorithms exploits the fact that residues come from ordinary integers, and integers factor into primes, to solve the problem in subexponential time. The practical consequence is severe. To push the cheapest known attack on 𝔽p× beyond 2128 operations, the prime p must run to thousands of bits, and every exponentiation drags that bulk along. What cryptography wants instead is a group of roughly 2255 elements for which no attack faster than the square-root bound is known—a group without known exploitable arithmetic behind its elements, where the generic O⁢(N) attacks of 7.22 remain the best known. This section constructs the standard supplier of such groups.

An elliptic curve is, concretely, the solution set of a certain cubic equation in two variables, together with one extra “point at infinity”. Its notable feature is that this solution set carries the structure of an abelian group, defined by a strikingly geometric rule; and that inverting scalar multiplication in this group is hard—the discrete logarithm problem in a well-chosen elliptic-curve group appears to require exponential time. The combination of clean algebraic structure with a hard computational problem is exactly what cryptography requires.

Throughout the section we work over a field K whose characteristic (4.30) is neither 2 nor 3. In the applications K is a finite prime field 𝔽p with p a large prime, but the basic theory is cleaner over a general field, and we specialise when needed. The reader should keep in mind the two Pasta curves

Ep:y2=x3+5over ⁢𝔽p,Eq:y2=x3+5over ⁢𝔽q,

where p and q are the two 255-bit primes

p =2254+0⁢x⁢224698⁢f⁢c⁢094⁢c⁢f⁢91⁢b⁢992⁢d⁢30⁢e⁢d⁢00000001,
q =2254+0⁢x⁢224698⁢f⁢c⁢0994⁢a⁢8⁢d⁢d⁢8⁢c⁢46⁢e⁢b⁢2100000001.

These are the primes that 6.23 and 7.18 handled as black boxes; here they finally acquire their curves. The constants are the deployed ones: the primes and the curve equations y2=x3+5 are specified in §5.4.9.6 (“Pallas and Vesta”) of the Zcash protocol specification. The curve Ep, defined over 𝔽p, is called Pallas; the curve Eq, defined over 𝔽q, is called Vesta. Together they form a cycle: the number of 𝔽p-points of Pallas equals q, and the number of 𝔽q-points of Vesta equals p—a coincidence of design, not chance, whose meaning unfolds across the section. The equation y2=x3+5 serves as the running example throughout, with a toy curve over 𝔽11 developed in parallel for hand computation.

10.1 Weierstrass equations

Definition 10.1 (Short Weierstrass equation).

Let K be a field of characteristic ≠2,3, and let a,b∈K. The short Weierstrass equation with coefficients a,b is the equation

y2=x3+a⁢x+b. (9)

The elements a and b are the Weierstrass coefficients.

Over a field of characteristic ≠2,3, an invertible affine change of variables always reduces the most general cubic of this shape, y2+a1⁢x⁢y+a3⁢y=x3+a2⁢x2+a4⁢x+a6, to the form (9): completing the square in y (possible since 2≠0) removes the x⁢y and y terms but changes the quadratic coefficient to a2+a12/4; translating with the substitution x=X−(a2+a12/4)/3 (possible since 3≠0) removes the X2 term. This is precisely why characteristics 2 and 3 are excluded: those cases require the longer Weierstrass form, and they are not relevant to the Pasta curves, which live over large prime fields.

Not every choice of a,b gives a usable curve. We must exclude the cubics whose graph has a self-intersection or a cusp, because the group law defined below breaks down at such a singular point.

Definition 10.2 (Discriminant and nonsingularity).

The discriminant of the short Weierstrass equation (9) is

Δ=−16⁢(4⁢a3+27⁢b2)∈K. (10)

The equation, and the cubic f⁢(x)=x3+a⁢x+b, is nonsingular (or smooth) if Δ≠0, equivalently 4⁢a3+27⁢b2≠0. (The factor −16 is a convention inherited from the general Weierstrass form; over our fields it is nonzero and affects nothing.)

The quantity 4⁢a3+27⁢b2 is exactly the obstruction to f having distinct roots. The following lemma makes this explicit by a computation reusable for any depressed cubic—a cubic with no square term—and is the engine of the smoothness criterion.

Lemma 10.3 (Discriminant of a depressed cubic).

Let f⁢(x)=x3+a⁢x+b=(x−r1)⁢(x−r2)⁢(x−r3) with r1,r2,r3 in some field containing K. Then

∏i<j(ri−rj)2=−(4⁢a3+27⁢b2).
Proof.

Expanding (x−r1)⁢(x−r2)⁢(x−r3) and comparing coefficients with x3+a⁢x+b gives Vieta’s relations for the depressed cubic:

r1+r2+r3=0,r1⁢r2+r1⁢r3+r2⁢r3=a,r1⁢r2⁢r3=−b.

Differentiating f⁢(x)=∏i(x−ri) by the product rule and evaluating at a root kills every term but one: f′⁢(ri)=∏j≠i(ri−rj). Multiplying the three evaluations pairs each factor (ri−rj) with (rj−ri):

∏if′⁢(ri)=∏i<j(ri−rj)⁢(rj−ri)=(−1)3⁢∏i<j(ri−rj)2.

It remains to compute ∏if′⁢(ri)=∏i(3⁢ri2+a). Expanding the product and collecting the elementary symmetric functions of the squares ri2,

∏i(3⁢ri2+a)=27⁢∏iri2+9⁢a⁢∑i<jri2⁢rj2+3⁢a2⁢∑iri2+a3.

Vieta’s relations evaluate each symmetric function: with e1=0, e2=a, e3=−b,

∑iri2=e12−2⁢e2=−2⁢a,∑i<jri2⁢rj2=e22−2⁢e1⁢e3=a2,∏iri2=e32=b2.

Substituting, ∏if′⁢(ri)=27⁢b2+9⁢a3−6⁢a3+a3=4⁢a3+27⁢b2, and the two displays together give ∏i<j(ri−rj)2=−(4⁢a3+27⁢b2). □

Proposition 10.4 (Smoothness, four ways).

Let f⁢(x)=x3+a⁢x+b∈K⁢[x]. The following are equivalent.

  1. 1.

    The quantity 4⁢a3+27⁢b2 of 10.2 is nonzero.

  2. 2.

    The cubic f has no repeated root in the algebraic closure K¯—the smallest extension field of K in which every nonconstant polynomial over K factors into linear factors.

  3. 3.

    The polynomials f and f′ are coprime in K¯⁢[x].

  4. 4.

    There is no point (x0,y0)∈K¯2 satisfying the curve equation y2=f⁢(x) together with the two partial-derivative equations 2⁢y=0 and f′⁢(x)=0.

Proof.

Equivalence (1)⇔(2): over K¯ the monic cubic factors as f=(x−r1)⁢(x−r2)⁢(x−r3), and 10.3 gives ∏i<j(ri−rj)2=−(4⁢a3+27⁢b2). The left side vanishes exactly when two roots coincide, so f has a repeated root if and only if 4⁢a3+27⁢b2=0.

Equivalence (2)⇔(3): this is the derivative test of 5.40, applied over K¯ where f splits: a repeated root of f is a common root of f and f′, hence a common factor (x−α), and conversely a nontrivial gcd⁡(f,f′) has a root in K¯ which is then a repeated root of f.

Equivalence (4)⇔(2): a singular point of the affine curve y2=f⁢(x) is a point where both partial derivatives of g⁢(x,y)=y2−f⁢(x) vanish, namely ∂g/∂y=2⁢y=0 and ∂g/∂x=−f′⁢(x)=0. Since char⁡(K)≠2, the first equation forces y0=0; the curve equation then gives f⁢(x0)=0, which combined with f′⁢(x0)=0 says x0 is a repeated root of f (5.40(1)). Conversely a repeated root x0 of f yields the singular point (x0,0). □

Definition 10.5 (Elliptic curve and rational points).

An elliptic curve over K is a short Weierstrass equation (9) with nonzero discriminant, 4⁢a3+27⁢b2≠0. For any field extension L⊇K, the set of L-rational affine points is

Eaff⁢(L)={(x,y)∈L×L:y2=x3+a⁢x+b},

and the set of L-rational points is

E⁢(L)=Eaff⁢(L)∪{𝒪},

where 𝒪 is a single formal symbol called the point at infinity. When L=K one writes simply E for the curve and E⁢(K) for its rational points.

Remark 10.6 (The Pasta curves are smooth).

For the Pasta curves a=0 and b=5, so 4⁢a3+27⁢b2=27⋅25=675=33⋅52. The curve is therefore nonsingular whenever the characteristic does not divide 675, i.e. whenever the prime is neither 3 nor 5; the Pasta primes are enormous, so this is automatic. More generally, any curve y2=x3+b with b≠0 is nonsingular away from characteristics 2 and 3.

10.2 The point at infinity, geometrically

The extra point 𝒪 is not decoration; it is the identity element of the group to come, and it has an honest geometric home. To see it, view the affine plane as sitting inside the projective plane. A point of the projective plane ℙ2⁢(K) is an equivalence class [X:Y:Z] of nonzero triples (X,Y,Z)∈K3∖{0}, where (X,Y,Z)∼(λ⁢X,λ⁢Y,λ⁢Z) for every λ∈K×. The affine points (x,y) embed as [x:y:1]; the points with Z=0 form the line at infinity, the extra “directions”. Homogenising the Weierstrass equation (9) by setting x=X/Z, y=Y/Z and clearing denominators gives the projective Weierstrass equation

Y2⁢Z=X3+a⁢X⁢Z2+b⁢Z3. (11)

Setting Z=0 in (11) forces X3=0, hence X=0, leaving the single projective point [0:1:0]. This is the point at infinity 𝒪. It lies infinitely far up in the vertical direction, and every vertical line x=const passes through it. The reader may safely picture 𝒪 as one point pinned at the top (and bottom) of the y-axis, where all vertical lines meet; the projective equation above is the licence for that picture.

10.3 The chord-and-tangent group law: geometry

We now describe the procedure for “adding” two points of E⁢(K). The construction is purely geometric, and it rests on a single fact: a line meets a cubic curve in exactly three points, counted with multiplicity. The point at infinity is engineered precisely so that the counting is always exact.

Definition 10.7 (The group law, geometric form).

Let P,Q∈E⁢(K). Define P+Q as follows.

  • •

    If P=𝒪, set P+Q=Q; if Q=𝒪, set P+Q=P.

  • •

    Otherwise P=(x1,y1) and Q=(x2,y2) are affine. Draw the line ℓ through P and Q; if P=Q, let ℓ be the tangent line to the curve at P. The line ℓ meets the curve in a third point R′, counted with multiplicity, where a vertical ℓ has third point 𝒪. Define P+Q to be the reflection of R′ across the x-axis: if R′=(x3,−y3) then P+Q=(x3,y3), and if R′=𝒪 then P+Q=𝒪.

The reflection step deserves a comment, because it is what converts “the three intersection points of a line sum to a fixed thing” into a genuine group law with 𝒪 as identity. The underlying rule is this: the three intersection points of any line with the curve add up to 𝒪. (Stated here as a guiding picture; every use of it below is discharged by an explicit computation with the formulas of §10.4.) Reflection across the x-axis sends an affine point (x,y) to (x,−y), which—as the next subsection confirms—is its additive inverse; and it sends 𝒪 to 𝒪. To convert the geometry into formulas one must (i) find the third intersection point of a line with the cubic and (ii) handle the degenerate cases. The key algebraic device for (i) is Vieta’s relation between the roots of a cubic and its coefficients, already deployed in 10.3.

10.4 Explicit affine formulas

Fix an elliptic curve E:y2=x3+a⁢x+b over K, and let P=(x1,y1) and Q=(x2,y2) denote affine points.

Definition 10.8 (Negation).

Define

−𝒪=𝒪,−(x1,y1)=(x1,−y1).

The reflected point (x1,−y1) is again on the curve, since the curve equation depends on y only through y2. Geometrically, the line through P and −P is the vertical line x=x1, which meets the curve at P, −P, and 𝒪.

Construction 10.9 (Chord addition).

Suppose P,Q≠𝒪 and x1≠x2. The line through P and Q is y=λ⁢x+μ with

λ=y2−y1x2−x1,μ=y1−λ⁢x1.

Substituting the line into the curve equation, (λ⁢x+μ)2=x3+a⁢x+b, and collecting terms gives

g⁢(x):=x3−λ2⁢x2+(a−2⁢λ⁢μ)⁢x+(b−μ2)=0.

Both x1 and x2 are roots of the monic cubic g: each point lies on the line and on the curve, so g⁢(xi)=f⁢(xi)−(λ⁢xi+μ)2=f⁢(xi)−yi2=0. Since x1≠x2, factoring out (x−x1)⁢(x−x2) (5.17, applied twice) leaves a monic linear factor x−x3 with x3∈K: the x-coordinate of the third intersection point R′. By Vieta, the sum of the roots equals the negative of the x2-coefficient—so x1+x2+x3=λ2, and the unknown root is read off with no factoring at all. Hence

x3=λ2−x1−x2,y3=λ⁢(x1−x3)−y1, (12)

and P+Q=(x3,y3). The y-formula already incorporates the reflection across the x-axis: the third intersection point is (x3,λ⁢x3+μ), and reflecting gives y3=−(λ⁢x3+μ)=−(λ⁢x3+y1−λ⁢x1)=λ⁢(x1−x3)−y1.

Construction 10.10 (Tangent doubling).

Suppose P=Q=(x1,y1) with y1≠0. Implicit differentiation of y2=x3+a⁢x+b yields the tangent slope: from 2⁢y⁢d⁢y=(3⁢x2+a)⁢d⁢x,

λ=3⁢x12+a2⁢y1.

With μ=y1−λ⁢x1, substituting y=λ⁢x+μ into the curve equation produces the same monic cubic g⁢(x)=x3+a⁢x+b−(λ⁢x+μ)2 as in 10.9, and here x1 is a double root. The slogan “tangency counts the intersection twice” is a one-line check: g⁢(x1)=f⁢(x1)−y12=0, and

g′⁢(x1)=3⁢x12+a−2⁢λ⁢(λ⁢x1+μ)=3⁢x12+a−2⁢λ⁢y1=0

by the choice of λ, so x1 is a repeated root of g (5.40(1)). Factoring (x−x1)2 out of g leaves a monic linear factor x−x3 with x3∈K, and Vieta now reads x1+x1+x3=λ2, hence

x3=λ2−2⁢x1,y3=λ⁢(x1−x3)−y1,[2]⁢P=(x3,y3). (13)

The remaining cases are exactly those in which the line is vertical.

  • •

    If P=𝒪, then P+Q=Q; symmetrically if Q=𝒪.

  • •

    If x1=x2 but y1=−y2 (so Q=−P, including the subcase y1=y2=0), the line is vertical, the third point is 𝒪, and P+Q=𝒪.

  • •

    If P=Q and y1=0, the tangent is vertical (the slope formula in 10.10 has zero denominator), so [2]⁢P=𝒪. These are exactly the points of order two, studied in 10.9.

Every case is covered: either an input is 𝒪; or both inputs are affine with x1≠x2 (use (12)); or both are affine with x1=x2, in which case either y1=−y2 (result 𝒪) or y1=y2≠0 (use (13)).

Proposition 10.11 (Closure).

For all P,Q∈E⁢(K), the point P+Q computed by the case analysis above lies in E⁢(K). In particular E⁢(K) is closed under +.

Proof.

If either input is 𝒪, the result is the other input, which lies in E⁢(K) by hypothesis; if the result is 𝒪, it lies in E⁢(K) by definition. Otherwise (x3,y3) is produced by (12) or (13), and in both constructions x3 was exhibited as a root of the cubic g⁢(x)=x3+a⁢x+b−(λ⁢x+μ)2—as the third root beside x1,x2 in 10.9, and beside the double root x1 in 10.10. The equation g⁢(x3)=0 states precisely that the third intersection point (x3,λ⁢x3+μ)=(x3,−y3) satisfies the curve equation; and since the curve equation is invariant under y↦−y, the reflected point (x3,y3) is on the curve too, so P+Q∈Eaff⁢(K)⊆E⁢(K). For rationality, observe that all coordinates are rational expressions in x1,x2,y1,y2,a whose denominators are x2−x1 or 2⁢y1, nonzero in the cases where each formula is invoked; so x3,y3∈K. □

Remark 10.12 (Complete versus incomplete addition).

The chord formula (12) is incomplete: it fails whenever x1=x2—the doubling and inverse cases—and an implementation must branch into the case analysis above. Complete addition formulas, valid for all input pairs including P=Q and P=−Q, exist for the curves used here, at the cost of more field operations per addition; 10.13 exhibits the deployed set and 10.14 proves it complete. The distinction is load-bearing in later volumes. Halo 2’s elliptic-curve gadgets provide complete addition and use incomplete gates only where their callers justify the exclusions; the Sinsemilla hash of Orchard deliberately uses the incomplete formulas nondeterministically—an exceptional case does not violate the constraints but leaves the affected output unconstrained (the prover may choose the intermediate slope freely), which the specification models by letting the hash return ⊥ and weakening the proved statement accordingly; its Merkle path validity check is even permitted to pass on the resulting sentinel values. Safety rests not on the proof system but on Theorem 5.4.4 of the Zcash protocol specification: any input reaching an exceptional case of the incomplete addition immediately yields a nontrivial discrete-logarithm relation among the Sinsemilla generators, so under discrete-log hardness on Pallas (10.31) such inputs are infeasible to find, for honest and adversarial provers alike.

An implementation branches; a circuit cannot. In a proof system the group law is checked by a fixed list of polynomial identities in the input, output, and auxiliary cells of a row, evaluated on every row alike, so the case analysis of this subsection has to be folded into algebra: each branch must appear as a factor that vanishes exactly when the branch is not taken. The deployed gate achieves this with five auxiliary cells, four of them “inverse-or-zero” hints that let a polynomial test a field element for zero.

Construction 10.13 (Complete addition as deployed).

Let E:y2=x3+b over 𝔽p with p>3, and encode the point at infinity as the pair (0,0), so that every element of E⁢(𝔽p) is a pair of field elements. For z∈𝔽p let inv0⁡(z) be z−1 if z≠0 and 0 if z=0. For encoded inputs P=(xp,yp) and Q=(xq,yq) the prover fills five auxiliary cells,

α=inv0⁡(xq−xp),β=inv0⁡(xp),γ=inv0⁡(xq),δ={inv0⁡(yq+yp)if ⁢xq=xp,0otherwise,
λ={(yq−yp)⁢αif ⁢xq≠xp,3⁢xp2⁢(2⁢yp)−1if ⁢xq=xp⁢ and ⁢yp≠0,0otherwise,

and an output pair (xr,yr): it is Q if xp=0; else P if xq=0; else (0,0) if xq=xp and yq=−yp; else xr=λ2−xp−xq and yr=λ⁢(xp−xr)−yp. The verifier accepts the row iff the twelve identities

(xq−xp)⁢((xq−xp)⁢λ−(yq−yp)) =0, (C1)
(1−(xq−xp)⁢α)⁢(2⁢yp⁢λ−3⁢xp2) =0, (C2)
xp⁢xq⁢(xq−xp)⁢(λ2−xp−xq−xr) =0, (C3a)
xp⁢xq⁢(xq−xp)⁢(λ⁢(xp−xr)−yp−yr) =0, (C3b)
xp⁢xq⁢(yq+yp)⁢(λ2−xp−xq−xr) =0, (C3c)
xp⁢xq⁢(yq+yp)⁢(λ⁢(xp−xr)−yp−yr) =0, (C3d)
(1−xp⁢β)⁢(xr−xq) =0, (C4a)
(1−xp⁢β)⁢(yr−yq) =0, (C4b)
(1−xq⁢γ)⁢(xr−xp) =0, (C5a)
(1−xq⁢γ)⁢(yr−yp) =0, (C5b)
(1−(xq−xp)⁢α−(yq+yp)⁢δ)⁢xr =0, (C6a)
(1−(xq−xp)⁢α−(yq+yp)⁢δ)⁢yr =0 (C6b)

hold in 𝔽p. These are, in this order, the twelve constraints of the gate complete addition in the halo2_gadgets crate (src/ecc/chip/add.rs, create_gate), each carrying there one further factor, a per-row cell equal to 1 on the rows where the gate applies and 0 elsewhere, which switches the list on or off; the cell assignments are those of assign_region in the same file, and the circuit field is the Pallas base field 𝔽p.

Proposition 10.14 (The gate is complete and sound).

Suppose no affine point of E⁢(𝔽p) has x=0 and none has y=0—for y2=x3+b, that b is a non-square and −b a non-cube in 𝔽p. Then for all P,Q∈E⁢(𝔽p), encoded as in 10.13:

  1. 1.

    (completeness) the prover’s cells satisfy (C1)–(C6b), and the output pair encodes P+Q;

  2. 2.

    (soundness) every (λ,α,β,γ,δ,xr,yr)∈𝔽p7 satisfying (C1)–(C6b) has (xr,yr) equal to the encoding of P+Q.

This is what complete means for a gate: the twelve identities are satisfiable for every input pair—doublings, inverse pairs, and the identity included—and the output they admit is unique, so they are the graph of the total function +:E(𝔽p)×E(𝔽p)→E(𝔽p), with no case left to a branch outside the constraint system.

Proof.

Under the hypothesis an encoded pair has x=0 iff it is 𝒪, and two affine points with the same x-coordinate have yq=±yp with yp≠0, so they are equal or inverse and not both. One observation drives every case: for z∈𝔽p and any cell value h, the factor 1−z⁢h equals 1 when z=0, whatever h is, while for z≠0 the honest choice h=z−1 makes it 0. A constraint of the shape (1−z⁢h)⁢t=0 therefore forces t=0 exactly when z=0 and is discharged by the honest hint otherwise. Five cases exhaust the input pairs.

Case P=𝒪. Then xp=0, so (C4a)–(C4b) force (xr,yr)=(xq,yq), the encoding of 𝒪+Q=Q; that is soundness. The prover outputs Q by the first clause, and its cells satisfy the rest: (C1) reads xq⁢(xq⁢λ−yq)=0 and holds for λ=yq⁢inv0⁡(xq); (C2) and (C3a)–(C3d) carry a factor xp or 2⁢yp⁢λ−3⁢xp2, both zero; (C5a)–(C5b) are discharged by γ=xq−1 if Q≠𝒪, and read (xr,yr)=(0,0)=(xp,yp) if Q=𝒪; and (C6a)–(C6b) have first factor 1−xq⁢α−0, which is 0 for α=xq−1 when Q≠𝒪, while for Q=𝒪 the other factor xr=yr=0 vanishes.

Case Q=𝒪, P≠𝒪. Now xq=0≠xp, so (C5a)–(C5b) force (xr,yr)=(xp,yp), the encoding of P: soundness. The prover outputs P by the second clause, with α=(−xp)−1 and λ=(−yp)⁢α=yp/xp; then (C1) reads (−xp)⁢(−xp⁢λ+yp)=0 and holds; (C2) and (C6a)–(C6b) carry the factor 1−(xq−xp)⁢α=0, the latter with δ=0; (C3a)–(C3d) carry xq=0; and (C4a)–(C4b) are discharged by β=xp−1.

Case P,Q affine with xq≠xp. Constraint (C1) forces λ to be the chord slope (yq−yp)/(xq−xp), and since xp⁢xq⁢(xq−xp)≠0, (C3a)–(C3b) force (xr,yr) to be the chord formula (12)—the encoding of P+Q, which is affine because xp≠xq. That is soundness. The prover’s λ is that slope and its output that formula, by the fourth clause; (C3c)–(C3d) contain the same two vanishing factors; (C2), (C4a)–(C4b), (C5a)–(C5b) are discharged by the honest α, β, γ; and (C6a)–(C6b) have first factor 1−1−0=0, since δ=0.

Case Q=−P, P affine. Here xq=xp and yq+yp=0, so both hint-bearing products in (C6a)–(C6b) are 0 whatever α and δ are, and the constraints force xr=yr=0: the encoding of P+(−P)=𝒪, which is soundness. The prover outputs (0,0) by the third clause; (C1) and (C3a)–(C3b) carry xq−xp=0, and (C3c)–(C3d) carry yq+yp=0; (C2), whose first factor is now 1, needs 2⁢yp⁢λ=3⁢xp2, which the honest λ=3⁢xp2⁢(2⁢yp)−1 supplies (yp≠0); and (C4a)–(C5b) are discharged by β=γ=xp−1.

Case Q=P affine. Again xq=xp fixes (xq−xp)⁢α=0, so (C2) forces λ to be the tangent slope 3⁢xp2/(2⁢yp), and since xp⁢xq⁢(yq+yp)=2⁢xp2⁢yp≠0, (C3c)–(C3d) force (xr,yr) to be the doubling formula (13)—the encoding of [2]⁢P, affine because yp≠0. That is soundness. The prover’s λ is that slope and its output that formula, by the fourth clause; (C1) and (C3a)–(C3b) carry xq−xp=0; (C4a)–(C5b) are discharged by β=γ=xp−1; and (C6a)–(C6b) have first factor 1−0−2⁢yp⁢δ=0 for the honest δ=(2⁢yp)−1. □

Example 10.15 (The gate on the toy curve).

Pallas satisfies both hypotheses of 10.14: 5 is a non-square in 𝔽p (7.16) and −5 is not a cube (10.26). The toy curve y2=x3+5 over 𝔽11 of 10.38 satisfies neither—5=42 gives the points (0,±4), and (8,0) has order 2—which makes it the right place to watch the gate work and to see the hypotheses earn their keep. For each input pair considered below, a script determines every output pair (xr,yr) that some assignment of the five auxiliary cells in 𝔽11 makes the twelve identities accept—the search over α,β,γ,δ factored by which identities mention each: β only (C4), γ only (C5), α and δ only (C2) and (C6)—so soundness is checked against all provers, not only the honest one. On the nine points 𝒪, (4,±5), (5,±3), (6,±1), (10,±2) with x,y≠0, all 81 ordered pairs—eight doublings, eight inverse pairs, seventeen involving 𝒪—admit exactly one output, the encoding of the true sum. Three of them, worked: for [2]⁢(5,3) the honest cells are λ=3⋅52⋅6−1=9⋅2=7 and δ=6−1=2, giving (xr,yr)=(49−10, 7⁢(5−6)−3)=(6,1), the value of (13); for the inverse pair (5,3)+(5,8) the prover supplies the same λ=7 but δ=inv0⁡(11)=0, and (C6a)–(C6b) force (0,0); for 𝒪+(5,3) the cells are α=5−1=9, λ=3⋅9=5, β=0, and (C4a)–(C4b) force (5,3). Off the admissible set the gate fails as the proof predicts. With P=(0,4) and Q=(5,3) the identities admit only the output (5,3)—the coordinate xp=0 is read as 𝒪—whereas P+Q=(10,9) (10.38); the pair (0,4)+(0,7) admits no output at all, (C4b) demanding yr=7 and (C5b) yr=4; and (8,0)+(8,0) admits none either, since (C2) reduces to 3⋅82=0, false in 𝔽11. On Pallas none of the three inputs exists, and the gate is complete.

10.5 Identity, inverses, commutativity, and associativity

The destination of the whole construction is the following theorem.

Theorem 10.16 (Group law).

Let E be an elliptic curve over a field K. The set E⁢(K) with the chord-and-tangent operation + of 10.7 is an abelian group with identity 𝒪.

Closure is 10.11. The next proposition supplies every remaining axiom except one.

Proposition 10.17 (Identity, inverses, commutativity).

The operation + on E⁢(K) has the following properties.

  1. 1.

    The point 𝒪 is a two-sided identity: P+𝒪=𝒪+P=P for all P.

  2. 2.

    Every P has the two-sided inverse −P of 10.8: P+(−P)=𝒪.

  3. 3.

    The operation is commutative: P+Q=Q+P.

Proof.

(1) is the first clause of 10.7. (2): for P=(x,y) with y≠0, the line through P and −P=(x,−y) is vertical, so its third point is 𝒪 and P+(−P)=𝒪 by the vertical-line case; for y=0 one has P=−P and [2]⁢P=𝒪 directly by the vertical-tangent case; and 𝒪+(−𝒪)=𝒪+𝒪=𝒪. (3): the chord through P and Q does not depend on the order in which the two points are named, and neither does the tangent in the doubling case; algebraically, the formulas (12) are symmetric under the swap (x1,y1)↔(x2,y2)—the slope λ is unchanged, and x3=λ2−x1−x2 is symmetric in x1,x2. □

The one axiom not yet established is associativity, (P+Q)+R=P+(Q+R), and it is the deep and surprising part of the theory: the definition gives no reason why reflecting third intersection points should be an associative operation, and a brute-force verification through the explicit formulas splinters into a large number of coordinate cases, each demanding lengthy rational-function identities. We sketch the conceptual proof, which exhibits the reason associativity holds.

Proof of associativity (sketch).

The key tool is the classical Cayley–Bacharach theorem for plane cubics: if two cubics with no common component meet in nine points counted with intersection multiplicity, then any third cubic passing through eight of them with the required multiplicities also passes through the ninth. To prove (P+Q)+R=P+(Q+R), one writes both sides via the chord-and-tangent construction and arranges the relevant intersections among the curve E and two degenerate cubics, each a product of three suitably chosen lines. Cayley–Bacharach forces the two candidate sums to coincide; its intersection-multiplicity formulation includes tangencies and coincident points. Translating “reflect across the x-axis” into “the three points of any line sum to 𝒪” renders the bookkeeping uniform.

A complete, case-free treatment identifies E⁢(K) with the degree-zero part Pic0⁢(E) of the divisor class group of the curve via the map P↦[P]−[𝒪], a bijection that intertwines the two operations; the group law on Pic0⁢(E) is manifestly associative, because it is inherited from addition of divisors modulo principal divisors. Either route yields a genuine proof; both lie beyond the elementary scope of this volume, so we take associativity as established. □

Remark 10.18 (The notation [n]⁢P).

For n∈ℤ and P∈E⁢(K), we write [n]⁢P for the n-fold sum P+⋯+P, with [0]⁢P=𝒪 and [−n]⁢P=−([n]⁢P). This makes the abelian group E⁢(K) a ℤ-module: integers act on points. The map n↦[n]⁢P is the scalar multiplication of 10.20—not any coordinate-wise product.

10.6 Projective and Jacobian coordinates

The affine formulas (12) and (13) each require a field inversion, by x2−x1 or 2⁢y1. In a large prime field an inversion costs roughly as much as dozens of multiplications, whether computed by the extended Euclidean algorithm (6.1) or as zp−2 by Fermat (6.4). When a long chain of group operations arises, as in the scalar multiplication of the next subsection, it pays to defer all inversions to the very end by carrying points in a redundant coordinate system whose group law uses only additions, subtractions, and multiplications.

Remark 10.19 (Inversion-free coordinate systems).

Two redundant systems serve this purpose. In (homogeneous) projective coordinates, a triple [X:Y:Z] with Z≠0 represents the affine point (X/Z,Y/Z) on the projective curve (11), with 𝒪=[0:1:0]. In Jacobian coordinates, a triple (X:Y:Z) with Z≠0 represents (X/Z2,Y/Z3), under the equivalence (X,Y,Z)∼(λ2⁢X,λ3⁢Y,λ⁢Z); the curve equation becomes Y2=X3+a⁢X⁢Z4+b⁢Z6. In either system the addition and doubling formulas can be rewritten with no divisions at all, at the cost of more multiplications per operation; a long chain of group operations then defers every inversion to a single final recovery of affine coordinates—compute Z−1 once, then the needed powers of it by multiplication. Jacobian coordinates usually yield the faster doubling and are the standard choice in cryptographic libraries, including the implementation Halo 2 uses: the pasta_curves crate carries its curve points in Jacobian coordinates. For curves y2=x3+b with a=0, the term a⁢Z4 in the Jacobian doubling formulas vanishes, making doubling especially cheap—one reason the Pasta curves take a=0.

10.7 Scalar multiplication and double-and-add

The fundamental operation of elliptic-curve cryptography is scalar multiplication: given a point P and an integer n≥0, compute

[n]⁢P=P+P+⋯+P⏟n⁢times.

Computing this by n−1 successive additions is infeasible when n has hundreds of bits. Instead one uses the binary expansion of n, exactly as in the square-and-multiply technique of 6.2; as 6.3 promised, the additive rendition of that algorithm is the following.

Definition 10.20 (Double-and-add).

If n=0, return 𝒪. Otherwise write n=∑i=0k−1ni⁢2i with digits ni∈{0,1} and top digit nk−1=1. The left-to-right double-and-add algorithm computes [n]⁢P as follows: set R←P; for i=k−2 down to 0, set R←[2]⁢R, and if ni=1 set R←R+P; return R.

Proposition 10.21.

For n≥1, double-and-add returns [n]⁢P using exactly k−1 doublings and at most k−1 additions, where k=⌊log2⁡n⌋+1 is the bit length of n. For n=0, it returns 𝒪 without a group operation.

Proof.

The case n=0 is immediate. Let n≥1, and let Rj denote the value of R after bits nk−1,…,nj have been incorporated. We claim Rj=[⌊n/2j⌋]⁢P, by downward induction on j. At initialization, Rk−1=P=[⌊n/2k−1⌋]⁢P because the top bit is 1. Assuming Rj+1=[⌊n/2j+1⌋]⁢P, the next iteration computes

[2]⁢Rj+1+[nj]⁢P=[ 2⁢⌊n/2j+1⌋+nj]⁢P=[⌊n/2j⌋]⁢P,

where the last step is the digit identity 2⁢⌊n/2j+1⌋+nj=⌊n/2j⌋: stripping the last bit of ⌊n/2j⌋ and re-appending it recovers the number. At j=0 the invariant reads R0=[n]⁢P, which is what the algorithm returns. For the counts, the loop has exactly k−1 iterations, each performing one doubling and at most one addition. □

Scalar multiplication by an n-bit scalar therefore costs O⁢(n) group operations—O⁢(n) field operations up to constant factors, or O⁢(n⁢log2⁡p) bit operations with schoolbook field arithmetic. This efficiency of the forward map, contrasted with the apparent hardness of the inverse problem (§10.11), is the foundation of the cryptography.

10.8 The group structure of E⁢(𝔽p)

Now specialise K=𝔽p, the prime field with p elements (p prime, p>3). Since 𝔽p is finite, so is E⁢(𝔽p): each of the p values of x admits at most two values of y (5.18, applied to y2−f⁢(x) as a polynomial in y), so with 𝒪 there are at most 2⁢p+1 points. By 10.16, the set E⁢(𝔽p) is thus a finite abelian group. One of the central theorems of the subject governs its order.

Theorem 10.22 (Hasse).

Let E be an elliptic curve over 𝔽p. Write

#⁢E⁢(𝔽p)=p+1−t,

which defines the integer t, called the trace of Frobenius. Then

|t|≤2⁢p;

equivalently, #⁢E⁢(𝔽p) lies in the Hasse interval [p+1−2⁢p,p+1+2⁢p].

Proof (sketch).

The count has an exact character-sum expression. For fixed x, the number of y∈𝔽p with y2=f⁢(x) is 1+(f⁢(x)p) when f⁢(x)≠0—two solutions for a nonzero square, none for a non-square (7.12)—and exactly 1=1+(0p) when f⁢(x)=0, using the Legendre symbol of 7.14 with the convention (0p)=0. Summing over x,

#⁢Eaff⁢(𝔽p)=∑x∈𝔽p(1+(x3+a⁢x+bp))=p+∑x∈𝔽p(x3+a⁢x+bp),

so t=−∑x(x3+a⁢x+bp). Heuristically, as x ranges over 𝔽p the value f⁢(x) is a nonzero square about half the time (two points), a non-square about half the time (none), and zero occasionally (one point); the p summands ±1 behave like a random walk, and Hasse’s bound |t|≤2⁢p is exactly square-root cancellation in this character sum.

The conceptual proof realises t as the trace of the p-power Frobenius endomorphism π:(x,y)↦(xp,yp) of the curve—the curve-level shadow of the field automorphism of 6.14. One shows that π satisfies the characteristic equation π2−[t]⁢π+[p]=0 in the endomorphism ring of E, and that the associated quadratic form (the degree) is positive definite; the discriminant condition t2−4⁢p≤0 for the complex roots of the characteristic polynomial then yields |t|≤2⁢p. The full argument requires the theory of isogenies and the Weil pairing, beyond the present scope. □

Hasse’s theorem says the order of E⁢(𝔽p) is very close to p: the deviation from p+1 is at most 2⁢p, a relative error of order p−1/2. For cryptography this is crucial twice over. It guarantees with no brute-force count that the group is large—about p elements, so about 255 bits for the Pasta curves—and it anchors the point-counting algorithms (Schoof–Elkies–Atkin) that compute the exact order in polynomial time, which is how curve designers certify their group orders.

For the cryptographic application one wants E⁢(𝔽p) to contain a large subgroup of prime order. The general structure theory of E⁢(𝔽p) as an abelian group is not needed in this series, because the Pasta curves are designed so that #⁢E⁢(𝔽p) is itself prime: a group of prime order is cyclic with no proper nontrivial subgroups (3.34), so E⁢(𝔽p) is cyclic of prime order—the optimal case.

10.9 Torsion, the cofactor, and prime-order subgroups

Definition 10.23 (Order of a point and torsion).

The order of a point P∈E⁢(𝔽p) is its order as a group element (3.11): the least integer m≥1 with [m]⁢P=𝒪. It exists and divides #⁢E⁢(𝔽p), by Lagrange’s theorem (3.29 via 3.30). For an integer m≥1, the m-torsion subgroup is

E⁢[m]={P∈E⁢(𝔽p¯):[m]⁢P=𝒪},

the points over the algebraic closure killed by m; its rational part is E⁢(𝔽p)⁢[m]=E⁢[m]∩E⁢(𝔽p).

Definition 10.24 (Cofactor).

Suppose #⁢E⁢(𝔽p)=h⋅r, where r is the (large) prime to be used and h is the remaining factor. The integer h is the cofactor, and r is the order of the prime-order subgroup: a point P of order r generates a cyclic subgroup ⟨P⟩≅ℤ/r⁢ℤ, and this subgroup is where the cryptography lives.

A nontrivial cofactor h>1 is undesirable: it admits small-subgroup points, of order dividing h, which can leak information or break protocol assumptions—the small-subgroup attacks of 7.25. Implementations therefore either clear the cofactor, multiplying incoming points by h, or use prime-order curves with h=1. The Pasta curves have cofactor 1: the orders #⁢Ep⁢(𝔽p)=q and #⁢Eq⁢(𝔽q)=p are themselves prime, so Ep⁢(𝔽p)≅ℤ/q⁢ℤ and Eq⁢(𝔽q)≅ℤ/p⁢ℤ are cyclic of prime order and no cofactor clearing is ever needed. This is one of the principal design advantages of the Pasta cycle for proof systems.

Proposition 10.25 (Two-torsion).

The affine points of order 2 in E⁢(𝔽p) are exactly the points (x0,0) with f⁢(x0)=x03+a⁢x0+b=0. Hence E⁢(𝔽p) has 0, 1, or 3 points of order 2 according as f has 0, 1, or 3 roots in 𝔽p; and #⁢E⁢(𝔽p) is even if and only if f has a root in 𝔽p.

Proof.

A point P=(x,y) has order 2 iff P=−P and P≠𝒪, i.e. y=−y, i.e. y=0 (since char⁡(𝔽p)≠2); the curve equation then forces f⁢(x)=0. Conversely each root x0 of f in 𝔽p gives the order-2 point (x0,0).

Next, the number N of roots of f in 𝔽p can only be 0, 1, or 3: two roots force a third. Suppose f has distinct roots r1≠r2 in 𝔽p. The factor theorem (5.17) gives f=(x−r1)⁢h; evaluating at r2 yields 0=(r2−r1)⁢h⁢(r2), so h⁢(r2)=0, and a second application factors the monic cubic completely, f=(x−r1)⁢(x−r2)⁢(x−r3) with r3∈𝔽p—explicitly r3=−r1−r2 by Vieta, the depressed cubic having no x2 term. Nonsingularity says f has no repeated root even over 𝔽p¯ (10.4(2)), so r3∉{r1,r2}, and f has exactly three roots (5.18 caps the count). Hence N∈{0,1,3}, matching the trichotomy of the statement. Together with 𝒪 the order-2 points form the rational 2-torsion subgroup E⁢(𝔽p)⁢[2], which is accordingly trivial, ℤ/2⁢ℤ, or ℤ/2⁢ℤ×ℤ/2⁢ℤ.

For the parity claim, consider negation P↦−P, an involution—a self-inverse map—of the finite set E⁢(𝔽p). Its fixed points are exactly 𝒪 and the points (x0,0); every other point pairs off with its distinct negative into a 2-element orbit. Counting the set by orbits,

#⁢E⁢(𝔽p)≡1+N(mod2),

where N∈{0,1,3} is the number of roots of f in 𝔽p. Hence #⁢E⁢(𝔽p) is even iff N is odd, i.e. iff N≥1, i.e. iff f has a root in 𝔽p. (The device is worth remembering: an involution reads off a group’s cardinality modulo 2 from its fixed points alone.) □

Remark 10.26 (No two-torsion on the Pasta curves).

For y2=x3+5 over 𝔽p, the curve has a point of order 2 iff x3+5=0 has a solution, i.e. iff −5 is a cube in 𝔽p. For the Pasta primes the order #⁢Ep⁢(𝔽p)=q is odd (it is prime), so there are no rational 2-torsion points; consistently, −5 is not a cube in 𝔽p.

10.10 Base fields, scalar fields, and the Pasta cycle

Step back from the geometry and ask what a machine actually does when it works on E⁢(𝔽p). Every operation of the group law—the slope λ=(y2−y1)⁢(x2−x1)−1, the squarings, and the inversions needed to add and to double—is arithmetic in 𝔽p, performed with exactly the prime-field algorithms of 6.1 (extended-Euclid or Fermat inversion). The field 𝔽p is called the base field (or coordinate field) of the curve: it is where the coordinates live.

Scalars live elsewhere. By 10.22 the group E⁢(𝔽p) is a finite abelian group of order N=#⁢E⁢(𝔽p) close to p; for cryptography one selects a curve whose order has a large prime factor r, and keys and signatures reside in the subgroup of order r (10.24). A scalar multiplication P↦[s]⁢P on a point of order r depends only on smodr, since [r]⁢P=𝒪 (3.12); scalars therefore live modulo r—and since r is prime, they form a field (4.26).

Definition 10.27 (Base field and scalar field).

For an elliptic curve used in cryptography, with a prime-order subgroup of order r:

  • •

    the base field 𝔽p is the field over which the curve is defined and in which point coordinates lie;

  • •

    the scalar field 𝔽r=ℤ/r⁢ℤ is the field of scalars by which one multiplies points, i.e. the integers modulo the subgroup order r.

Both are prime fields, but in general p≠r.

Remark 10.28 (Two fields at once, and the Pasta cycle).

A typical elliptic-curve operation manipulates two distinct prime fields simultaneously: the exponent arithmetic runs in 𝔽r while the coordinate arithmetic runs in 𝔽p. Halo 2’s Pallas and Vesta curves (the “Pasta” pair) exploit this deliberately. They form a cycle of curves: the base field of one is the scalar field of the other and vice versa,

#⁢Ep⁢(𝔽p)=q,#⁢Eq⁢(𝔽q)=p,

so the scalar field of Pallas is 𝔽q, the base field of Vesta, and symmetrically (§5.4.9.6 of the Zcash protocol specification). This lets a proof system express the verifier of one curve’s arithmetic natively in the field of the other, enabling the recursive proof composition at the heart of Halo 2. Moreover both primes are chosen ≡1(mod232), so by 6.22 each field contains a multiplicative subgroup of order 232, furnishing the high-order roots of unity that the number-theoretic transform of 9 needs for fast polynomial multiplication.

10.11 The elliptic-curve discrete logarithm problem

The section’s opening problem now returns in its proper habitat. The discrete logarithm problem of 7.21 was stated for an abstract cyclic group; the elliptic-curve instance reads as follows, in additive notation.

Definition 10.29 (ECDLP).

Let P∈E⁢(𝔽p) be a point of large prime order r, generating G=⟨P⟩. The elliptic-curve discrete logarithm problem (ECDLP) is: given P and a point Q∈G, find the unique integer n∈{0,1,…,r−1} with Q=[n]⁢P. One writes n=logP⁡Q.

The map n↦[n]⁢P is a group isomorphism ℤ/r⁢ℤ→G (3.43), so a discrete logarithm always exists and is unique; the entire content of the problem is computational. The forward map is fast by double-and-add (10.21); no efficient algorithm is known to invert it on a well-chosen curve. What is known is the generic pair of attacks, which transfer verbatim from 7.22 to the additive setting.

Proposition 10.30 (Square-root attacks).

Baby-step giant-step solves the ECDLP in a group of prime order r in O⁢(r) group operations and O⁢(r) space. Pollard’s rho method matches the O⁢(r) bound in expectation with only O⁢(1) space, under a modelling assumption on its pseudo-random walk that is stated explicitly in the proof and is unproved for every concrete walk.

Proof.

For baby-step giant-step, set m=⌈r⌉ and write the unknown logarithm as n=i⁢m+j with 0≤i,j<m; since m2≥r, every n∈{0,…,r−1} has such a decomposition. Tabulate the baby steps [j]⁢P for j=0,…,m−1 (a table of m points, built with m−1 additions), compute S=[m]⁢P once, and walk the giant steps Q−[i]⁢S for i=0,1,2,…, testing each against the table. At i=⌊n/m⌋ the walk hits Q−[i⁢m]⁢P=[n−i⁢m]⁢P=[j]⁢P, a table entry; the collision reveals i and j, hence n=i⁢m+j. Both the table and the walk cost O⁢(m)=O⁢(r) group operations, and the table holds O⁢(r) points.

Pollard’s rho eliminates the table, at the price of an explicitly heuristic analysis. The algorithm takes a pseudo-random walk on G whose every position is maintained in the form [a]⁢P+[b]⁢Q with known coefficients a,b, started from such a combination with random coefficients; the walk’s next step depends only on the current point, so once the walk revisits a point it cycles forever. A repeat is therefore detected with O⁢(1) memory: run a second copy of the walk at double speed, and the two copies meet at a common point inside the cycle within a constant factor of the first repeat time. Modelling assumption: the successive positions of the walk behave like independent uniform samples from G. No proof of this is known for any concrete walk—the assumption is what “well-designed” means, and experiment supports it—and the rest of the argument is conditional on it. Under the assumption, the first k positions are pairwise distinct with probability at most e−k⁢(k−1)/(2⁢r) by the birthday bound—the forward reference 11.18 is quantitative machinery from the closing section—so the number T of steps to the first repeat satisfies Pr⁡[T>k]≤e−k⁢(k−1)/(2⁢r). The tail-sum formula (11.33) converts the tail bound into an expectation bound: with m=⌈r⌉ and r≥4,

𝔼⁢[T]=∑k≥1Pr⁡[T≥k]≤m⁢∑j≥0Pr⁡[T>j⁢m]≤m⁢(1+∑j≥1e−j/4)=O⁢(r),

where the middle step groups the indices k into blocks of length m, bounding each block by its first term, and the last uses j⁢m⁢(j⁢m−1)≥j2⁢m⁢(m−1)≥j2⁢(r−r)≥j2⁢r/2 for j≥1, so that Pr⁡[T>j⁢m]≤e−j2/4≤e−j/4, a convergent geometric tail. A repeat presents one group element with two representations, [a]⁢P+[b]⁢Q=[a′]⁢P+[b′]⁢Q. If b′≢b(modr), this rearranges to [a−a′]⁢P=[b′−b]⁢Q=[(b′−b)⁢n]⁢P, whence

n≡(a−a′)⁢(b′−b)−1(modr),

the inverse existing because r is prime. If instead b′≡b, then [a]⁢P=[a′]⁢P forces a≡a′: the two representations coincide, the collision reveals nothing, and the walk is restarted with fresh random starting coefficients; that such degenerate collisions are rare is a further part of the heuristic, borne out in practice. Both algorithms run in time exponential in the bit length log2⁡r. □

Remark 10.31 (Best known attacks on well-chosen curves).

For well-chosen curves, no unrestricted classical attack faster than O⁢(r) is known; this is not an unconditional lower bound for all classical algorithms. In the classical generic-group model, however, Shoup’s matching lower bound is proved (7.22). For r≈2254—the 255-bit Pasta orders—this is about 2127 operations, infeasible. Curves with special structure can be weaker, and the known weak classes are avoided by design. Anomalous curves, those with #⁢E⁢(𝔽p)=p, admit a polynomial-time attack through the formal group. The MOV/Frey–Rück attack transfers the ECDLP into a finite-field discrete logarithm when the embedding degree—the least k≥1 with r∣pk−1, i.e. the degree (8.4; the dimension of the extension over its base) of the smallest extension of 𝔽p whose multiplicative group contains a subgroup of order r—is small, where index calculus applies. Cryptographically secure curves, the Pasta curves included, are chosen with a large prime subgroup order, a large embedding degree, and #⁢E⁢(𝔽p)≠p, defeating every known subexponential attack.

Remark 10.32 (The index-calculus contrast).

The contrast with the multiplicative groups 𝔽p× is the economic heart of the subject. In 𝔽p× the index-calculus method solves the discrete logarithm in subexponential time Lp⁢[1/3]—shorthand for 2Θ⁢(λ1/3⁢(log⁡λ)2/3) operations in the bit length λ=log2⁡p, a notation defined precisely in 11.60 of the closing section—exploiting the integer arithmetic behind the residues (7.22); those groups must therefore be made very large. On a well-chosen elliptic curve no index calculus is known—the points offer no analogue of “factoring into small primes”—so the generic O⁢(r) bound stands, and much smaller groups suffice: about 256 bits for 128-bit security, versus thousands of bits for 𝔽p×. Smaller groups mean faster arithmetic and shorter keys, which is why elliptic curves dominate modern protocols, including Halo 2.

10.12 The j-invariant and the GLV endomorphism

Two final pieces of structure round out the theory: a single quantity that classifies curves up to isomorphism, and an “extra symmetry” available exactly when that quantity vanishes—which the Pasta curves arrange on purpose.

Definition 10.33 (j-invariant).

The j-invariant of the curve y2=x3+a⁢x+b (with 4⁢a3+27⁢b2≠0) is

j=1728⁢4⁢a34⁢a3+27⁢b2∈K,

where 1728=123 is a normalising constant of historical origin.

Proposition 10.34.

Two elliptic curves over K¯ are isomorphic over K¯ if and only if they have the same j-invariant. The admissible coordinate changes preserving short Weierstrass form are (x,y)↦(u2⁢x,u3⁢y) for u∈K¯×, under which (a,b)↦(u4⁢a,u6⁢b); the combination j is invariant.

Proof (sketch).

A direct computation shows that the only isomorphisms between short Weierstrass curves fixing 𝒪 are the scalings (x,y)↦(u2⁢x,u3⁢y). Substituting x=u−2⁢x′, y=u−3⁢y′ into y2=x3+a⁢x+b and clearing u6 gives y′⁣2=x′⁣3+u4⁢a⁢x′+u6⁢b, which is the stated action on coefficients. Under it, numerator and denominator of 4⁢a3/(4⁢a3+27⁢b2) both scale by u12, so j is unchanged. Conversely, given two curves with equal j-invariants one solves for a suitable u transforming one coefficient pair into the other, with separate easy cases j=0 (both a vanish) and j=1728 (both b vanish). □

Remark 10.35 (The Pasta curves have j=0).

For y2=x3+b one has a=0, so j=0; both Pasta curves have j=0. Curves with j=0 are special: they admit an extra automorphism of order 3, which underlies the efficient endomorphism described next. (At the other extreme, b=0 gives j=1728 and an order-4 automorphism.) The vanishing j=0 is deliberate in the Pasta design: it is what makes the Gallant–Lambert–Vanstone (GLV) speedup available, roughly halving the doubling count in scalar multiplication.

Proposition 10.36 (The GLV endomorphism for y2=x3+b).

Suppose 𝔽p contains a primitive cube root of unity ω, i.e. p≡1(mod3) (6.22), so ω∈𝔽p satisfies ω2+ω+1=0. On E:y2=x3+b, the map

ϕ⁢(x,y)=(ω⁢x,y),ϕ⁢(𝒪)=𝒪,

is a group endomorphism of E⁢(𝔽p). Let G=⟨P⟩ be a subgroup of prime order r with r≡1(mod3) and ϕ⁢(G)⊆G. Then ϕ acts on G as multiplication by a scalar: there is λ∈ℤ/r⁢ℤ with λ2+λ+1≡0(modr) and

ϕ⁢(Q)=[λ]⁢Qfor all ⁢Q∈G.

For the Pasta curves the hypothesis ϕ⁢(G)⊆G is automatic, since E⁢(𝔽p) itself is the prime-order group G; and r≡1(mod3) holds for both orders.

Proof.

The map lands on the curve. If y2=x3+b then y2=(ω⁢x)3+b, because ω3=1; so (ω⁢x,y)∈E⁢(𝔽p).

The map is a homomorphism. We check ϕ⁢(P1+P2)=ϕ⁢(P1)+ϕ⁢(P2) against the case analysis of §10.4. The 𝒪 cases are trivial, and ϕ⁢(−P)=−ϕ⁢(P) since negation touches only y; in particular the inverse case ϕ⁢(P)+ϕ⁢(−P)=𝒪=ϕ⁢(𝒪) is respected, and ϕ preserves the case split, since it preserves equality of x-coordinates. For a chord (x1≠x2), the slope transforms as

λ′=y2−y1ω⁢x2−ω⁢x1=ω−1⁢λ=ω2⁢λ,

using ω−1=ω2. Then, by (12) and ω4=ω,

x3′=λ′⁣2−ω⁢x1−ω⁢x2=ω4⁢λ2−ω⁢x1−ω⁢x2=ω⁢(λ2−x1−x2)=ω⁢x3,
y3′=λ′⁢(ω⁢x1−x3′)−y1=ω2⁢λ⋅ω⁢(x1−x3)−y1=λ⁢(x1−x3)−y1=y3,

so ϕ⁢(P1)+ϕ⁢(P2)=(ω⁢x3,y3)=ϕ⁢(P1+P2). The tangent case runs identically with λ′=3⁢(ω⁢x1)2/(2⁢y1)=ω2⁢λ in (13).

The relation ϕ2+ϕ+id=0. Let P=(x,y) be affine; we show P+ϕ⁢(P)+ϕ2⁢(P)=𝒪 directly from the formulas of §10.4.

First let x≠0. The points P=(x,y), ϕ⁢(P)=(ω⁢x,y), ϕ2⁢(P)=(ω2⁢x,y) share their y-coordinate and have pairwise distinct x-coordinates, since 1,ω,ω2 are distinct and x≠0. The chord formula (12) applies to P+ϕ⁢(P), with slope λ=(y−y)/(ω⁢x−x)=0:

x3=0−x−ω⁢x=−(1+ω)⁢x=ω2⁢x,y3=0⋅(x−x3)−y=−y,

using 1+ω+ω2=0. Hence P+ϕ⁢(P)=(ω2⁢x,−y)=−ϕ2⁢(P) (10.8), and P+ϕ⁢(P)+ϕ2⁢(P)=𝒪.

If instead x=0, the three points coincide: ϕ⁢(P)=ϕ2⁢(P)=P. Here y≠0, since x=y=0 on the curve would force b=0, which nonsingularity 27⁢b2≠0 forbids; so the doubling formula (13) applies, with a=0:

λ=3⋅02+02⁢y=0,x3=0−2⋅0=0,y3=0⋅(0−0)−y=−y,

so [2]⁢P=(0,−y)=−P, hence P+ϕ⁢(P)+ϕ2⁢(P)=[3]⁢P=𝒪 in this case too. (The three points P, ϕ⁢(P), ϕ2⁢(P) are exactly the intersections of the horizontal line through P with the curve, the roots of X3=y2−b being x, ω⁢x, ω2⁢x; the computation just performed is the “three points of a line sum to 𝒪” picture made rigorous, including the triple intersection at x=0.)

With ϕ⁢(𝒪)=𝒪 the identity holds on all of E⁢(𝔽p); as an identity of endomorphisms, ϕ2+ϕ+id=0. Incidentally ϕ3=id, since ω3=1; and whenever #⁢E⁢(𝔽p)>3—as always at cryptographic sizes, the Pasta curves included—ϕ has order exactly 3, because at most two affine points, (0,±y0) with y02=b, share the coordinate x=0, so some point of E⁢(𝔽p) has x≠0 and ϕ moves it. The proviso is not vacuous: y2=x3+4 over 𝔽7 has only the three points 𝒪, (0,2), (0,5), and there ϕ=id.

Action on G as a scalar. The subgroup G≅ℤ/r⁢ℤ is cyclic with generator P, and ϕ⁢(G)⊆G by hypothesis, so ϕ⁢(P)=[λ]⁢P for some λ∈ℤ/r⁢ℤ; then for any Q=[m]⁢P∈G, the homomorphism property gives ϕ⁢(Q)=[m]⁢ϕ⁢(P)=[m⁢λ]⁢P=[λ]⁢Q. (This is the statement Hom⁡(ℤ/r⁢ℤ,ℤ/r⁢ℤ)≅ℤ/r⁢ℤ: an endomorphism of a cyclic group is determined by, and equal to multiplication by, the image of a generator.) Applying the endomorphism relation to P,

[λ2+λ+1]⁢P=𝒪⟹λ2+λ+1≡0(modr),

since P has order r. Consistently, this congruence is solvable exactly when 𝔽r contains a primitive cube root of unity, i.e. when r≡1(mod3) (6.22 again)—the hypothesis of the statement. □

Remark 10.37 (How GLV halves the doubling count).

Computing ϕ costs a single field multiplication x↦ω⁢x, negligible against a group operation. One therefore decomposes a scalar n∈ℤ/r⁢ℤ as

[n]⁢P=[n1]⁢P+[n2]⁢ϕ⁢(P),n≡n1+n2⁢λ(modr),

where n1,n2 can each be taken only about 12⁢log2⁡r bits long—such a pair is found by lattice reduction in the lattice of pairs (c1,c2) with c1+c2⁢λ≡0(modr). The two half-length scalar multiplications are then run simultaneously, sharing their doublings (Straus–Shamir’s trick): one double-and-add loop of half the length, adding P, ϕ⁢(P), or both according to the bits of n1 and n2. The result costs about half the doublings of a single full-length double-and-add—a substantial saving, and its availability is one reason the Pasta curves take the form y2=x3+b over primes p≡1(mod3).

10.13 A worked toy example

The entire machinery now runs on a curve small enough for hand computation.

Example 10.38 (The curve y2=x3+5 over 𝔽11).

Take p=11: then p>3, and 4⋅0+27⋅52=675≡4≢0(mod11), so the curve E:y2=x3+5 is nonsingular over 𝔽11 (10.5). Squaring the residues 0,1,…,10 yields the squares {0,1,3,4,5,9}, so the nonzero quadratic residues are {1,3,4,5,9}. Tabulating f⁢(x)=x3+5mod11 and reading off the y-values:

xx3mod11f⁢(x)=x3+5y⁢ with ⁢y2=f⁢(x)005±4⁢(42=16≡5)116none⁢(6∉QR)282none3510none493±5⁢(52=25≡3)549±3671±1727none8600938none10104±2

Counting: the five values x∈{0,4,5,6,10} contribute two points each (10 points), x=8 contributes the single point (8,0), and 𝒪 completes the census:

#⁢E⁢(𝔽11)=10+1+1=12.

Hasse’s bound checks out: p+1=12, so the trace is t=0, and indeed |t|=0≤2⁢11≈6.63. The point (8,0) has order 2, consistent with 10.25 and the even order 12; here −5≡6 is a cube, namely 83=512≡6.

An addition. Let P=(0,4) and Q=(5,3). Since x1=0≠5=x2, the chord formula (12) applies:

λ=3−45−0=(−1)⋅5−1=(−1)⋅9=−9≡2(mod11),

using 5−1=9 (check: 5⋅9=45≡1). Then

x3=λ2−x1−x2=4−0−5=−1≡10,y3=λ⁢(x1−x3)−y1=2⁢(0−10)−4=−24≡9,

so P+Q=(10,9). The result is on the curve: 92=81≡4 and 103+5=1005≡4(mod11), as required.

A doubling. Take P=(0,4). With a=0, formula (13) gives

λ=3⁢x12+a2⁢y1=08=0,x3=λ2−2⁢x1=0,y3=λ⁢(x1−x3)−y1=−4≡7,

so [2]⁢(0,4)=(0,7)=−(0,4). Hence [3]⁢(0,4)=𝒪: the point (0,4) has order 3.

The GLV endomorphism. Since 11≡2(mod3), the field 𝔽11 contains no primitive cube root of unity (6.22 requires 3∣p−1), so the GLV map is not available over 𝔽11. The Pasta primes do satisfy p≡q≡1(mod3), so GLV applies there. For a small GLV-friendly illustration take instead p=13≡1(mod3), where ω=3 satisfies 32+3+1=13≡0(mod13); then ϕ⁢(x,y)=(3⁢x,y) is a nontrivial endomorphism of y2=x3+b over 𝔽13.

10.14 Pallas and Vesta assembled

Every property developed in this section was chosen with the closing example in mind. Here the pieces assemble.

Example 10.39 (The Pasta curves).

For the running example y2=x3+5, with p and q the 255-bit primes of the section opening:

  • •

    Pallas, over 𝔽p: the order is #⁢Ep⁢(𝔽p)=q, a prime, so the group is cyclic, Ep⁢(𝔽p)≅ℤ/q⁢ℤ (3.34), with cofactor h=1 (10.24). The trace is t=p+1−q, an 87-bit (negative) integer, far inside the Hasse bound 2⁢p≈2128 of 10.22.

  • •

    Vesta, over 𝔽q: the order is #⁢Eq⁢(𝔽q)=p, a prime, so Eq⁢(𝔽q)≅ℤ/p⁢ℤ, again with cofactor 1.

  • •

    Both curves have j=0 (10.35), and both primes satisfy p≡q≡1(mod3), so each curve admits the order-3 endomorphism ϕ⁢(x,y)=(ω⁢x,y) of 10.36 and supports the GLV speedup of 10.37.

  • •

    Both fields have two-adicity 32 in the sense of 9.10: 232 divides p−1 and q−1, so each field carries the multiplicative subgroups of order 232 promised by 10.28—the evaluation domains of the fast polynomial arithmetic of 9.

  • •

    The cycle property #⁢Ep⁢(𝔽p)=q and #⁢Eq⁢(𝔽q)=p means the scalar field of each curve is the base field of the other (10.27): the base field of Pallas is 𝔽p and its scalar field is 𝔽q, matching the base field of Vesta, and symmetrically. This is exactly what lets recursive proof systems chain proofs across the two curves without expensive non-native field arithmetic (10.28). The cycle is a deployed fact: the pasta_curves crate wires the scalar field of Pallas to be 𝔽q and that of Vesta to be 𝔽p, as specified in §5.4.9.6 of the Zcash protocol specification.

The discrete logarithm problem in Ep⁢(𝔽p) and Eq⁢(𝔽q) is believed to require about 2127 operations—r for the 255-bit orders r≈2254 (10.30)—with no faster attack known (10.31), just below the 128-bit security level targeted by Halo 2 and Zcash Orchard.

The cheque from the section’s opening is hereby cashed. The demand was a roughly 255-bit group for which no attack faster than the square-root bound is known, and each Pasta curve supplies one: a cyclic group of prime 255-bit order (10.22 and 3.34), carrying a fast forward map (10.21, accelerated by 10.37) whose inversion—the ECDLP—resists everything known except the generic O⁢(r) attacks of 10.30. Where 𝔽p× needs thousands of bits to outrun index calculus, the curve group needs 255; and the two groups even interlock as a cycle, each one’s scalars living in the other’s coordinates. Later volumes build on precisely this pair.