1

I'm trying to calculate the inverse of $x^{7}+x^{5}+x^{4}+x^{2}+x+1$ over $\mathbb{Z}_{2}[x]/(x^{8}+1)$. I suspect there is something fundemental I'm misunderstanding about this process. I'm doing this using code I'm writing, verified by manual calculation, but it seems the problem is not with my code, but with my understanding of what needs to be done.

First of all, I tried applying the extended Euclidean algorithm, but I get that the GCD is $x+1$ (i.e. - that they are not coprime).

Also, as far as I can tell, $(x^{7}+x^{5}+x^{4}+x^{2}+x+1)*(x^{7}+x^{6}+x^{5}+x^{4}+x^{3}+x^{2}+x^{1}+1)=0$, suggesting it divides zero.

What am I misunderstanding?

Jyrki Lahtonen
  • 133,153
  • Extended Euclidean algorithm gives the answer. – Wuestenfux Dec 16 '18 at 12:50
  • 1
    To really get into Galois field inverses you would need to replace $x^8+1$ with an irreducible degree eight polynomial. See for example this thread for a well worked out example about finding the inverse of an element in a degree eight extension field. – Jyrki Lahtonen Dec 16 '18 at 13:46
  • +1 for having a correct example. Your other degree seven polynomial is $$x^7+x^6+x^5+x^4+x^3+x^2+x+1=(x+1)^7.$$ Basically because all the binomial coefficients $\binom 7k, k=0,1,\ldots,7$ are odd. The six term polynomial is divisible by $x+1$, so the product of those two degree seven polynomials is divisible by $(x+1)^8=x^8+1$, and hence equal to zero in the quotient ring. – Jyrki Lahtonen Dec 16 '18 at 13:54

1 Answers1

2

I'm afraid the element you described has no inverse in the quotient ring $\Bbb{Z}_2[x]/\langle x^8+1\rangle$.

This is because your degree seven polynomial $f(x)=x^7+x^5+x^4+x^2+x+1$ shares a factor $x+1$ with $g(x)=x^8+1$. The easiest way of seeing this is to observe that $f(1)=0=g(1)$ so they are both divisible by $x-1=x+1$.

You can tell it at a glance because both polynomials have an even number of terms.


The quotient ring $\Bbb{Z}_2[x]/\langle g(x)\rangle$ is a field if and only if $g(x)$ is irreducible. When $g(x)$ is irreducible it obviously cannot have common factors with lower degree polynomials, and extended Euclid works like charm and finds the inverse.

A popular choice for a degree $8$ irreducible polynomial is $g(x)=x^8+x^4+x^3+x+1$ specified in Rijndael/AES crypto standard<.

Jyrki Lahtonen
  • 133,153