galois.primitive_polys

galois.primitive_polys(characteristic, degree)

Returns all degree-\(m\) primitive polynomials \(f(x)\) over \(\mathrm{GF}(p)\).

Parameters
  • characteristic (int) – The prime characteristic \(p\) of the field \(\mathrm{GF}(p)\) that the polynomial is over.

  • degree (int) – The degree \(m\) of the desired polynomial that produces the field extension \(\mathrm{GF}(p^m)\) of \(\mathrm{GF}(p)\).

Returns

All degree-\(m\) primitive polynomials over \(\mathrm{GF}(p)\).

Return type

list

Examples

In [1]: galois.primitive_polys(2, 5)
Out[1]: 
[Poly(x^5 + x^2 + 1, GF(2)),
 Poly(x^5 + x^3 + 1, GF(2)),
 Poly(x^5 + x^3 + x^2 + x + 1, GF(2)),
 Poly(x^5 + x^4 + x^2 + x + 1, GF(2)),
 Poly(x^5 + x^4 + x^3 + x + 1, GF(2)),
 Poly(x^5 + x^4 + x^3 + x^2 + 1, GF(2))]