Raises a polynomial over GF(p) to an integer power
c = gf_poly_power(a, e, p)
Polynomial over GF(p): a row vector of integer coefficients in 0 .. p-1, constant term first. For instance [1 0 1 1] is 1 + x² + x³.
Exponent: a non-negative integer scalar.
Prime number: the characteristic of the field.
Result as a row of coefficients, constant term first, trimmed to its degree (no trailing zeros). The zero polynomial is returned as 0.
gf_poly_power(a, e, p) computes a^e over GF(p) by repeated squaring.
a^0 is the constant polynomial 1 for non-zero a, and 0^0 raises an error.
The degree of the result, e × deg a, can be at most 100 000.
Over GF(p), (a + b)^p = a^p + b^p, so powers of p of a binomial have only two terms.
| Version | Description |
| 2.0.0 | Refactoring of the function/toolbox. |