I'm investigating an idea in cryptography that requires irreducible polynomials with coefficients of either 0 or 1 (e.g. over GF[2]). Essentially I am mapping bytes to polynomials. For this reason, the degree of the polynomial will always be an integer multiple of 8.
I would like to build a table of such irreducible polynomials for various degrees (e.g. degrees from 8, 16, 24, ..., 1024). Because there are multiple irreducible polynomials for a given degree, I'd like the one with the fewest number of terms since I will hard code the non-zero terms. For example, for degree 16, both of these polynomials are irreducible:
$x^{16} + x^{14} + x^{12} + x^7 + x^6 + x^4 + x^2 + x + 1$
and
$x^{16} + x^5 + x^3 + x + 1$
Obviously, the latter one is preferred because it requires less space in code and is more likely to be right (e.g. that I wouldn't have made a copy/paste error).
Furthermore, I've noticed that to at least degree 1024 where the degree is a multiple of 8, there are irreducible polynomials of the form:
$x^n + x^i + x^j + x^k + 1$ where $n = 8*m$ and $0 < i,j,k < 25$
Is there an good algorithmic way of finding these polynomials (or ones that have even fewer terms)? Again, the purpose is to keep the non-zero terms in a look-up table in code.
Thanks in advance for any help!
UPDATE:
This Mathematica code generates all pentanomials for degrees that are multiples of 8 up to degree 1024:
IrreducibleInGF2[x_] := IrreduciblePolynomialQ[x, Modulus -> 2]
ParallelTable[
Select[
Sort[
Flatten[
Table[
x^n + x^a + x^b + x^c + 1,
{a, 1, Min[25, n - 1]}, {b, 1, a - 1}, {c, 1, b - 1}
]
]
],
IrreducibleInGF2, 1],
{n, 8, 1024, 8}]
(I sorted the list of polynomials to make sure I always got the one with the overall smallest degrees first). However, it takes quite a bit of time to run. For example, it took over 26 minutes for the case of $x^{984} + x^{24} + x^9 + x^3 + 1$ .
UPDATE #2
The HP paper "Table of Low-Weight Binary Irreducible Polynomials" has been incredibly helpful. It lists up to $x^{10000}$ and reiterates a proof by Swan that there are no trinomials when the degree is a multiple of 8 (which matches my findings). I've spot checked that their results match mine up to $x^{1024}$ so I'll just need to double check their results up to 10000 which should be much easier than finding them myself.