1

I am learning how to do arithmetic with Galois Fields (GF(2^4)). In particular, I am focusing on addition and multiplication.

The addition problem we are looking at is:

Compute A(x) + B(x) mod P(x) in GF(2^4).
   Let A(x) = x^2 + 1, B(x) X^3 + x^2 + 1, P(x) = x^4 + x + 1. 

So we begin by adding A and B:

           x^2 + 1 
      x^3 + x^2 + 1
      = x^3

Now here is where I'm confused, the mod P(x). What's throwing me off is that the degree of P(x) is greater than the degree of (A+B). My understanding (please correct me if I'm wrong) of the purpose of the mod P(x) is to reduce the polynomial so that it "fits" into the field GF(2^4). But if the degree of P(x) is larger than the highest degree in (A+B), how do we go about doing this?

The multiplication problem we are looking at is:

Compute A(x) * B(x) mod P(x).
Let A(x) = x^2 + 1, B(x) = x^3 + x^2 + 1, P(x) = x^4 + x + 1

So we multiply the two polynomials just like we were taught back in highschool:

(x^2 + 1) (x^3 + x^2 + 1) = x^5 + x^4 + x^2 + x^3 + x^2 + 1 
 *I'm unsure of what happens to the x^2 + x^2 here, because we are in GF(2), does this = 0?

Assuming that the two x^2's result in 0, the result is:

x^5 + x^4 + x^3 + 1 MOD x^4 + x + 1

If anyone could walk through the modular reduction of polynomials for me that would be much appreciated, I am not confident in my ability to do this just yet...

My attempt:

x^5 + x^4 + x^3 + 1 MOD x^4 + x + 1 = x^3 + x^2
  • 1
  • When adding, it is unnecessary to do a reduction modulo $P(x)$ because both addends have degree less than $\deg P(x)$. 2. There is an incredibly detailed answer about arithmetic in $\mathbb F_{2^4}$ by Moderator @JyrkiLahtonen, which I cannot find, and I am pinging Jyrki to add a link to that answer, and possibly close your question as a duplicate of that other one.
  • – Dilip Sarwate Oct 10 '15 at 03:10
  • 1
    To reduce modulo $P(x)=x^4+x+1$, you just (euclideanly) divide by $P$ and take the remainder. Nothing more nor less. – Lubin Oct 10 '15 at 03:35
  • @DilipSarwate I too tried to look for the answer you are talking about but I couldn't find it. – Talen Kylon Oct 10 '15 at 14:44
  • @Lubin Yes I'm aware that it's just dividing and taking the remainder, but I'm not confident that I executed that correctly. Also I'm unsure if my multiplication of the two polynomials is correct in terms of what happens with the x^2 + x^2. Because we are in base 2, I'm assuming these result in 0? – Talen Kylon Oct 10 '15 at 14:47
  • 2
    Yes, $x^2+x^2=(1+1)x^2=0x^2=0$. And you did the reduction of the multiplication correctly. – Lubin Oct 10 '15 at 15:07
  • 1
    Thanks for the heads up, guys. I guess you are referring to this Q&A. The ping doesn't work as I had not participated in this thread yet. But, effectively, the tag finite-fields pings me to the scene sooner rather than later :-). Talen, it gets tiresome to keep writing MOD x^4+x+1 many times. That's why algebraists give a name to the residues class of $x$. I call it $\gamma$ in my answer. – Jyrki Lahtonen Oct 10 '15 at 17:17
  • 1
    And I am not sure it is necessary to close this question as a duplicate of that one. I am involved, hence potentially biased, so at least I should not do the closing. – Jyrki Lahtonen Oct 10 '15 at 17:19