Executable bytes for the degree-eight binary field #
Cslib.GF256.Byte is the canonical little-endian polynomial-basis byte for
F₂[X] / (X⁸ + X⁴ + X³ + X + 1). Its operations are executable list algorithms:
addition is byte XOR and multiplication folds the existing Cslib.modStep reduction by the
source modulus 0x11b. Exponentiation is the little-endian square-and-multiply fold; inversion
is exponentiation by 254, with 0⁻¹ = 0, and division inherits that total convention.
The semantic theorems identify every operation with the existing Cslib.BinaryField 8. The
native compiler section retains concrete finite-control transition tables rather than selecting
machines from finite-domain computability. Binary-operation inputs are exactly the two raw
eight-bit words concatenated; their fixed widths make framing unnecessary.
Main definitions #
Cslib.GF256.Byte,.encoding,.pairEncoding,.powEncoding: canonical raw encodings.Cslib.GF256.add,.mul,.pow,.inv,.div: executable field operations.Cslib.GF256.equivBinaryField: the existing power-basis equivalence withBinaryField 8.Cslib.GF256.Native.binaryCompiler: a constructive retained table for any binary byte operation, with exact static-size, time and workspace coordinates.Cslib.GF256.Native.invCompiler: the retained fixed-width inversion table.Cslib.GF256.Native.powCompiler: the retained streaming exponentiation table.
Main results #
Cslib.GF256.bits_ofBits,.ofBits_bits: exact-width codec laws.Cslib.GF256.field_add,.field_mul,.field_pow,.field_inv,.field_div: semantic refinement toBinaryField 8.Cslib.GF256.Native.computesInTimeAndSpace_binaryTable: the retained table computes its operation in 41 steps and zero workspace.Cslib.GF256.Native.computesInTimeAndSpace_unaryTable: fixed-width unary operations take 25 steps and zero workspace.Cslib.GF256.Native.computesInTimeAndSpace_powTable: exponentiation has clock2 * inputLength + 10and zero workspace.Cslib.GF256.Native.invCompiler_resourceBounds,.powCompiler_resourceBounds: checked tape, state, transition-row and whole-program bounds for the retained inversion and exponentiation compilers.Cslib.GF256.Native.computableInPolyTime_binary,.computableInPolyTime_unary, and.computableInPolyTime_pow: the corresponding asymptotic witnesses.
A polynomial-basis byte, numbered by its eight coefficients least significant first.
Read the first eight little-endian coefficients, padding a short word and truncating a long word.
Coefficients of X⁸ + X⁴ + X³ + X + 1, constant term first.
The byte representation of multiplication is modMulBits modulo modulusBits.
Total inversion, with inv 0 = 0, by the finite-field exponent 254.
The source modulus and semantic field refinement #
The executable coefficient list is the modulus of BinaryField 8.
The existing power-basis numbering of BinaryField 8 by bytes.
Interpret a byte as the corresponding element of BinaryField 8.
Retained native byte machines #
The three phases of a fixed-width binary byte operation: read the left word, read the right word, then emit the result.
- left (index : Fin 8) (word : BitString 8) : BinaryControl
- right (left : BitString 8) (index : Fin 8) (word : BitString 8) : BinaryControl
- emit (word : BitString 8) (index : Fin 8) : BinaryControl
Instances For
Constructive numeric encoding of every fixed-width binary-operation control state.
Retained tidy table for a fixed-width binary byte operation: execute the direct core, then return the input head to its canonical starting position.
Named compiler retaining the direct fixed-width operation table, its exact state encoding and
the core-plus-rewind table. In particular, staticBits charges the table hardwired by f.
Every retained fixed-width binary byte compiler gives an asymptotic polynomial-time witness;
the concrete witness remains binaryCompiler f, including its exact staticBits charge.
Retained native compiler for executable GF(256) addition.
Retained native compiler for executable GF(256) multiplication.
Retained native compiler for executable total GF(256) division.
Retained unary byte operations #
The two phases of a fixed-width unary byte operation: read its byte, then emit the result.
- read (index : Fin 8) (word : BitString 8) : UnaryControl
- emit (word : BitString 8) (index : Fin 8) : UnaryControl
Instances For
Constructive numeric encoding of every unary-operation control state.
Retained tidy table for a fixed-width unary byte operation.
A retained unary byte table consumes eight bits, emits eight bits, uses no work tape and halts within twenty-five steps.
Named compiler retaining a fixed-width unary byte table and its exact resources.
Every retained fixed-width unary byte compiler gives an asymptotic polynomial-time witness;
the concrete witness remains unaryCompiler f, including its exact staticBits charge.
Retained native compiler for executable total GF(256) inversion, including its concrete clock,
zero workspace bound and exact staticBits program-description charge.
Retained streaming exponentiation #
The phases of streaming exponentiation: read the base, fold exponent bits, then emit.
- base (index : Fin 8) (word : BitString 8) : PowControl
- exponent (state : Byte × Byte) : PowControl
- emit (word : BitString 8) (index : Fin 8) : PowControl
Instances For
Constructive numeric encoding of every streaming-exponentiation control state.
Retained tidy table that reads a raw base byte and streams the little-endian exponent bits.
The retained exponentiation table streams its unframed exponent, emits eight result bits, uses no work tape and has exact affine time in the encoded input length.
Named compiler retaining the streaming exponentiation table and its concrete affine clock,
zero workspace bound and exact staticBits program-description charge.
The inversion compiler takes 25 steps and zero workspace, has 4,098 states and 12,294 transition rows. Its final inequality charges the complete encoded program without expanding the large finite table to a decimal.
The exponentiation compiler takes twice the encoded input length plus 10 steps and zero workspace, and has 69,634 states and 208,902 transition rows. Its final inequality charges the complete encoded program without expanding the large finite table to a decimal.
Streaming GF(256) exponentiation is computable in polynomial time by powCompiler.