Some finite field calculations

Math 202 Cryptography, September 19, 2016
T. Ratliff, Wheaton College
ratliff_thomas@wheatoncollege.edu

Working with (Subscript[ℤ, 2])[x]

Not surprisingly, Mathematica can handle the calculations we did in class on Friday. 
Let’s define our polynomials and reduce them modulo 2 using the Expand[ ] command.

f = x+1
g=x^2+x
Expand[f*g, Modulus-> 2]

Working in (Subscript[ℤ, 2])[x] / p(x) = GF(8)

We need to define p(x), and then we can use the PolynomialRemainder[ ] command. 
Notice that we don’t need to expand the product in this case.

p=x^3+x+1

PolynomialRemainder[f*g, p, x, Modulus->2]

Define all elements of GF(8)

f0 = 0
f1 = 1
f2 = x
f3 = x+1
f4 = x^2
f5 = x^2 +1
f6 = x^2 + x
f7 = x^2 + x + 1