Binary exponentiation in a polynomial-basis field #
The exponent remains a little-endian bit string. The loop performs one squaring and at most one multiplication per bit and keeps fixed-width coefficient vectors. Its polynomial bound also holds for malformed inputs.
@[reducible, inline]
Equations
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
theorem
MIPRE.LowDegree.BinaryPolynomial.powerStep_width
(s : PowerState)
(b : Bool)
:
(powerStep s b).1 = s.1 ∧ List.length (powerStep s b).2.1 ≤ List.length s.2.1 ∧ List.length (powerStep s b).2.2 ≤ List.length s.2.2
theorem
MIPRE.LowDegree.BinaryPolynomial.fold_powerStep_width
(l : Cost.BitStr)
(s : PowerState)
:
(List.foldl powerStep s l).1 = s.1 ∧ List.length (List.foldl powerStep s l).2.1 ≤ List.length s.2.1 ∧ List.length (List.foldl powerStep s l).2.2 ≤ List.length s.2.2
theorem
MIPRE.LowDegree.BinaryPolynomial.fold_powerStep_length
(l p a c : Cost.BitStr)
(ha : List.length a = List.length p)
(hc : List.length c = List.length p)
:
Repeated squaring with a binary exponent.
Equations
Instances For
theorem
MIPRE.LowDegree.BinaryPolynomial.length_powerBits
(p a e : Cost.BitStr)
(ha : List.length a = List.length p)
:
theorem
MIPRE.LowDegree.BinaryPolynomial.evalBits_fold_powerStep
{R : Type u_1}
[CommRing R]
[CharP R 2]
(z : R)
(p a c e : Cost.BitStr)
(hroot : z ^ List.length p = evalBits z p)
(ha : List.length a = List.length p)
(hc : List.length c = List.length p)
:
theorem
MIPRE.LowDegree.BinaryPolynomial.evalBits_powerBits
{R : Type u_1}
[CommRing R]
[CharP R 2]
(z : R)
(p a e : Cost.BitStr)
(hp : p ≠ [])
(hroot : z ^ List.length p = evalBits z p)
(ha : List.length a = List.length p)
:
Correctness for every characteristic-two ring containing a root of the modulus.
Equations
- One or more equations did not get rendered due to their size.
Instances For
One uniform ambient program for exponentiation with binary exponent input.
Equations
- One or more equations did not get rendered due to their size.
Instances For
@[simp]