Finite Fields
Finite Fields
Introduction to Cryptography
Finite Fields
In abstract algebra, a finite field or Galois
field (so named in honor of É variste Galois
[1811 – 1832] ) is a field that contains only
finitely many elements
Finite fields are important in number theory,
algebraic geometry, Galois theory,
cryptography, and coding theory
The finite fields are completely known
2
Finite Fields
1. Polynomial Ring GFp[x]
2. Galois Field GF4
3. Galois Fields GF8 and GF16
4. Galois Field GFpn
5. Multiplicative Group of GFpn
3
Galois Field GFp
0 1 0 1
Example 0 0 1 0 0 0
Cayley tables of GF2 1 1 0 1 0 1
Example Solve 3 x + y + 4 z + 1 = 0
6x+5y+3z+6 = 0
x + 4 y + 2 z + 5 = 0 over GF7
Solution
x+5y+6z+5=0 x +5=0 x = 2
y+3z+6=0 y +3=0 y = 4
z+1=0 z+1=0 z = 6
4
Polynomial Ring GFp[x]
Polynomial ring F [x]
The set of all polynomials whose coefficients are in
the field F with usual additions and multiplications
Example (2x3 + 3x2 + 5x + 1)(5x2 + 3x + 2) =
3x5 + 3x3 + 5x2 + 6x + 2 in GF7[x]
Definition The degree, denoted as deg(p(x)), of
p(x) = anx n + an -1x n -1 + … + a1x + a0 0 is the largest
m such that am 0
Definition deg(0) =
5
Polynomial Ring GFp[x]
Definition The leading term of p(x), denoted as
LT(p(x)), is the monomial am x m with the highest
degree in p(x)
Proposition For any nonzero p(x), q(x) F [x],
1) p(x)q(x) 0
2) deg(p(x)q(x)) = deg(p(x)) + deg(q(x))
Proof LT(p(x)q(x)) = LT(p(x))LT(q(x)) 0 since F is a field
10
Galois Field GF4
We will construct GF4 in 3 ways
1) Set of Linear Polynomials
2) Set of Congruence Classes
3) Linear Combinations of a Fixed Root
They look different, but essentially the same
Note Z4 is not a field, since 2 does not have a
multiplicative inverse
11
Galois Field GF4
Definition A non-constant polynomial p(x) F [x] is
irreducible if its only divisors are its associates [ c p(x) ]
and the nonzero constant polynomials
f (x) = x2+x+1 is irreducible over GF2
It is confirmed by f (0) = f (1) = 1 0
Note that f(x) = (x+2)2 over GF3
15
Finite Fields
1. Polynomial Ring GFp[x]
2. Galois Field GF4
3. Galois Fields GF8 and GF16
4. Galois Field GFpn
5. Multiplicative Group of GFpn
16
Galois Fields GF8 and GF16
The elements of GF2n can be represented in a natural
way as binary numbers easily understood by hardware
AES:GF28
ECC:Elliptic Curves over GF2n or GFp where p is a prime,
not over GFpn where p > 2 and n > 1
We look at GF2n for n = 3 and 4 now, then GFpn later
GF8 can be represented as a2x2+a1x+a0 , ai GF2
GF16 can be represented as a3x3+a2x2+a1x+a0 , ai GF2
Additions are performed modulo 2
Multiplications are defined below
17
Galois Fields GF8 and GF16
1) GF8 = GF23
x3+x2+1 and x3+x+1 are the only irreducible
polynomials over GF2 of degree 3
neither 0 nor 1 is is a root of either polynomial
x8 x x(x+1)(x3+x+1)(x3+x2+1) (mod 2) gives a
complete list of all the irreducible polynomials of
degree 1 and 3 over GF2
GF8 GF2[x] / <x3+x2+1> GF2[x] / <x3+x+1>
e.g. in GF2[x] / <x3+x+1>
[x2+1] [x2+x] = [(x2+1) + (x2+x)] = [x+1]
[x2+1] [x2+x] = [(x2+1)(x2+x)] = [x4+x3+x2+x]
= [(x+1)(x3+x+1) + (x+1)] = [x+1]
18
Galois Fields GF8 and GF16
Assume is a root of x3+x+1 over GF2
3 + +1 = 0, hence 3 = 1 = +1 (mod 2)
4 = ( +1) = 2 +
5, 6, and 7 = 1 are reduced similarly
GF8* = < >
Each field element is a root of x8 x since
1) 08 – 0 = 0
2) ( i )8 – ( i ) = ( 7)i i i = i i = 0
, 2, and 2 + are roots of x3+x+1
+1, 2 +1, and 2 + +1 are roots of x3+x2+1
19
Galois Fields GF8 and GF16
Definition F is a subfield of K and u K, then
the uniquely determined monic polynomial g F [x]
generating the ideal J = { f F [x] | f (u) = 0 } of F [x]
is the minimal polynomial of u over F
Example x3 +x2 +1 is the minimal polynomial of
2 +1 over GF2 where 3 + +1 = 0, since
x3 +x2 +1 is irreducible over GF2
( 2 +1)3 + ( 2 +1)2 + 1 = 6 +4 4 +5 2 +3
( +1)2 + 2 + 1 0 (mod 2)
20
Galois Fields GF8 and GF16
Elements of GF8
Power Polynomial Binary Decimal / Hex Minimal
Notation Notation Notation Notation Polynomial
0 0 000 0 x
0 1 001 1 x+1
1 010 2 x3 + x + 1
2 2 100 4 x3 + x + 1
3 +1 011 3 x3 + x2+ 1
4 2 + 110 6 x3 + x + 1
5 2 + + 1 111 7 x3 + x2+ 1
6 2 + 1 101 5 x3 + x2+ 1
21
Galois Fields GF8 and GF16
2) GF16 = GF24
x4+x+1, x4+x3+1, and x4+x3+x2+x+1 are the only
irreducible polynomials over GF2 of degree 4
x16 – x x(x+1)(x2+x+1)(x4+x+1)(x4+x3+1)(x4+x3+x2+x+1)
(mod 2) gives a complete list of all the irreducible
polynomials of degree dividing 4, i.e., 1, 2, or 4
GF16 GF2[x] / <x4+x+1> GF2[x] / <x4+x3+1>
GF2[x] / <x4+x3+x2+x+1>
22
Galois Fields GF8 and GF16
Assume is a root of x4+x+1 over GF2
4 + +1 = 0, hence 4 = 1 = +1 (mod 2)
25
Finite Fields
1. Polynomial Ring GFp[x]
2. Galois Field GF4
3. Galois Fields GF8 and GF16
4. Galois Field GFpn
5. Multiplicative Group of GFpn
26
Galois Field GFpn
Definition F is a subfield of K, f(x) F [x] is of
degree n, then K is the splitting field of f(x) if K is
the smallest field containing all roots of f(x), i.e., f(x)
= a(x 1)(x 2) … (x n) where i K for all i
We will show that GFpn is the splitting field of
n
x – x, which contains exactly pn elements
p
27
Galois Field GFpn
Theorem
Assumptions:
p is a prime
q(x) GFp[x] is irreducible with deg(q(x)) = n > 1
S is a set of all polynomials of the form
an 1xn 1 + …+ a1x + a0 where ai GFp
f(x) g(x) = f(x) + g(x) mod p
f(x) g(x) = (f(x)g(x) mod q(x)) mod p
Conclusion:S with and is a field of pn
elements, which is GFpn
28
Galois Field GFpn
Proof (Sketch)
There are exactly pn polynomials
r(x) = an 1xn 1 + …+ a1x + a0 where ai GFp
These are the elements of GFpn
For each nonzero r(x) GFp[x], there exists
s(x) GFp[x] such that
(r(x)s(x) mod q(x)) mod p = 1
since q(x) is irreducible
s(x) is the multiplicative inverse of r(x) in GFpn
29
Galois Field GFpn
Example Which quotient is isomorphic to GF64 ?
GF2 [ x] GF2 [ x]
A: B:
x x 1
6 2
x6 x5 x 4 x3 x2 x 1
GF2 [x] GF2 [ x]
C: D:
x6 x3 1 x6 x 4 x3 x2 1
Solution In GF2[x]:
x6 + x2 +1 = (x3 + x + 1)2
x6 + x5 + x4 + x3 + x2 + x +1 = (x3 + x2 + 1)(x3 + x + 1)
x6 + x3 +1 is irreducible
x6 + x4 + x3 + x2 +1 = (x2 + x + 1)(x4 + x3 + x2 + x +1 )
Hence GF2 [ x] 6 is a field of order 26 = 64
x x 1
3
30
Galois Field GFpn
Corollary If f(x) GFp[x], then GFpn contains
a root of f(x) for some n
Proof (Sketch)
There exists an irreducible q(x) | f(x)
Use q(x) to construct GFpn where n = deg(q(x))
For x GFpn , (f(x) mod q(x)) mod p = 0
since q(x) | f(x), hence x is a root of f(x)
31
Galois Field GFpn
Proposition The set K consisting of the roots of
xpn x with and over GFp is a field
Proof
0, 1 K
n pn= pn=
Suppose 1, 2 are roots of x –
p x, then 1 1 , 2 2
n n n
1 +2 K since (1 +2 )p = 1p +2p = 1 +2
n n n
1 2 K since (1 2 )p = 1 p 2 p = 1 2
n
Suppose 0 with p – = 0
n n
– K since (– )p = p = = – for p = 2, or
n n
(– )p = – p = – for odd prime p
n n
–1 K since ( –1)p = ( p )–1 = –1
32
Galois Field GFpn
Lemma f(x) of degree n splitting completely has
n distinct roots iff f(x) and its (formal) derivative f (x)
are relatively prime
Proof Write f(x) = (x i )ki where i are distinct,
then f (x) = ( ki (x i )ki 1 j i (x j )kj )
() ki = 1 for all i, then f (i ) 0 for all i, so f(x)
and f (x) have no common factor
() ki 1 for some i, then x i is a common factor
33
Galois Field GFpn
Remark f (x) = xpn– x has no multiple roots over
GFp since f (x) = pnxpn1–1 –1 (mod p) relatively
prime to f(x)
Remark The splitting field of xpn– x over GFp
consists precisely of its pn distinct roots
This is another representation of GFpn
Proposition f(x) GFp[x] of degree n has at
most n distinct roots in GFpn
Proof Use the Division Algorithm
34
Galois Field GFpn
Remark Let F be a field. Then any polynomial f(x)
F[x] has at most n roots
Proof Use the Division Algorithm
Example
In Z8, 1, 3, 5, 7 are roots of x2 1 = 0
Note that Z8 is not a field
35
Galois Field GFpn
Theorem For each prime p and positive integer
n, there is exactly one field GFpn with pn elements
up to isomorphism, which is the splitting field of
n
xp – x over GFp
up to isomorphism:any two fields with pn elements are
isomorphic
36
Galois Field GFpn
Proposition Any subfield of GFpn is of the form
GFpd, d |n
Example GF224
GF212 GF28
GF26 GF24
GF23 GF22
GF2
37
Finite Fields
1. Polynomial Ring GFp[x]
2. Galois Field GF4
3. Galois Fields GF8 and GF16
4. Galois Field GFpn
5. Multiplicative Group of GFpn
38
Multiplicative Group of GFpn
Definition G is a group, a G, the order of a [denoted
as o(a)] is the smallest positive integer t such that at = 1
Note If G is finite, then o(a) = o(<a>) | o(G) by
Lagrange’s Theorem
Theorem GFpn* = <g > for some g GFpn
We will prove the theorem in the following way:
For each d | (pn – 1), there are exactly (d) elements of order
d in GFpn*
In particular, there are (pn – 1) generators
39
Multiplicative Group of GFpn
Proof of Theorem (Sketch)
Denote n(d) the number of elements in GFpn* of
order d
For d | (pn 1), we have (xd 1) | (xpn1 – 1)
n(q) = q 1 for prime q
n(qm) = qm1 (q 1)
n(ab) = n(a) n(b) for relatively prime a, b
n(d) = (d)
40
Multiplicative Group of GFpn
Example Since P(x) = x5 + 2x + 1 is irreducible over
GF3, the quotient ring K = GF3[x] / (P(x)) is a finite field
Let Q(x) = x2 + 2x + 1
The number of elements in K is |K| = 35 = 243
(K {0}, ) is a cyclic group of order 242
Q(x)1213 = Q(x)242.5 + 3 = Q(x)3 = 2x3 + x2 + 2x + 1 in K
Since Q(x)(x4 + x3 + 2x + 1) (x5 + 2x + 1).x = 1, we have
Q(x)1 = x4 + x3 + 2x + 1 in K
41
Multiplicative Group of GFpn
Definition f (x) GFp[x] with deg(f (x)) = n is a
primitive polynomial if it is the minimal polynomial of
a primitive element [a generator of GFp ] in GFpn n
then f is irreducible
Proof
Suppose f(x) = a(x) b(x) for some a(x), b(x) GFp[x]
f ( ) = 0 = a( ) b( ) implies a( ) = 0 or b( ) = 0
If a( ) = 0, then deg(a(x)) = deg(f (x)) since f (x) is the minimal
polynomial of , thus b(x) is a constant
Similarly, if b( ) = 0, then a(x) is a constant
Thus f(x) is irreducible 42
Multiplicative Group of GFpn
Proposition The polynomial x x is precisely
pn
44
Multiplicative Group of GFpn
Example
To construct GF25 , we can use g(x) = x2 +3 GF5[x]
g(0), g(1), g(2), g(3), g(4) mod 5 = 3, 4, 2, 2, 4 respectively
None of these are zero, hence x2 +3 is irreducible over GF5
To get a primitive element, we should find q(x) such that
(q(x)24 mod x2 +3) mod 5 = 1 and 1 with less power
Take q(x) = x+3
((x+3)8 mod x2+3) mod 5 = 2x+2
((x+3)12 mod x2+3) mod 5 = 4
((x+3)24 mod x2+3) mod 5 = 1
Q: Is g(x) a primitive polynomial? If not, how to get one?
45