Exact-order certificate specialized to a power-of-two order. For a
power-of-two n, an nth root has exact order n precisely when it is not
already an (n / 2)th root (with the order-one case separated).
Instances For
Equations
An exact-order certificate includes the root-of-unity equation.
Build a twiddle and its Shoup preconditioner.
Equations
- Hex.ZMod64.NttTwiddle.ofValue value = { value := value, precon := UInt64.ofNat (value.toNat * UInt64.word / p), precon_eq := ⋯ }
Instances For
A reusable radix-two NTT plan.
The requested transform length is a power of two.
The transform length divides the order of the prime field's unit group.
- root : ZMod64 p
Primitive transform root.
- root_order : self.root.ExactOrder n
The root has exact power-of-two order
n. - invRoot : ZMod64 p
Inverse transform root.
The stored inverse root is the multiplicative inverse of
root.- invLength : ZMod64 p
Inverse of the transform length modulo
p. The stored length inverse is the inverse of the natural cast of
n.- forwardTwiddles : Array (NttTwiddle p)
Reusable forward root powers and Shoup preconditioners.
There is one forward power for every exponent below
n.Every stored forward twiddle is the corresponding root power.
- inverseTwiddles : Array (NttTwiddle p)
Reusable inverse-root powers and Shoup preconditioners.
There is one inverse power for every exponent below
n.Every stored inverse twiddle is the corresponding inverse-root power.
Instances For
Everything checked by NTT plan construction.
Equations
- Hex.ZMod64.NttPlan.Valid n root = (Hex.ZMod64.IsPowTwo n ∧ n ∣ p - 1 ∧ root.ExactOrder n)
Instances For
Equations
Table of the first n powers of a root, with Shoup preconditioners.
Equations
- Hex.ZMod64.NttPlan.twiddles root n = Array.ofFn fun (i : Fin n) => Hex.ZMod64.NttTwiddle.ofValue (root ^ ↑i)
Instances For
Validate a requested root and build all reusable transform data.
Equations
- One or more equations did not get rendered due to their size.