Raises elements of a finite field to an integer power
c = gf_power(F, a, e)
A field created by gf_create_field.
Field elements.
In GF(p) (n = 1): a matrix of integers in 0 .. p-1, of any size.
In GF(p^n), n > 1: a matrix with n columns, one element per row. Each row holds the coefficients of a polynomial in α of degree < n, constant term first.
Coefficients outside 0 .. p-1 are rejected; reduce them first with gf_mod if needed.
Exponent: a non-negative integer scalar.
a^e for each element of a, in the same form as a.
gf_power(F, a, e) computes a^e in the field F for every element of a.
a^0 is 1 for non-zero a.
0^e is 0 for e > 0, and 0^0 raises an error.
Since every non-zero element satisfies a^(q-1) = 1, with q = p^n, the exponent can be arbitrarily large.
| Version | Description |
| 2.0.0 | Refactoring of the function/toolbox. Accepts several elements at once. Fixed: a^(q-1) now gives 1 for non-zero a. |