Some finite field calculations
Math 202 Cryptography
September 17, 2018

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.

Let’s verify the results from 2(a) from Monday.

p=x^3+x+1

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

And we can check the results from 2(b) on Friday. 
Note we do not have to define the polynomials if we don’t want to.

PolynomialRemainder[(x+1)*(x^2+x+1), p, x, Modulus->2]