GF(2¹²⁸) as a tower of quadratic extensions over GF(2⁸) #
GF(2¹⁶) = GF(2⁸)[y₁] / (y₁² + y₁ + c₁)
GF(2³²) = GF(2¹⁶)[y₂] / (y₂² + y₂ + c₂)
GF(2⁶⁴) = GF(2³²)[y₃] / (y₃² + y₃ + c₃)
GF(2¹²⁸) = GF(2⁶⁴)[y₄] / (y₄² + y₄ + c₄)
The AMD tag uses this field to detect forged shares
(README: Forged shares). Each step is the
same construction, so there is one generic type, Quad K: an element lo + hi·y stored as the
pair (lo, hi). An element of GF(2¹²⁸) is 16 bytes, and those bytes are its coordinates over
GF(2⁸). That matters for the AMD proof: multiplying every byte by the same a ∈ GF(2⁸)
(which is what a forger can do to the rebuilt secret) is multiplication by a in the field.
The constants are c₁ = 0x20 and cₙ = 0x20 · y₁ ⋯ yₙ₋₁: in each case the top coordinate is
0x20 and the rest are zero. Each has trace 1 over GF(2), which is what makes y² + y + c
irreducible, so each step is a field. That proof lives in proofs/ (it needs Mathlib's finite
field theory); here we define the arithmetic and trace.
Only + and × are needed at runtime, both built from the constant-time GF(2⁸) multiply:
no branches, no tables, no inverse.