8.2 OPERATIONS IN GF(p)

If p is a prime number, then Zp is the Galois field GF(p), and every nonzero element y of Zp has an inverse y−1. Unless p is small—in which case all inverses could have been previously computed and stored in a table—the computation of z = x−1 mod p is based on the extended Euclidean algorithm (Chapter 2, Section 2.1.2), which allows the expression of the greatest common divider of two natural numbers x and y in the form

image

where b and c are integers. Given x and p, the computation of z = x−1 mod p is made up of a sequence of integer divisions:

image

It has been demonstrated (Chapter 2, Section 2.1.2) that r(i) = b(i).p + c(i).x, so that

image

Taking into account that

image

and

image

after some finite number of steps, a remainder r(i + 2) is obtained such that

image

so

image

and

The corresponding algorithm ...

Get Synthesis of Arithmetic Circuits: FPGA, ASIC and Embedded Systems now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.