Tests whether a polynomial over GF(p) is primitive
tf = gf_is_primitive_polynomial(f, p, n)
Polynomial of degree n: a row of exactly n + 1 integer coefficients in 0 .. p-1, constant term first, with a non-zero last coefficient.
Prime number: the characteristic of the field, at most 2^20.
Degree of f: an integer from 1 to 20, with p^n ≤ 2^20.
T if f is primitive over GF(p), F otherwise.
A polynomial f of degree n over GF(p) is primitive when it is irreducible and its roots have multiplicative order p^n - 1, so that they generate the multiplicative group of GF(p^n). Only primitive polynomials can be used with gf_create_field.
The test computes the order of x modulo f: f is primitive exactly when f(0) ≠ 0 and that order is p^n - 1. The polynomial does not need to be monic.
| Version | Description |
| 2.0.0 | Refactoring of the function/toolbox. Returns a boolean. |