A cryptographic calculation must give the same answer on every machine. Finite fields let us add, multiply and divide exactly while keeping every result inside a fixed set.

A finite field, also called a Galois field, is a finite set with addition and multiplication satisfying the field axioms. Subtraction and division by nonzero elements stay within the same set. A prime field with pp elements is written Fp\mathbb F_p or GF(p)GF(p).

Keep the remainder

For a prime pp, the field Fp\mathbb{F}_p contains the integers 00 through p−1p-1. Arithmetic wraps around modulo pp. Two integers are congruent when they have the same remainder:

5+4≡2(mod7),2−5≡4(mod7).5+4 \equiv 2 \pmod 7, \qquad 2-5 \equiv 4 \pmod 7.

The answer stays in the set. A negative intermediate value is reduced too: −3-3 and 44 differ by a multiple of 77.

Read the operation tables

Switch between addition and multiplication, then change the prime. Every result stays within the field: this is closure. Symmetry across the diagonal shows commutativity. Rows and columns are numbered from zero; an entry gives the result of combining its row and column.

Fp\mathbb F_p

00000000000000000
012345678910111213141516
024681012141613579111315
036912151471013162581114
048121637111526101415913
051015381316111649142712
061217132814391541016511
071441118155122916613310
081671561451341231121019
091102113124135146157168
010313616921251581114147
011516104159314821371126
012721494161161138315105
013951141062151173161284
014118521613107411512963
015131197531161412108642
016151413121110987654321

Undo multiplication

Division means multiplying by an inverse. The inverse of a nonzero element aa is the element a−1a^{-1} satisfying a a−1≡1(modp)a\,a^{-1}\equiv1\pmod p.

Select a row in the multiplication table. Its entry equal to 11 identifies the inverse; row zero has none.

3−1 = 5
×0123456
0000000
0123456
0246135
0362514
0415263
0531642
0654321

Modulo 77, 3×5=15≡13\times5=15\equiv1, so 3−1=53^{-1}=5. Dividing 44 by 33 gives:

4÷3≡4×5≡6(mod7).4\div3 \equiv 4\times5 \equiv 6 \pmod7.

Check by multiplying back: 3×6≡43\times6\equiv4. This is exact division in the field, not a rounded version of 4/34/3 over the real numbers.

Why prime matters

Change the table's modulus to 66 and select row 22. No entry equals 11: multiplying by 22 only reaches 00, 22 and 44. In particular,

2×3≡0(mod6).2\times3\equiv0\pmod6.

Two nonzero elements have multiplied to zero. Such elements are called zero divisors. Integer arithmetic modulo a composite number is not a field. Modulo a prime, every nonzero element has an inverse; division by zero remains undefined.

Finite fields can also contain pmp^m elements for prime pp and integer m>1m>1. Those extension fields use a different construction, not ordinary integer arithmetic modulo pmp^m.

Multiplication forms a group

The p−1p-1 nonzero elements form a cyclic group under multiplication. A generator reaches all of them through repeated multiplication. Modulo 77, the powers of 33 visit

3, 2, 6, 4, 5, 1.3,\ 2,\ 6,\ 4,\ 5,\ 1.

Not every element is a generator: powers of 22 only visit 2,4,12,4,1. The full multiplicative group has order p−1p-1; an individual element can have a smaller order.

From numbers to points

A coordinate pair (x,y)(x,y) takes two elements of the field. The grid below contains all p2p^2 possible pairs. An elliptic curve ⁠ keeps only the pairs satisfying its equation, then adds a point at infinity.

(x,y)∈Fp×Fp(x,y)\in\mathbb{F}_p\times\mathbb{F}_p

Field size and security

secp256k1 uses the prime

p=2256−232−977.p=2^{256}-2^{32}-977.

The prime’s form makes modular reduction efficient: 2256≡232+977(modp)2^{256}\equiv2^{32}+977\pmod p, so high bits can be folded back into smaller terms. This field underpins the curve arithmetic used for Bitcoin’s public keys and signatures.

Its coordinates fit in 256 bits. That does not mean 256-bit security: the curve targets roughly 128-bit classical security. Field size, curve choice and subgroup order all matter; a larger coordinate representation is not itself a security proof. See SEC 2, §2.4.1 for the parameters and NIST SP 800-57, Table 2 for the security-strength comparison.

Other applications

AES uses F28\mathbb F_{2^8} for byte arithmetic, while Curve25519 uses the prime field F2255−19\mathbb F_{2^{255}-19}. The AES field is an extension field: its multiplication is not integer multiplication modulo 256256. See FIPS 197, §4 and RFC 7748, §4.1.

Finite fields also support error-correcting codes. Reed–Solomon codes evaluate polynomials over a finite field, allowing missing symbols to be recovered from enough remaining evaluations. Here the same exact arithmetic serves reliable transmission and storage.

This is 0xa.eth, building at OKX and exploring the mathematics behind cryptography, the mechanics of Ethereum, and the tools that shape how we think. I bring old computers back to life and experiment with AI, turning what I learn into visual notes and interactive experiments.