Maths and Computing:

menu
Home
Books
Coding
Computing
Data
Encoding
Mathematics

Galois Field Arithmetic

Galois Field Arithmetic: Entry

Galois Field of 2n elements.


  • GF(2n) contains 2n elements
  • Elements can be represented as n bit binary numbers or as polynomials of degree (n - 1)
  • The addition, subtraction, multiplication and division operations can be performed between two elements
  • The set of elements forms a group under addition and multiplication
  • The result of any operation is an elements that is a member of GF(2n)
  • The multiplication operaiton requires the definition of an irreducible polynomial of order n.

n:


Calculation in GF(16)

x:

y:


Workings


Workings


Addition and subtraction use the binary XOR (Exclusive OR) operation

XOR Operation

0 + 0 = 0 XOR 0 = 0

0 + 1 = 0 XOR 1 = 1

1 + 0 = 1 XOR 0 = 1

1 + 1 = 1 XOR 1 = 0


Example for the elements 14 and 5 from GF(16)

111014
01015

XOR 101111
   x3 + x2 + x14
   x2 + 15

XOR    x3 + x + 111

Table of Values

Addition and Subtraction between elements in GF(16)

+ 0123456789101112131415
00123456789101112131415
11032547698111013121514
22301674510118914151213
33210765411109815141312
44567012312131415891011
55476103213121514981110
66745230114151213101189
77654321015141312111098
88910111213141501234567
99811101312151410325476
101011891415121323016745
111110981514131232107654
121213141589101145670123
131312151498111054761032
141415121310118967452301
151514131211109876543210


Multiplication use the binary AND and XOR operations

AND Operation

0 × 0 = 0 AND 0 = 0

0 × 1 = 0 AND 1 = 0

1 × 0 = 1 AND 0 = 0

1 × 1 = 1 AND 1 = 1


It does a long multiplication using the binary values or a polynomial using the equaivalent polynomials expressions

Any add operation uses the XOR operation

Finally the result of the multiplication is divided by the selected irreducible polynomial to give a remainder

The remainder is the final result of the multiplication


Alternatively the multiplication table below can be used


Example for the elements 14 and 5 from GF(16) using the irreducible polynomial 0 and the table below.


111014
01015

× 011054
   x3 + x2 + x14
   x2 + 15

×    x2 + x54

For full workings, perform the operation in the calculation tab


Tables of Values for Multiplication

Irrecucible Polynmial = 0

× 123456789101112131415
1123456789101112131415
224681012141618202224262830
336512151092427302920231817
44812162024283236404448525660
551015201730274045343960575451
661210243020184854605840463634
77149282718215663544936354245
881624324048566472808896104112120
9918273645546372659083108101126119
101020304034605480906878120114108102
11112229443958498883786911612798105
12122420486040369610812011680927268
131326235257463510410111412792817075
14142818565436421121261089872708490
151530176051344512011910210568759085

Division

Division is done by multiplying by the inverse of the divisor


Tables of Inverse Values

Irrecucible Polynmial = 0

0123456789101112131415
0000000000000000

Groups

A group consists of a non-empty set G and an operation *

Closure: If a ∈ G and b ∈ G then a * b ∈ G

Group Axioms

Associativity: For all a, b and c in G, (a * b) * c = a * (b * c)

Identity element: There exists e ∈ G such that for every a ∈ G, a * e = e

Inverse element: There exists b ∈ G such that for every a ∈ G, a * b = e


Group G: GF(16) under Addition

Let A, B and C be elements in the set G


Set

The set of 4-bit binary values

The polynomials of order 4 with coefficients of 0 or 1

Operation

XOR (Exclusive OR)

The application of a bitwise XOR between the corresponding bits of two elements expressed as a binary value

The application of the XOR operation to the corresponding coefficients of two elements expressed as polynomials

0 XOR 0 = 1, 0 XOR 1 = 1, 1 XOR 0 = 1, 1 XOR 1 = 0

Closure

A bitwise XOR between two 4-bit values results in an 4-bit value

A bitwise XOR between the coefficients of two polynomials of order 4 results in a polynomial of order 4

A XOR B a ∈ G

Associativity

The XOR operation is associative

(A XOR B) XOR C = A XOR (B XOR C)

Identity Element

A XOR 0 = A

The identity element is 0 for all elements in G

Inverse Element

A XOR A = 0 (The inverse element)

For each element in G, the inverse element is itself

Groups

A group consists of a non-empty set G and an operation ◦

Closure: If a ∈ G and b ∈ G then a ◦ b ∈ G

Group Axioms

Associativity: For all a, b and c in G, (a ◦ b) ◦ c = a ◦ (b ◦ c)

Identity element: There exists e ∈ G such that for every a ∈ G, a ◦ e = e

Inverse element: There exists b ∈ G such that for every a ∈ G, a ◦ b = e


Group G: GF(16) under Multiplication with the Primative Polynomial 0

Let A, B and C be elements in the set G


Set

The set of 4-bit binary values

The polynomials of order 4 with coefficients of 0 or 1

Operation

Polynomial multiplication performing addition with the XOR operation and then dividing by 0 using the XOR operaition for subtractions

Closure

Dividing any polynomial by a polynomial of order 4+1 results in a polynomial order 4 or less

Associativity

f(x)g(x) = q(x)p(x) + r(x)

f(x)g(x) = q(x)p(x) + r(x)

Identity Element

A ◦ 1 = A

The identity element is 1 for all elements in G

Inverse Element

A XOR A = 0 (The inverse element)

For each element in G, the inverse element is itself

Irrecucible Polynmial = 0

Inverse Values

0123456789101112131415
0000000000000000

Representing elements in GF(24)

Elements in GF(24) can be represented as a number, a 4-bit binary number or equivalent decimal value

Alternatively, elements can be represented by a polynomial or order 3

Example: The value 14 is represented as 1110 in binary or as the following polynomial or order 3

x3 + x2 + x

To perform a multiplication between two elements in GF(24), the polynomial result after multiplying the two polynomials values together must be divided by a primitive irreducible polynomial of order 4 to ensure that the resulting polynomial is of order 3 or less

Irreducible Polynomials

An irreducible polynomial is one that has no factors.

Primitive Polynomials

The requirement is that the results of dividing by the selected polynomial can produce 16 different results. To do this the polynomial must be primitive.

A primitive polynomial of order 4 is one where the smallest value of n for which 2n is a factor is 16


Irreducible Polynomials

Polynomial

Binary Value

Primitive

n

x4 + x + 1

10011

Yes

n = 15

x4 + x3 + 1

11001

Yes

n = 15

x4 + x3 + x2 + x + 1

11111

No

n = 5


Reducible Polynomials

Polynomial

Binary Value

Factors

x4 + 1

10001

(x + 1)(x3 + x2 + x + 1)
(x2 + 1)2

x4 + x

10010

(x)(x3 + 1)
(x + 1)(x3 + x2 + x)
(x2 + x)(x2 + x + 1)

x4 + x2

10100

(x)(x3 + x)
(x + 1)(x3 + x2)
(x2)(x2 + 1)
(x2 + x)2

x4 + x2 + 1

10101

(x2 + x + 1)2

x4 + x2 + x

10110

(x)(x3 + x + 1)

x4 + x2 + x + 1

10111

(x + 1)(x3 + x2 + 1)

x4 + x3

11000

(x)(x3 + x2)
(x2)(x2 + x)

x4 + x3 + x

11010

(x)(x3 + x2 + 1)

x4 + x3 + x + 1

11011

(x + 1)(x3 + 1)
(x2 + 1)(x2 + x + 1)

x4 + x3 + x2

11100

(x)(x3 + x2 + x)
(x2)(x2 + x + 1)

x4 + x3 + x2 + 1

11101

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

x4 + x3 + x2 + x

11110

(x)(x3 + x2 + x + 1)
(x + 1)(x3 + x)
(x2 + 1)(x2 + x)

Select a polynomial to see details relating to whether it is primitive

Contents Copyright 2026 Andy Abraham

Please email comments to info@mathsandcomputing.co.uk