Interpret a packed single-word binary modulus as the corresponding generic
FpPoly 2 polynomial. lower supplies the coefficients of degrees < n;
the leading degree-n coefficient is inserted explicitly.
Equations
- Hex.GFq.packedGF2FpPoly lower n = Hex.FpPoly.ofCoeffs ((List.map (fun (i : Nat) => if lower >>> i.toUInt64 &&& 1 = 0 then 0 else 1) (List.range n)).toArray.push 1)
Instances For
A committed Conway-table entry at p = 2 that is also available as a
single-word packed GF2n modulus. The lower field stores the lower
coefficients of the monic degree-n modulus; the leading x^n coefficient is
implicit in GF2Poly.ofUInt64Monic lower n.
- entry : Conway.SupportedEntry 2 n
- lower : UInt64
- packed_irreducible : (GF2Poly.ofUInt64Monic (lower n) n).Irreducible
Instances
The packed modulus corresponding to the committed Conway entry C(2, 1) = X + 1.
The current committed table supports a packed GF2n view of C(2, 1).
Equations
- One or more equations did not get rendered due to their size.
The packed Conway modulus for C(2, 2) (0x3) is irreducible,
checked from its certificate.
The packed Conway modulus for C(2, 3) (0x3) is irreducible,
checked from its certificate.
The packed Conway modulus for C(2, 5) (0x5) is irreducible,
checked from its certificate.
The packed Conway modulus for C(2, 6) (0x1B) is irreducible,
checked from its certificate.
The packed Conway modulus for C(2, 7) (0x3) is irreducible,
checked from its certificate.
The packed Conway modulus for C(2, 8) (0x1D) is irreducible,
checked from its certificate.
This is not the AES modulus. AES uses x^8 + x^4 + x^3 + x + 1 (0x1B), a
different irreducible of the same degree, so GF2q 8 and the AES field are
different presentations of the same 256-element field.
The committed table supports a packed GF2n view of C(2, 2).
Equations
- One or more equations did not get rendered due to their size.
The committed table supports a packed GF2n view of C(2, 3).
Equations
- One or more equations did not get rendered due to their size.
The committed table supports a packed GF2n view of C(2, 4).
Equations
- One or more equations did not get rendered due to their size.
The committed table supports a packed GF2n view of C(2, 5).
Equations
- One or more equations did not get rendered due to their size.
The committed table supports a packed GF2n view of C(2, 6).
Equations
- One or more equations did not get rendered due to their size.
The committed table supports a packed GF2n view of C(2, 7).
Equations
- One or more equations did not get rendered due to their size.
The committed table supports a packed GF2n view of C(2, 8).
Equations
- One or more equations did not get rendered due to their size.
Canonical finite field with p^n elements for a committed Conway-table
entry, using the generic quotient-field representation.
Equations
- Hex.GFq p n h = Hex.GFqField.FiniteField (Hex.Conway.conwayPoly p n h) ⋯ ⋯ ⋯
Instances For
The Conway modulus selected for a committed GFq p n entry.
Equations
- Hex.GFq.modulus h = Hex.Conway.conwayPoly p n h
Instances For
GFq.modulus is the Conway polynomial selected by the committed entry.
The selected Conway modulus has positive degree.
The selected Conway modulus is irreducible.
The selected Conway modulus lives over a prime base field.
Reduce a polynomial into the canonical field selected by a committed Conway entry.
The entry already carries h.prime, so this needs no separate prime-modulus
instance from the caller.
Equations
- Hex.GFq.ofPoly h g = Hex.GFqField.ofPoly (Hex.GFq.modulus h) ⋯ ⋯ ⋯ g
Instances For
GFq.ofPoly delegates to the generic quotient-field constructor with the
selected Conway modulus.
Project a canonical field element to its reduced polynomial representative.
Equations
- x.repr = Hex.GFqField.repr x
Instances For
GFq.repr is the generic quotient-field representative projection.
Two canonical GFq elements are equal when their reduced polynomial
representatives agree.
The canonical representative of an injected FpPoly is that polynomial
reduced modulo the selected Conway polynomial. Lets a caller normalise a
repr (ofPoly h g) round-trip to a plain reduceMod.
The canonical representative of 0 in GFq is reduction of 0 modulo
the selected Conway polynomial.
The canonical representative of 1 in GFq is reduction of 1 modulo
the selected Conway polynomial.
The canonical representative of a sum in GFq reduces from the sum of
representatives modulo the selected Conway polynomial.
The canonical representative of a product in GFq reduces from the product
of representatives modulo the selected Conway polynomial.
The representative of a negation reduces from the negated representative.
The representative of a subtraction reduces from the difference of representatives.
The canonical representative of a natural literal in GFq is the
reduction modulo the selected Conway polynomial of the constant
polynomial carrying the literal as a ZMod64 coefficient.
The canonical representative of a quotient in GFq lifts the
quotient-ring product of the dividend's representative with the inverse of
the divisor.
The canonical representative of a natural power in GFq lifts the
quotient-ring power of the underlying quotient representative.
The canonical representative of a nonnegative integer power in GFq lifts
the quotient-ring power of the underlying quotient representative.
The canonical representative of a negative integer power in GFq lifts
the inverse of the corresponding quotient-ring positive power.
The canonical representative of an integer literal in GFq lifts the
quotient-ring integer-cast representative.
The representative of a natural scalar action lifts the quotient-ring action.
The representative of an integer scalar action lifts the quotient-ring action.
The zero inverse in GFq follows the field wrapper's junk-value
convention and has zero representative.
The zero inverse in GFq follows the field wrapper's junk-value convention.
Division in GFq is multiplication by inverse.
A nonzero GFq element cancels against its inverse on the right.
A nonzero GFq element cancels against its inverse on the left.
Two GFq.ofPoly constructors produce the same field element exactly when
their inputs have the same reduced representative modulo the selected Conway
polynomial.
Injecting an FpPoly into GFq is invariant under pre-reduction modulo
the selected Conway polynomial: a caller may drop a reduceMod already
sitting under ofPoly.
The Frobenius endomorphism on the canonical Conway-backed field, computed
as the p-th power on the underlying quotient representation.
Equations
- x.frob = Hex.GFqField.frob x
Instances For
GFq.frob is the p-th power map.
The representative of GFq.frob is the quotient-ring p-th power
representative.
Ergonomic generic finite field for a committed Conway-table entry.
Use GFqC p n when the committed entry should be inferred from the current
Conway table. Use explicit GFq p n h when a proof needs to name the witness.
Equations
- Hex.GFqC p n = Hex.GFq p n Hex.GFq.CommittedEntry.entry
Instances For
The committed Conway-table entry selected for GFqC p n.
Equations
Instances For
The Conway modulus selected for the committed GFqC p n field.
Equations
Instances For
Hex.GFqC.modulus delegates to the explicit-entry
Hex.GFq.modulus.
Reduce a polynomial into the committed GFqC p n field.
Equations
Instances For
GFqC.ofPoly delegates to the explicit-entry GFq.ofPoly.
Project a committed GFqC element to its reduced polynomial representative.
Equations
- x.repr = Hex.GFq.repr x
Instances For
The representative of an injected polynomial is reduction modulo the selected committed Conway polynomial.
The canonical representative of a sum in GFqC reduces from the sum of
representatives modulo the selected committed Conway polynomial.
The canonical representative of a product in GFqC reduces from the
product of representatives modulo the selected committed Conway polynomial.
The Frobenius endomorphism on the committed GFqC p n field.
Equations
- x.frob = Hex.GFq.frob x
Instances For
GFqC.frob is the p-th power map.
The representative of GFqC.frob is the quotient-ring p-th power
representative.
Optimized canonical binary field for committed Conway entries that have a single-word packed modulus.
Equations
- Hex.GF2q n = Hex.GF2n n (Hex.GFq.PackedGF2Entry.lower n) ⋯ ⋯ ⋯
Instances For
The supported Conway-table entry backing this optimized binary field.
Instances For
GF2q.supportedEntry is the committed packed Conway entry.
GF2q.lower is the lower-word modulus stored in the packed entry.
GF2q.modulus is the packed monic polynomial selected by the entry.
The packed modulus, viewed through the generic FpPoly 2 representation,
is the committed Conway polynomial for this entry.
The generic GFq modulus for a packed binary entry agrees with the packed
modulus viewed as an FpPoly 2.
The selected packed modulus has positive extension degree.
The selected packed modulus fits in the single-word GF2n representation.
The selected packed modulus is irreducible.
Reduce a machine word into the optimized binary field selected by a committed packed Conway entry.
Equations
Instances For
GF2q.ofWord delegates to the packed GF2n reducer for the selected
Conway modulus.
Project an optimized binary field element to its packed machine-word representative.
Instances For
GF2q.repr is the packed-word value stored by GF2n.
Interpret the low n bits of a packed binary word as an FpPoly 2
polynomial.
Equations
- Hex.GF2q.wordFpPoly w = Hex.FpPoly.ofCoeffs (List.map (fun (i : Nat) => if w >>> i.toUInt64 &&& 1 = 0 then 0 else 1) (List.range n)).toArray
Instances For
Interpret the packed representative of an optimized binary-field element
as a generic FpPoly 2 polynomial.
Equations
Instances For
Map an optimized packed canonical binary-field element into the generic
canonical GFq 2 n model for the same committed Conway entry.
Equations
Instances For
GF2q.reprFpPoly is the low-bit FpPoly 2 view of the packed
representative.
GF2q.toGFq injects the packed representative through GFq.ofPoly.
Bridging a packed word into GFq 2 n injects the reduced packed
representative as an FpPoly 2.
The generic representative of GF2q.toGFq is the selected Conway-modulus
reduction of the packed representative viewed as an FpPoly 2.
Two optimized GF2q elements are equal when their packed representatives
agree.
The packed representative of a word injected into GF2q is that word
reduced into the field by GF2n.reduce, relating the raw UInt64 word to the
canonical packed GF2q representation.
The packed representative of 0 in GF2q is the zero word.
The packed representative of 1 in GF2q is the one word.
The packed representative of a natural-number literal is stored by the packed backend's characteristic-two natural cast.
The packed representative of an integer literal is stored by the packed backend's characteristic-two integer cast.
In characteristic two, negation preserves the packed representative.
The packed representative of a subtraction is the reduced XOR of representatives.
The packed representative of a sum is the reduced XOR of representatives.
The packed representative of a product is the reduced carry-less product of representatives.
The packed representative of an inverse is the representative stored by
the packed GF2n inversion path.
The packed representative of a quotient is the representative stored by
the packed GF2n division path.
The packed representative of a negative integer power is stored by the
packed GF2n integer-power operation.