Qraft

Galois Field

A Galois field (finite field) is an algebraic structure where addition, subtraction, multiplication, and division are all well-defined over a finite set of elements. Named after 19th-century French mathematician Evariste Galois, a finite field exists when the element count is a prime power p^n, denoted GF(p^n).

QR code Reed-Solomon error correction operates over GF(2^8) = GF(256), which contains exactly 256 elements (0 through 255) - precisely the range of a single byte. Since QR code data is processed byte by byte, GF(256) is a natural fit.

In GF(256), addition is defined as XOR, so results always stay within 0-255. Multiplication uses polynomial arithmetic modulo a primitive polynomial, preventing overflow. This "closed arithmetic" property mathematically guarantees error correction over fixed-length data blocks.

In practice, GF(256) multiplication uses precomputed log and antilog tables (256 entries each), converting multiplication to log addition plus antilog lookup. Every QR code encoder and decoder contains these 256-byte tables internally.