Polynomial-size Boolean circuits for binary-field arithmetic #
The mass-production manuscript needs arithmetic in GF(2^width) at cost
polynomial in width. Treating a field operation as an arbitrary finite
function would cost exponential size and is not sufficient for the scheduler
ledger.
Here GF(2^width) is represented in an arbitrary fixed vector-space basis
over ZMod 2. Addition is coordinatewise XOR. Multiplication is expanded
through the hardwired basis structure constants, so every output coordinate
is a Boolean polynomial with width^2 quadratic terms. The resulting
De Morgan circuit has cubic cost. This is nonuniform in the basis, exactly
as allowed by the manuscript's circuit model, but its size proof is explicit
and polynomial.
The binary extension field of vector-space dimension width.
Equations
- Algebraic.MassProduction.BinaryExtension width = GaloisField 2 width
Instances For
A fixed width-element basis of GF(2^width) over its prime field.
Equations
- Algebraic.MassProduction.binaryExtensionBasis width widthPositive = Module.finBasisOfFinrankEq (ZMod 2) (Algebraic.MassProduction.BinaryExtension width) ⋯
Instances For
Encode width Boolean coordinates as one element of GF(2^width).
Equations
- One or more equations did not get rendered due to their size.
Instances For
Decode a field element into coordinates in the fixed basis.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Encoding bit vectors in the fixed basis is injective.
Zero has the all-zero coordinate vector in the chosen field basis.
Coordinates of an encoded bit string are the corresponding prime-field bits.
Mapping a decoded coordinate back to the prime field returns the basis coordinate of the field element.
The chosen representation has exactly 2^width field elements.
Encoding turns coordinatewise XOR into field addition.
One hardwired multiplication structure constant of the fixed field basis, represented as a Boolean bit.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Multiplication coordinates are bilinear polynomials in the input coordinates, with the chosen basis multiplication table as coefficients.
Row-major index of one bit in a pair of field elements.
Equations
- Algebraic.MassProduction.binaryExtensionPairIndex side coordinate = finProdFinEquiv (side, coordinate)
Instances For
Select one of the two encoded field elements supplied to a binary field operation.
Equations
- Algebraic.MassProduction.binaryExtensionPairInput input side coordinate = input (Algebraic.MassProduction.binaryExtensionPairIndex side coordinate)
Instances For
One structure-constant term contributing to a field multiplication coordinate.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Boolean polynomial for one output coordinate of field multiplication.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Each multiplication-table term has two Boolean AND nodes.
One multiplication coordinate compiles to exactly 6 * width^2
standard De Morgan gates: two ANDs and four XOR-implementation gates per
structure-table entry.
Multiplication on encoded binary-field values, exposed as a Boolean vector function.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The structure-constant expression computes the corresponding decoded coordinate of field multiplication.
Gate count produced by compiling one multiplication coordinate.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Explicit De Morgan circuit for multiplication in GF(2^width).
Equations
- One or more equations did not get rendered due to their size.
Instances For
The explicit multiplication circuit has exactly the encoded field multiplication semantics.
Exact standard cost of the structure-constant multiplication circuit.
Cubic field-multiplication cost in a conventional power notation.
One coordinatewise XOR expression for binary-field addition.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Boolean representation of binary-field addition.
Equations
Instances For
The coordinatewise XOR representation agrees with addition in the chosen extension field.
Gate count produced by compiling one addition coordinate.
Equations
Instances For
Explicit coordinatewise De Morgan circuit for binary-field addition.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Field addition costs exactly four standard gates per coordinate with the chosen four-gate XOR implementation.
Free projection of one field element from a row-major pair.
Equations
- One or more equations did not get rendered due to their size.
Instances For
binaryExtensionSideCircuit is pure wiring: it has no gates.
Boolean representation of squaring one encoded field element.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Squaring circuit obtained by feeding one input vector to both sides of the multiplication circuit.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The exact gate count of binaryExtensionSquareCircuit.
A parallelPair circuit has exactly the corresponding packed-pair
semantics.
Squaring the second state component while retaining the two-component input namespace.
Equations
- One or more equations did not get rendered due to their size.
Instances For
binaryExtensionSquareRightCircuit has exactly the gates of binaryExtensionSquareCircuit; the
surrounding wiring adds none.
Encoding the squaring output gives the square of the encoded input.
Encoding the multiplication output gives the product of the two encoded input blocks.
Inputs for one inverse-state update: the square of the second component, followed by the unchanged first component.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The exact gate count of binaryExtensionInverseUpdateInputsCircuit.
Field-level semantics of one inverse-state update.
De Morgan circuit for one shared inverse-exponentiation state round.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The exact gate count of binaryExtensionInverseStepCircuit.
One inverse-exponentiation round costs exactly two field multiplications.
Starting from (x, x), after steps rounds the state is
(x, x^(2^(steps+1)-1)) at the field level.
Duplicate one encoded field input into the initial inverse state.
Equations
- One or more equations did not get rendered due to their size.
Instances For
binaryExtensionInverseInitialCircuit is pure wiring: it has no gates.
State circuit after the fixed width - 2 inverse-exponentiation
rounds.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The exact gate count of binaryExtensionInverseStateCircuit.
Select the accumulated exponent before the final squaring.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The exact gate count of binaryExtensionInversePreSquareCircuit.
Explicit inverse circuit using the addition chain
x -> x^3 -> x^7 -> ... -> x^(2^(width-1)-1), followed by one square.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The exact gate count of binaryExtensionInverseCircuit.
The field element encoded by the inverse circuit is x^(2^width-2).
In a binary extension field, the penultimate positive power is the multiplicative inverse of every nonzero element.
On nonzero inputs, the explicit circuit computes multiplicative
inversion in GF(2^width).
Proof-parameter-stable form of inverse-circuit correctness.
Exact cost of the inverse addition chain: two multiplications per round, followed by one final squaring.
The explicit inversion circuit has quartic Boolean gate cost.