Documentation

Elligator.TwistedEdwardsCurve

Twisted Edwards curves #

This file contains the curve-level definitions that are independent of any specific Elligator. A twisted Edwards curve with coefficients a and d has affine equation a * x^2 + y^2 = 1 + d * x^2 * y^2.

The definitions are made over a commutative ring. Finiteness and the hypotheses used by a particular cryptographic construction belong in that construction, rather than in the definition of a curve or its affine points.

Mathlib's elliptic-curve API is currently centred on Weierstrass models. A twisted Edwards model is not itself a Weierstrass equation, so using WeierstrassCurve.Affine.Equation here would require a birational coordinate conversion and extra invertibility hypotheses. The API below follows the same useful separation as that API: coefficients, an affine equation, a set of affine points, and a bundled point type.

structure Elligator.TwistedEdwardsCurve (R : Type u_1) :
Type u_1

Coefficients of the twisted Edwards equation a * x^2 + y^2 = 1 + d * x^2 * y^2.

  • a : R

    left hand side coefficient

  • d : R

    right hand side coefficient

Instances For
    theorem Elligator.TwistedEdwardsCurve.ext {R : Type u_1} {x y : TwistedEdwardsCurve R} (a : x.a = y.a) (d : x.d = y.d) :
    x = y

    The proposition that (x, y) is an affine point of a twisted Edwards curve.

    Equations
    Instances For

      The set of affine coordinate pairs on a twisted Edwards curve.

      Equations
      Instances For
        @[reducible, inline]

        A bundled affine point on a twisted Edwards curve.

        Equations
        Instances For

          The neutral affine coordinate pair (0, 1). It lies on every twisted Edwards equation.

          Equations
          Instances For

            The neutral point, bundled as an affine point of E.

            Equations
            Instances For
              def Elligator.TwistedEdwardsCurve.neg {R : Type u_1} [CommRing R] (p : R × R) :
              R × R

              Negation of affine coordinates on a twisted Edwards curve.

              Equations
              Instances For

                The usual coefficient conditions for a nonsingular twisted Edwards model over a field. Keeping this predicate separate from TwistedEdwardsCurve permits the equation and its points to be used over more general rings and also permits partially specified curves during developments.

                Equations
                Instances For

                  The (untwisted) Edwards curve with parameter d, obtained by setting a = 1.

                  Equations
                  Instances For
                    @[simp]
                    theorem Elligator.TwistedEdwardsCurve.ofD_equation {R : Type u_1} [CommRing R] (d x y : R) :
                    (ofD d).Equation x y x ^ 2 + y ^ 2 = 1 + d * x ^ 2 * y ^ 2
                    @[simp]