Documentation

Cryptlib.Primitives.Sign.Ed25519_facts

Arithmetic facts about p = 2^255 - 19 #

The non-squareness of d is Euler's criterion evaluated by decide +kernel, with fuelled square-and-multiply so the exponent never unfolds in unary.

Square-and-multiply modulo m, structural on fuel so the kernel can evaluate it.

Equations
Instances For
    theorem Cryptlib.Primitives.Sign.Ed25519Facts.powModAux_modEq (m fuel b e acc : ℕ) :
    e < 2 ^ fuel → powModAux m fuel b e acc ≡ acc * b ^ e [MOD m]
    theorem Cryptlib.Primitives.Sign.Ed25519Facts.pow_eq_powModAux (m a e fuel : ℕ) (he : e < 2 ^ fuel) :
    ↑a ^ e = ↑(powModAux m fuel a e 1)

    a ^ e in ZMod m computed by binary exponentiation.

    The small integer -121665 * 121666 mod p; d = -121665/121666 is this over 121666^2.

    Equations
    Instances For

      Edwards d for Ed25519.

      Equations
      Instances For

        d is not a square in F.

        theorem Cryptlib.Primitives.Sign.Ed25519Facts.not_sq_of_d_mul {t s : F} (ht : t ≠ 0) (h : d * t ^ 2 = s ^ 2) :

        d times a nonzero square is never a square.

        √-1 in F.

        Equations
        Instances For

          c = √-486664, the constant of the birational map.

          Equations
          Instances For

            d * c^2 = 486660, i.e. A - 2 for A = 486662.

            No point of Curve25519 has u = -1: that would need 486660 to be a square.

            (0,0) is the only point of Curve25519 with v = 0: u² + 486662u + 1 has no root.