TITLE: How to find minimal polynomial for an element in $\mbox{GF}(2^m)$?
QUESTION [8 upvotes]: I'm new to this Finite field theory. Someone please explain how minimal polynomials are generated for each element in GF(2^m). I searched in the website but I'm not getting any clue.

REPLY [3 votes]: The OP's comment states the goal here is to generate the minimum polynomial for a BCH code. I have an old program that does a brute force search, similar to the example shown in the wiki article:
https://en.wikipedia.org/wiki/BCH_code#Example
Using GF(2^5) based on $x^5+x^2+1$, $\alpha=x+0 =$ hex 02, with code length n = 31, message length k and distance d for a code BCH(n,k,d).
Powers of $\alpha$ (hex 02) from 0 to 30 in GF(2^5), shown as hex:

01 02 04 08 10 05 0a 14
0d 1a 11 07 0e 1c 1d 1f
1b 13 03 06 0c 18 15 0f
1e 19 17 0b 16 09 12

A list of minimum polynomials with 1 bit coefficients otherwise under GF(2^5) for the 30 powers of $\alpha$ where $m_i(\alpha^i)\ mod\ (x^5+x^2+1) = 0$. Each of these can be found using the method shown in Jyrki Lahtonen's answer, or by a brute force search in the range $x^5+1$ to $x^5+x^4+x^3+x^2+x+1$.
m1,m2,m4,m8,m16 = $x^5+x^2+1$
m3,m6,m12,m17,m24 = $x^5+x^4+x^3+x^2+1$
m5,m9,m10,m18,m20 = $x^5+x^4+x^2+x+1$
m7,m14,m19,m25,m28 = $x^5+x^3+x^2+x+1$
m11,m13,m21,m22,m26 = $x^5+x^4+x^3+x+1$
m15,m23,m27,m29,m30 = $x^5+x^3+1$
lcm(...) is the least common multiple for the list of $m_i$'s.
1 bit correction: BCH(31,26,3) => lcm(m1,m2) = 
$m1 = x^5+x^2+1$
2 bit correction: BCH(31,21,5) => lcm(m1,m2,m3,m4) = 
$m1\ m3 = x^{10}+x^9+x^8+x^6+x^5+x^3+1$
3 bit correction: BCH(31,16,7) => lcm(m1,m2,...m6) = 
$m1\  m3\  m5 = x^{15}+x^{11}+x^{10}+x^9+x^8+x^7+x^5+x^3+x^2+x^1+1$
5 bit correction: BCH(31,11,11) => lcm(m1,m2,...m10) = 
$m1\ m3\ m5\ m7 = x^{20}+x^{18}+x^{17}+x^{13}+x^{10}+x^9+x^7+x^6+x^4+x^2+1$
7 bit correction: BCH(31,6,15) => lcm(m1,m2,...m14) = 
$m1\ m3\ m5\ m7\ m11 =$
 $x^{25}+x^{24}+x^{21}+x^{19}+x^{18}+x^{16}+x^{15}+x^{14}+x^{13}+x^{11}+x^9+x^5+x^2+x+1$
15 bit correction: BCH(31,1,31) => lcm(m1,m2,...m30) = 
$m1\ m3\ m5\ m7\ m11\ m15 =$
$x^{30}+x^{29}+x^{28}...+x^2+x+1$ 
There are only two valid codes, all 0 bits or all 1 bits.

A common example of BCH code is for some types of ECC memory, which use a shortened BCH(127,120,3) code based on GF(2^7) plus a parity bit used to prevent a single bit correction if the number of error bits is even, such as 2, 64 bits of data, 7 bits for the BCH code, 1 bit for the parity, for a total of 72 bits. Since it's a single bit correction, the BCH generator polynomial will be the same as the field polynomial, such as $x^7+x+1$.