Skip to main content

Finite Fields

Goal

By the end of this chapter, you should understand prime fields, basic arithmetic in Fp\mathbb{F}_p, why every nonzero element has an inverse, and how larger finite fields can be built from irreducible polynomials.

You should also have a first intuition for extension fields, field towers, the Frobenius map, and why finite fields are essential for elliptic curves and pairings.

Prerequisites

You should be comfortable with modular arithmetic, groups, rings, and fields. In particular, you should know:

  • addition and multiplication modulo nn
  • modular inverses
  • why Z/pZ\mathbb{Z}/p\mathbb{Z} is a field when pp is prime
  • polynomial rings at a basic level
  • quotient rings as "reduce by a rule" arithmetic

Motivation

Cryptography often needs arithmetic that is exact, finite, and efficient. Finite fields provide that environment.

In a finite field:

  • there are only finitely many values
  • addition, subtraction, multiplication, and division by nonzero values work
  • arithmetic is exact, not floating point
  • the rules are structured enough for algebra and cryptography

Elliptic curves, pairings, and BLS signatures all use finite fields. Without finite fields, later chapters would not have a clean arithmetic setting for curve coordinates and pairing computations.

Prime Fields Fp\mathbb{F}_p

The simplest finite fields are prime fields. If pp is prime, then:

Fp=Z/pZ\mathbb{F}_p = \mathbb{Z}/p\mathbb{Z}

This is the set:

{0,1,2,,p1}\{0, 1, 2, \ldots, p - 1\}

with addition and multiplication performed modulo pp.

Example:

F5={0,1,2,3,4}\mathbb{F}_5 = \{0, 1, 2, 3, 4\}

The word "field" means every nonzero element has a multiplicative inverse. That works because pp is prime.

Addition Modulo pp

Addition in Fp\mathbb{F}_p means ordinary addition followed by reduction modulo pp.

Example in F5\mathbb{F}_5:

3+4=72(mod5)3 + 4 = 7 \equiv 2 \pmod 5

So in F5\mathbb{F}_5:

3+4=23 + 4 = 2

The equality is happening inside the field. If we want to emphasize the ordinary integer computation, we write the congruence.

Multiplication Modulo pp

Multiplication in Fp\mathbb{F}_p also means ordinary multiplication followed by reduction modulo pp.

Example in F7\mathbb{F}_7:

56=302(mod7)5 \cdot 6 = 30 \equiv 2 \pmod 7

So in F7\mathbb{F}_7:

56=25 \cdot 6 = 2

All results remain in:

{0,1,,p1}\{0, 1, \ldots, p - 1\}

Inverses in Fp\mathbb{F}_p

Every nonzero element of Fp\mathbb{F}_p has a multiplicative inverse.

Example: find the inverse of 33 in F7\mathbb{F}_7.

We need xx such that:

3x1(mod7)3x \equiv 1 \pmod 7

Try small values:

35=151(mod7)3 \cdot 5 = 15 \equiv 1 \pmod 7

So:

31=53^{-1} = 5

The extended Euclidean algorithm can find inverses efficiently. Since pp is prime, every nonzero aa is coprime to pp, so the inverse exists.

Fermat's Little Theorem

Fermat's little theorem says that if pp is prime and aa is not divisible by pp, then:

ap11(modp)a^{p - 1} \equiv 1 \pmod p

Example with p=7p = 7 and a=3a = 3:

36=7293^6 = 729

and:

7291(mod7)729 \equiv 1 \pmod 7

This theorem gives another way to find inverses. Since:

ap11(modp)a^{p - 1} \equiv 1 \pmod p

we can multiply both sides by a1a^{-1} conceptually and get:

ap2a1(modp)a^{p - 2} \equiv a^{-1} \pmod p

Example in F7\mathbb{F}_7:

3135(mod7)3^{-1} \equiv 3^{5} \pmod 7

Compute:

322(mod7)3^2 \equiv 2 \pmod 7 344(mod7)3^4 \equiv 4 \pmod 7 3543=125(mod7)3^5 \equiv 4 \cdot 3 = 12 \equiv 5 \pmod 7

So again:

31=53^{-1} = 5

Extension Fields Fpn\mathbb{F}_{p^n}

Not every finite field has a prime number of elements. There are also fields with:

pnp^n

elements, where pp is prime and n1n \ge 1.

These are called extension fields. They extend the prime field Fp\mathbb{F}_p by adding a new element that satisfies a polynomial relation.

The notation:

Fpn\mathbb{F}_{p^n}

means a finite field with pnp^n elements.

For example:

F23\mathbb{F}_{2^3}

has 88 elements.

Constructing Extension Fields with Irreducible Polynomials

To construct an extension field, start with polynomials over Fp\mathbb{F}_p and reduce by an irreducible polynomial.

An irreducible polynomial is like a prime number for polynomials. It cannot be factored into lower-degree nonconstant polynomials over the same field.

Example over F2\mathbb{F}_2:

f(x)=x2+x+1f(x) = x^2 + x + 1

This polynomial is irreducible over F2\mathbb{F}_2. To check, test 00 and 11:

f(0)=1f(0) = 1 f(1)=1+1+1=1(mod2)f(1) = 1 + 1 + 1 = 1 \pmod 2

It has no root in F2\mathbb{F}_2, so this degree-22 polynomial is irreducible.

Now build:

F2[x]/(x2+x+1)\mathbb{F}_2[x] / (x^2 + x + 1)

This means polynomial arithmetic over F2\mathbb{F}_2, with the rule:

x2+x+1=0x^2 + x + 1 = 0

Equivalently:

x2=x+1x^2 = x + 1

because in characteristic 22, subtraction and addition are the same.

Every element can be represented as:

a+bxa + bx

where a,bF2a, b \in \mathbb{F}_2.

So the field has four elements:

0,1,x,1+x0, 1, x, 1 + x

A Small Extension-Field Multiplication Example

Work in:

F2[x]/(x2+x+1)\mathbb{F}_2[x] / (x^2 + x + 1)

Compute:

x(1+x)x(1 + x)

First multiply as polynomials:

x(1+x)=x+x2x(1 + x) = x + x^2

Use the reduction rule x2=x+1x^2 = x + 1:

x+x2=x+(x+1)x + x^2 = x + (x + 1)

In characteristic 22, x+x=0x + x = 0, so:

x+(x+1)=1x + (x + 1) = 1

Thus:

x(1+x)=1x(1 + x) = 1

So xx and 1+x1 + x are multiplicative inverses in this field.

Field Towers

A field tower builds fields in stages.

For example, instead of jumping directly from Fp\mathbb{F}_p to a large extension, we can build:

FpFp2Fp6Fp12\mathbb{F}_p \subset \mathbb{F}_{p^2} \subset \mathbb{F}_{p^6} \subset \mathbb{F}_{p^{12}}

The symbol \subset here means each field is contained inside the next one.

Field towers are useful in pairing-friendly curves because computations in large extension fields can be organized using smaller extension layers. This is an implementation and efficiency concern as well as an algebraic construction.

We will not build a full tower here. The important idea is that extension fields can be layered.

Frobenius Map, Lightly

In a field of characteristic pp, the Frobenius map sends:

aapa \mapsto a^p

In finite fields, this map has special structure and is often efficient to compute.

In the prime field Fp\mathbb{F}_p, Fermat's little theorem implies:

ap=aa^p = a

for every aFpa \in \mathbb{F}_p.

In extension fields, the Frobenius map is not always the identity, but it still preserves addition and multiplication:

(a+b)p=ap+bp(a + b)^p = a^p + b^p

and:

(ab)p=apbp(ab)^p = a^p b^p

This becomes useful in pairing computations and field arithmetic. For now, it is enough to recognize the name and the operation.

Why Finite Fields Are Essential for Elliptic Curves and Pairings

Elliptic curve cryptography needs a finite arithmetic environment where equations can be evaluated exactly and where division by nonzero values is available. Finite fields provide that environment.

An elliptic curve over a finite field might be written:

E:y2=x3+ax+bE : y^2 = x^3 + ax + b

where xx, yy, aa, and bb are elements of a finite field.

Pairings need even more field structure. The output of a pairing lives in a target group related to an extension field. In pairing-friendly curves, field extensions are part of the construction that makes pairings computable and useful.

Chia Connection

BLS12-381 uses finite fields. At a high level, it has a base field used for curve coordinates and a scalar field used for scalar multiplication. Pairing computations also use extension fields.

This chapter does not give the BLS12-381 parameters. Later chapters will separate the curve family from the specific BLS12-381 parameter set and cite standard sources for factual details.

For now, the important point is that BLS signatures in Chia rest on arithmetic in finite fields, not on floating-point numbers or informal real-number geometry.

Source starting points: BLS12-381 construction notes, IETF pairing-friendly curves draft, and Chia Keys and Signatures.

Common Pitfalls

Assuming every modulus gives a field. Z/nZ\mathbb{Z}/n\mathbb{Z} is a field only when nn is prime.

Confusing Fpn\mathbb{F}_{p^n} with integers modulo pnp^n. The field Fpn\mathbb{F}_{p^n} is not usually the same thing as Z/pnZ\mathbb{Z}/p^n\mathbb{Z}. For n>1n > 1, the latter has zero divisors and is not a field.

Forgetting to reduce polynomials. In extension fields, polynomial products must be reduced by the chosen irreducible polynomial.

Treating the symbol xx as an ordinary unknown. In a quotient construction, xx represents a field element satisfying a fixed polynomial relation.

Assuming Frobenius is always the identity. It is the identity on Fp\mathbb{F}_p, but in extension fields it can move elements nontrivially.

Thinking field towers are only theory. Field towers often matter for efficient implementation of pairing arithmetic.

Exercises

  1. Compute 4+64 + 6 and 464 \cdot 6 in F7\mathbb{F}_7.
  2. Find the inverse of 55 in F11\mathbb{F}_{11}.
  3. Use Fermat's little theorem to compute 313^{-1} in F13\mathbb{F}_{13}.
  4. Explain why Z/9Z\mathbb{Z}/9\mathbb{Z} is not the field F9\mathbb{F}_9.
  5. In F2[x]/(x2+x+1)\mathbb{F}_2[x]/(x^2 + x + 1), compute (1+x)2(1 + x)^2.
  6. List the four elements of F2[x]/(x2+x+1)\mathbb{F}_2[x]/(x^2 + x + 1).
  7. In your own words, explain what it means to reduce a polynomial by x2+x+1x^2 + x + 1.
  8. What does the Frobenius map do to elements of Fp\mathbb{F}_p?
  9. Why do elliptic curve equations need field arithmetic instead of ordinary floating-point arithmetic?

Further Reading

  • Later chapter: Elliptic Curve Group Law
  • Later chapter: Curves Over Finite Fields
  • Later chapter: Pairings
  • Later chapter: BLS12-381
  • Any introductory abstract algebra text covering finite fields and polynomial quotient rings