Default primitive polynomial of a given degree over GF(p)
f = gf_default_primitive_polynomial(p, n)
Prime number: the characteristic of the field, at most 2^20.
Degree: an integer from 1 to 20, with p^n ≤ 2^20.
The primitive polynomial: a row of n + 1 coefficients, constant term first.
This is the polynomial that gf_create_field uses when no primitive polynomial is given.
For n = 1 it is x - g, where g is the smallest primitive root modulo p. Its coefficients are [p - g, 1] (for p = 2: [1 1]).
For n > 1 it is the first monic primitive polynomial c(1) + c(2) x + ... + c(n) x^(n-1) + x^n, when the candidates are taken in increasing order of c(1) + c(2) p + ... + c(n) p^(n-1) (the constant term changes fastest). It is therefore also the first row of gf_primitive_polynomials(p, n).
| Version | Description |
| 2.0.0 | Refactoring of the function/toolbox. Now available for any degree n. |