<< gf_poly_divide Polynomials over GF(p) gf_poly_power >>

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

gf_poly_multiply

Multiplies polynomials over GF(p)

Syntax

c = gf_poly_multiply(a, b, p)

Arguments

a, b

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³. The two polynomials can have different lengths.

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_multiply(a, b, p) computes the product a × b with coefficients reduced modulo p. The degree of the result is deg a + deg b, unless one of the factors is zero.

Examples

gf_poly_multiply([1 1], [1 1], 2)      // [1 0 1]: (1 + x)^2 = 1 + x^2 over GF(2)
gf_poly_multiply([1 2], [1 1], 3)      // [1 0 2]: (1 + 2x)(1 + x) = 1 + 2x^2 over GF(3)

See also

History

VersionDescription
2.0.0

Refactoring of the function/toolbox. Operands of different lengths are accepted and the result is trimmed.


Report an issue
<< gf_poly_divide Polynomials over GF(p) gf_poly_power >>