GF is small enough that you should construct an antilog table for it and save it for later reference rather than compute the polynomial form of
or
on the fly each time you need it. The
computer version of the antilog table is an array that stores the polynomial forms for
in locations
. For human use, the table
is constructed with two columns and looks something like this
$$\begin{array}{r|l}
\hline\\
i & \alpha^i \text{ equals}\\
\hline\\
0 & 00000001\\
1 & 00000010\\
2 & 00000100\\
3 & 00001000\\
4 & 00010000\\
5 & 00100000\\
6 & 01000000\\
7 & 10000000\\
8 & 00011101\\
9 & 00111010\\
10 & 01110100\\
11 & 11101000\\
12 & 11001101\\
\vdots & \vdots\quad \vdots \quad \vdots\\
254 & 10001110\\
\hline
\end{array}$$
The
-th entry in the second column is the polynomial representation
of
in abbreviated format. For example,
is stated to be equal to
which is shorthand for
.
The entry for
is obtained by shifting the entry
immediately above by one place to the left (inserting a
on the
right) and if there is an
term thus formed, removing it
and adding
(i.e. XORing
)
into the
rightmost
bits. This process is easy to mechanize to produce
the antilog table by computer rather than by hand (which can be tedious
and mistake-prone).
» pip install GF256