Montgomery elliptic curves #
A Montgomery curve over a commutative ring R is given by B v² = u³ + A u² + u with
B (A² - 4) ≠ 0 ([BS23], Section 15.2.1, p. 619). Over a field F, the coordinate
substitution (u, v) = (B x, B y) transforms this equation into the Weierstrass curve
M.toWeierstrass (Y² = X³ + (A/B) X² + (1/B²) X), which is the quadratic twist
(ofCubic M.A 1 0).quadraticTwist M.B⁻¹. When 2 ≠ 0 in F, M.toWeierstrass is elliptic and
M.toWeierstrassEquiv identifies M.Point with M.toWeierstrass.toAffine.Point. Over a finite
field of characteristic ≠ 2, 4 divides #M.Point, so no Montgomery curve is related by a
change of variables to a Weierstrass curve of odd order.
Main definitions #
MontgomeryCurve R: a Montgomery curveB v² = u³ + A u² + uwithB (A² - 4) ≠ 0.MontgomeryCurve.Equation M u v: the affine curve equationB v² = u³ + A u² + u.MontgomeryCurve.Point M: the point at infinity.zerotogether with affine solutions.some u v h.MontgomeryCurve.pointEquivOption: bijection betweenM.PointandOptionof the affine solution subtype.MontgomeryCurve.toWeierstrass M: the Weierstrass modelofCubic (M.A / M.B) (1 / M.B ^ 2) 0.MontgomeryCurve.toWeierstrassEquiv: bijectionM.Point ≃ M.toWeierstrass.toAffine.Pointwhen2 ≠ 0.MontgomeryCurve.toShortWeierstrass M: the shifted curve eliminating the quadratic term when3 ≠ 0.
Main results #
MontgomeryCurve.natCard_point_eq_one_add: over a finite field of any characteristic,Nat.card M.Point = 1 + Nat.card {uv : F × F // M.Equation uv.1 uv.2}.MontgomeryCurve.toWeierstrass_eq_quadraticTwist:M.toWeierstrass = (ofCubic M.A 1 0).quadraticTwist M.B⁻¹.MontgomeryCurve.toWeierstrass_Δ,MontgomeryCurve.isElliptic_toWeierstrass,MontgomeryCurve.equation_iff_toWeierstrass: discriminant, ellipticity (2 ≠ 0), and affine equation equivalence forM.toWeierstrass, derived throughQuadraticTwist.MontgomeryCurve.isShortNF_toShortWeierstrass,MontgomeryCurve.not_isShortNF_toShortWeierstrass,MontgomeryCurve.toShortWeierstrass_eq_toShortNF,MontgomeryCurve.equation_iff_toShortWeierstrass: short Weierstrass reduction (3 ≠ 0forIsShortNF, comparison withWeierstrassCurve.toShortNFwhen2and3are invertible, failure in characteristic3whenA ≠ 0, and equation equivalence without3 ≠ 0).MontgomeryCurve.four_dvd_natCard_toWeierstrass_point,MontgomeryCurve.four_dvd_natCard_point,MontgomeryCurve.not_variableChange_of_odd: over a finite field of characteristic≠ 2,4divides the order ofM, ruling out any admissible change of variables to an odd-order Weierstrass curve.
References #
- D. Boneh, V. Shoup, A Graduate Course in Applied Cryptography, Section 15.2.1 (p. 619).
The twist coefficient M.B is nonzero.
The Montgomery discriminant factor M.A ^ 2 - 4 is nonzero.
Over a finite field, the number of points on M is one (the point at infinity) plus the number
of affine solutions of M.Equation.
The Weierstrass model Y² = X³ + (A/B) X² + (1/B²) X of M, obtained by substituting
(u, v) = (B X, B Y). This coincides with the quadratic twist
(ofCubic M.A 1 0).quadraticTwist M.B⁻¹. The change of variables of [BS23],
Section 15.2.1, p. 619, u := B x - A/3 and v := B y, also removes the quadratic term; it is
toShortWeierstrass.
M.toWeierstrass is the quadratic twist of Y² = X³ + A X² + X by B⁻¹.
The discriminant of M.toWeierstrass is 16 (A² - 4) / B⁶.
When 2 ≠ 0 in F, M.toWeierstrass is an elliptic curve.
Affine solutions (B x, B y) of M.Equation correspond to affine solutions (x, y) of
M.toWeierstrass.
An affine point (u, v) on M maps to an affine solution (u / B, v / B) of
M.toWeierstrass.
When 2 ≠ 0, an affine point (u, v) on M maps to a nonsingular point (u / B, v / B) on
M.toWeierstrass.
Equivalence between M.Point and the affine points of M.toWeierstrass when 2 ≠ 0
([BS23], Section 15.2.1, p. 619).
M.toWeierstrassEquiv maps .zero to 0.
M.toWeierstrassEquiv maps an affine point .some u v h to .some (u / M.B) (v / M.B).
(M.toWeierstrassEquiv h2).symm maps 0 to .zero.
(M.toWeierstrassEquiv h2).symm maps .some x y h to .some (M.B * x) (M.B * y).
Shift X ↦ X - A / (3 B) transforming M.toWeierstrass into short Weierstrass form when
3 ≠ 0 ([BS23], Section 15.2.1, p. 619).
When 2 and 3 are invertible in F, M.toShortWeierstrass equals the curve obtained from
M.toWeierstrass via Mathlib's WeierstrassCurve.toShortNF.
When 3 ≠ 0, M.toShortWeierstrass is in short Weierstrass normal form (a₁ = a₂ = a₃ = 0).
In characteristic three (3 = 0 in F), if M.A ≠ 0 then M.toShortWeierstrass is not in
short normal form, since a₂ = A / B ≠ 0.
Affine solutions (B x - A / 3, B y) of M.Equation correspond to affine solutions (x, y)
of M.toShortWeierstrass, without requiring 3 ≠ 0.
Over a finite field of characteristic ≠ 2, 4 ∣ #M.toWeierstrass(F) ([BS23],
Section 15.2.1, p. 619).
No Montgomery curve over a finite field of characteristic ≠ 2 is related by a change of
variables to a Weierstrass curve of odd order.