주요 콘텐츠

gfmul

R2026b

Multiply elements of Galois field

Description

c = gfmul(a,b) returns the Galois field resulting from element-by-element multiplication of input Galois fields a and b. Each entry of a and b is an element in GF(2). For more information, see Galois Field Entries.

example

c = gfmul(a,b,p) returns the Galois field resulting from element-by-element multiplication of input Galois fields a and b in GF(p), where p is a prime number. For more information, see Galois Field Entries.

c = gfmul(a,b,field) returns the Galois field resulting from element-by-element multiplication of input Galois fields a and b in GF(pm) in exponential form, where p is a prime number and m is a positive integer. For more information, see Galois Field Entries.

Examples

collapse all

Use gfmul to multiply powers of a primitive polynomial root. IfA is a root of the primitive polynomial 2+2x+x2 for gf(9), then A2⋅A4=A6.

p = 3;
m = 2;
prim_poly = [2 2 1];
field = gftuple([-1:p^m-2]',prim_poly,p);
a = gfmul(2,4,field)
a = 
6

Input Arguments

collapse all

Galois field, specified as a scalar, vector, or matrix.

Galois field, specified as a scalar, vector, or matrix. a and b must be the same size.

Prime number, specified as a scalar. Each entry in a and b represents an element of GF(p).

List of all elements in GF(pm), specified as a matrix arranged relative to the same primitive element. a and b must be the same size.

To generate field, use

field =gftuple([-1:p^m-2]',m,p)
where m is a positive integer and p is a prime number. The coefficients, specified in exponential format, represent the field elements in GF(pm). For an explanation of these formats, see Representing Elements of Galois Fields.

Output Arguments

collapse all

Galois field, returned as a scalar, vector, or matrix. c is the exponential format of the product, relative to the same primitive element. For more information, see Galois Field Entries.

More About

collapse all

Tips

  • This function multiplies elements of a Galois field.

  • For polynomial multiplication in GF(p) or GF(pm, use gfconv instead.

  • This function performs computations in GF(pm), where p is prime.

  • To work in GF(2m), you can also apply the .* operator to Galois arrays. For more information, see Example: Multiplication.

Version History

Introduced before R2006a