<< gf_poly_multiply Polynomials over GF(p) gf_poly_subtract >>

Galois Fields >> Galois Fields > Polynomials over GF(p) > gf_poly_power

gf_poly_power

Raises a polynomial over GF(p) to an integer power

Syntax

c = gf_poly_power(a, e, p)

Arguments

a

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³.

e

Exponent: a non-negative integer scalar.

p

Prime number: the characteristic of the field.

c

Result as a row of coefficients, constant term first, trimmed to its degree (no trailing zeros). The zero polynomial is returned as 0.

Description

gf_poly_power(a, e, p) computes a^e over GF(p) by repeated squaring.

Over GF(p), (a + b)^p = a^p + b^p, so powers of p of a binomial have only two terms.

Examples

gf_poly_power([1 1], 2, 2)    // [1 0 1]: (1 + x)^2 = 1 + x^2
gf_poly_power([1 1], 3, 3)    // [1 0 0 1]: (1 + x)^3 = 1 + x^3
gf_poly_power([1 1], 8, 2)    // [1 0 0 0 0 0 0 0 1]
gf_poly_power([1 1], 0, 2)    // 1

See also

History

VersionDescription
2.0.0

Refactoring of the function/toolbox.


Report an issue
<< gf_poly_multiply Polynomials over GF(p) gf_poly_subtract >>