Galois Fields
in Hardware

Finite field theory and its applications in digital design
Galois Fields in Hardware — Brendan Lynskey 2025

Navigate: arrow keys or swipe · Press ESC for overview

Contents

Theory

  • 01 What is a Finite Field?
  • 02 Evariste Galois
  • 03 GF(2) — The Binary Field
  • 04 GF(2) and Digital Hardware
  • 05 Polynomial Representation
  • 06 GF(2n) Extension Fields
  • 07 GF(23) — Worked Example
  • 08 Addition in GF(2n)
  • 09 Multiplication in GF(2n)

Applications

  • 10 Irreducible Polynomials
  • 11 Key Properties
  • 12 Application: CRC
  • 13 Application: LFSR
  • 14 Application: AES
  • 15 Application: Reed-Solomon & ECC
  • 16 Summary & References

What is a Finite Field?

A field is a set $F$ with two operations ($+$ and $\cdot$) satisfying these axioms:

Closure

$a + b \in F$ and $a \cdot b \in F$ for all $a, b \in F$

Associativity

$(a + b) + c = a + (b + c)$ and $(a \cdot b) \cdot c = a \cdot (b \cdot c)$

Commutativity

$a + b = b + a$ and $a \cdot b = b \cdot a$

Identity Elements

$\exists\, 0: a + 0 = a$  and  $\exists\, 1: a \cdot 1 = a$

Additive Inverse

$\forall\, a \in F,\; \exists\, {-a}: a + (-a) = 0$

Multiplicative Inverse

$\forall\, a \neq 0,\; \exists\, a^{-1}: a \cdot a^{-1} = 1$

A finite field (or Galois Field) has a finite number of elements. A finite field of order $q$ exists if and only if $q = p^n$ for some prime $p$ and positive integer $n$. It is denoted $GF(p^n)$ or $\mathbb{F}_{p^n}$.

Evariste Galois (1811–1832)

French mathematician who developed the foundations of group theory and field theory as a teenager, establishing the conditions under which polynomial equations can be solved by radicals.

A politically active Republican during turbulent times, Galois was expelled from the Ecole Normale and imprisoned twice. On 30 May 1832, aged twenty, he was mortally wounded in a duel.

The night before, he wrote feverishly to his friend Auguste Chevalier, scrawling in the margins:

"Je n'ai pas le temps"

"I have not the time"

E.G. 1811 – 1832 Bourg-la-Reine, France

His manuscripts, published posthumously in 1846 by Joseph Liouville, laid the groundwork for modern abstract algebra.

GF(2) — The Binary Field

The simplest Galois Field: $GF(2) = \{0, 1\}$ with two operations.

Addition (XOR)

+01
001
110

$a + b = a \oplus b$

Multiplication (AND)

×01
000
101

$a \cdot b = a \wedge b$

XOR = GF(2) Addition AND = GF(2) Multiplication

This is not an analogy — it is an exact algebraic correspondence.

GF(2) and Digital Hardware

Every XOR gate performs GF(2) addition. Every AND gate performs GF(2) multiplication.

XOR Gate = GF(2) Addition

A B A+B A + B (mod 2)

AND Gate = GF(2) Multiplication

A B A·B A × B (mod 2)
⚡
Digital circuits composed of XOR and AND gates are inherently performing arithmetic in $GF(2)$. The field axioms guarantee closure, invertibility, and distributivity.

Polynomial Representation

Elements of $GF(2^n)$ are polynomials of degree $\leq n{-}1$ with coefficients in $\{0,1\}$. Each polynomial maps to an $n$-bit binary string.

$x^3 + x + 1$ ⟶ 1 0 1 1
1 0 1 1 x³ x² x¹ x⁰

$x^2 + 1$  →  101

$x^2 + x$  →  110

$x^2 + x + 1$  →  111

$x + 1$  →  011

$x$  →  010

$1$  →  001

GF(2n) Extension Fields

To work with multi-bit data, we need fields larger than $GF(2)$. Extension fields $GF(2^n)$ contain $2^n$ elements.

Construction

Choose an irreducible polynomial $p(x)$ of degree $n$ over $GF(2)$. The field $GF(2^n)$ is:

$$GF(2^n) \cong GF(2)[x] \,/\, p(x)$$

That is: all polynomials over $GF(2)$, reduced modulo $p(x)$. The irreducible polynomial "wraps" higher-degree results back into the field, just as a modulus wraps integers.

$GF(2^3)$

8 elements · 3-bit values

$GF(2^8)$

256 elements · byte-sized (AES)

$GF(2^{32})$

~4B elements · CRC-32

GF(23) — Worked Example

Primitive polynomial: $p(x) = x^3 + x + 1$. The 8 field elements:

Power of $\alpha$PolynomialBinaryDecimal
—$0$0000
$\alpha^0$$1$0011
$\alpha^1$$x$0102
$\alpha^2$$x^2$1004
$\alpha^3$$x + 1$0113
$\alpha^4$$x^2 + x$1106
$\alpha^5$$x^2 + x + 1$1117
$\alpha^6$$x^2 + 1$1015
🔎
Here $\alpha$ is a root of $p(x) = x^3 + x + 1$, meaning $\alpha^3 = \alpha + 1$. Each successive power is computed by multiplying by $\alpha$ (shift left) and reducing modulo $p(x)$ when the degree reaches 3. The 7 non-zero elements cycle: $\alpha^7 = \alpha^0 = 1$.

Addition in GF(2n)

Addition is bitwise XOR of the binary representations. No carries, no modular reduction needed.

Worked Example in GF(23)

1 Choose two elements: $(x^2 + x)$ and $(x^2 + 1)$
2 Binary representations: 110 and 101
3 XOR: 110 $\oplus$ 101 $=$ 011
4 Result: 011 $= x + 1$

Polynomial view:

$(x^2 + x) + (x^2 + 1)$
$= (1{\oplus}1)x^2 + (1{\oplus}0)x + (0{\oplus}1)$
$= x + 1$

Key property:

Every element is its own additive inverse:
$a + a = 0$   (since $1 \oplus 1 = 0$)
So subtraction $=$ addition $=$ XOR.

Multiplication in GF(2n)

Multiply as polynomials, then reduce modulo the irreducible polynomial $p(x)$.

Worked Example in GF(23)

Compute $(x^2 + x) \times (x + 1)$ with $p(x) = x^3 + x + 1$

1 Polynomial multiplication: $(x^2 + x)(x + 1) = x^3 + x^2 + x^2 + x = x^3 + x$ ($x^2 + x^2 = 0$ in $GF(2)$)
2 Check degree: $\deg(x^3 + x) = 3 \geq n = 3$, so reduction is needed.
3 Reduce mod $p(x)$: $x^3 = x + 1$, so $x^3 + x = (x + 1) + x = 1$ ($2x = 0$ in $GF(2)$)
✓ Result: $(x^2 + x) \times (x + 1) = 1$ — they are multiplicative inverses.
110 × 011 → 1010 mod 1011 → 001 multiply raw product reduced

Irreducible Polynomials

An irreducible polynomial over $GF(2)$ cannot be factored into lower-degree polynomials over $GF(2)$. It plays the role of a prime number — defining the field's modular arithmetic.

ApplicationFieldPolynomialHex
CRC-8 $GF(2^8)$ $x^8 + x^2 + x + 1$ 0x107
CRC-16-CCITT $GF(2^{16})$ $x^{16} + x^{12} + x^5 + 1$ 0x11021
CRC-32 $GF(2^{32})$ $x^{32} + x^{26} + x^{23} + x^{22} + \ldots + 1$ 0x104C11DB7
AES $GF(2^8)$ $x^8 + x^4 + x^3 + x + 1$ 0x11B
💡
How it works: When a multiplication produces a polynomial of degree $\geq n$, XOR the irreducible polynomial to bring it back into range — analogous to modular arithmetic with integers.
Low weight = fewer XOR gates Primitive = generates all non-zero elements

Key Properties

The field axioms guarantee properties that hardware designers rely on:

Closure

The result of any addition or multiplication of field elements is always another field element. An $n$-bit XOR or multiply-and-reduce always yields a valid $n$-bit output.

Multiplicative Inverse

Every non-zero element $a$ has a unique $a^{-1}$ such that $a \cdot a^{-1} = 1$. Critical for AES SubBytes and Reed-Solomon decoding. By Fermat: $a^{-1} = a^{2^n - 2}$.

Self-Inverse Addition

$a + a = 0$ for all $a$. Subtraction is identical to addition (both are XOR). Simplifies hardware: no subtractor circuits needed.

Distributive Law

$a \cdot (b + c) = a \cdot b + a \cdot c$. Enables matrix formulations of encoding/decoding and parallelised CRC computation.

Associativity → pipeline-friendly Commutativity → operand reordering No carries → constant-time addition

Application: CRC

Cyclic Redundancy Check — polynomial division in $GF(2)$ for error detection.

A CRC treats the message as a polynomial $M(x)$ over $GF(2)$, divides by a generator polynomial $G(x)$, and appends the remainder as a check value. The receiver divides by $G(x)$ — a non-zero remainder indicates an error.

$\text{CRC} = M(x) \cdot x^r \mod G(x)$

LFSR-based CRC Hardware

r[3] r[2] r[1] r[0] data in feedback

Feedback taps correspond to non-zero coefficients of $G(x)$. Each clock cycle shifts data and XORs feedback.

github.com/BrendanJamesLynskey/CRC   Ethernet USB PCIe

Application: LFSR

Linear Feedback Shift Register — multiplication by $x$ in $GF(2^n)$.

How it works

An LFSR shifts its register contents by one position each clock cycle. Selected bits are XORed and fed back to the input. The feedback taps are defined by a polynomial over $GF(2)$.

With a primitive polynomial of degree $n$, the LFSR produces a maximum-length sequence of period $2^n - 1$, cycling through every non-zero element of $GF(2^n)$.

Applications

  • PRBS — pseudo-random bit sequences for BER testing
  • Scrambling — 64b/66b encoding in 10G/25G Ethernet
  • CRC computation — serial implementation
  • BIST — built-in self-test pattern generation
  • MISR — signature analysis for test compression
D[3] D[2] D[1] D[0] output

github.com/BrendanJamesLynskey/LFSR

Application: AES

The Advanced Encryption Standard operates on bytes as elements of $GF(2^8)$.

SubBytes — GF(28) Inversion

The SubBytes step — the core non-linear operation of AES — computes the multiplicative inverse of each byte in $GF(2^8)$ with irreducible polynomial $p(x) = x^8 + x^4 + x^3 + x + 1$, followed by an affine transformation over $GF(2)$.

$$\text{SubBytes}(a) = A \cdot a^{-1} + c \quad \text{in } GF(2^8)$$

where $a^{-1}$ is the multiplicative inverse (with $0 \mapsto 0$), $A$ is a fixed $8 \times 8$ binary matrix, and $c = \texttt{0x63}$.

Lookup Table

256-entry S-box ROM
Fast, constant area

Composite Field

$GF((2^4)^2)$ decomposition
Smaller area, more logic

Fermat's Theorem

$a^{-1} = a^{254}$
Exponentiation by squaring

Rijndael polynomial: 0x11B 128/192/256-bit keys NIST FIPS 197

Application: Reed-Solomon & ECC

Reed-Solomon Codes

Reed-Solomon codes are symbol-level error-correcting codes built on $GF(2^m)$ arithmetic. An RS$(n, k)$ code encodes $k$ data symbols into $n$ symbols, correcting up to $t = (n-k)/2$ symbol errors.

They are particularly effective against burst errors, since a burst corrupting one multi-bit symbol counts as a single error.

  • CD / DVD / Blu-ray disc error correction
  • QR codes
  • Deep-space communication (Voyager, Mars rovers)
  • Flash memory / SSD ECC
  • DVB / ATSC digital television

Elliptic Curve Cryptography

ECC can be defined over binary extension fields $GF(2^n)$, using curves of the form:

$y^2 + xy = x^3 + ax^2 + b$

where $a, b \in GF(2^n)$. Binary field ECC was historically favoured in hardware because:

  • Addition is carry-free (XOR)
  • Squaring is a linear operation
  • Simplified timing analysis
  • Resistance to certain side-channel attacks

NIST binary curves: B-233, B-283, B-409, B-571.

Error Correction Cryptography Symbol-level Operations GF(2m) Arithmetic

Summary & References

Key Takeaways

  • $GF(2)$ addition = XOR, multiplication = AND
  • $GF(2^n)$ elements are $n$-bit binary vectors
  • Addition in $GF(2^n)$ is bitwise XOR
  • Multiplication is polynomial product mod $p(x)$
  • Irreducible polynomials define the field structure
  • Every non-zero element has a multiplicative inverse
  • These properties enable CRC, LFSR, AES, Reed-Solomon, and ECC

References

  • Lidl, R. and Niederreiter, H. Finite Fields. Cambridge University Press, 1997.
  • McEliece, R.J. Finite Fields for Computer Scientists and Engineers. Kluwer, 1987.
  • Lin, S. and Costello, D.J. Error Control Coding. Pearson, 2nd ed., 2004.
  • Menezes, A.J. et al. Handbook of Applied Cryptography. CRC Press, 1996.
  • NIST FIPS 197: Advanced Encryption Standard (AES), 2001.
  • IEEE 802.3: Ethernet Standard — CRC-32 specification.
  • Finite Field Arithmetic — Wikipedia
  • Christof Paar's Cryptography Lectures

Brendan Lynskey 2025