Documentation

HexConway.Power

def Hex.Conway.compose {p : Nat} [ZMod64.Bounds p] (f g modulus : FpPoly p) (hm : DensePoly.Monic modulus) :

Kernel-replayable modular composition using structural Horner evaluation.

Equations
Instances For
    theorem Hex.Conway.compose_eq {p : Nat} [ZMod64.Bounds p] (f g modulus : FpPoly p) (hm : DensePoly.Monic modulus) :
    compose f g modulus hm = f.composeModMonicImpl g modulus hm

    Structural composition agrees with the compiled packed dispatcher.

    @[csimp]

    Preserve the optimized implementation in compiled clients.

    def Hex.Conway.powAux {p : Nat} [ZMod64.Bounds p] (f : FpPoly p) (hm : DensePoly.Monic f) :
    NatNatFpPoly pFpPoly pFpPoly p

    Structural square-and-multiply. Fuel bounds the number of steps; the exponent is halved at each step. No well-founded recursion is replayed.

    Equations
    Instances For
      theorem Hex.Conway.powAux_eq {p : Nat} [ZMod64.Bounds p] (f : FpPoly p) (hm : DensePoly.Monic f) (fuel n : Nat) (base acc : FpPoly p) (h : n fuel) :
      powAux f hm fuel n base acc = f.powModMonicAux hm n base acc

      With sufficient fuel, structural replay agrees with executable modular power.

      def Hex.Conway.powMod {p : Nat} [ZMod64.Bounds p] (base f : FpPoly p) (hm : DensePoly.Monic f) (n : Nat) :

      Kernel-replayable binary modular power. The exponent itself is a conservative fuel bound; only logarithmically many steps are evaluated.

      Equations
      Instances For
        theorem Hex.Conway.powMod_eq {p : Nat} [ZMod64.Bounds p] [ZMod64.PrimeModulus p] (base f : FpPoly p) (hm : DensePoly.Monic f) (n : Nat) :
        powMod base f hm n = base.powModMonicLinear f hm n

        Structural binary power computes the same residue as linear power.

        One Frobenius step checked by structural binary exponentiation.

        Equations
        Instances For

          Binary replay of the committed Frobenius chain.

          Equations
          • One or more equations did not get rendered due to their size.
          Instances For

            Rabin certificate replay using binary modular powers. The certificate shape and every check other than the power implementation are unchanged.

            Equations
            • One or more equations did not get rendered due to their size.
            Instances For

              Binary replay preserves the existing Rabin checker exactly.