Multiply elements of Galois field
c = gfmul(a,b,p)
c = gfmul(a,b,field)
This function performs computations in GF(pm)
where p is prime. To work in GF(2m), apply
.* operator to Galois arrays. For details,
see Example: Multiplication.
gfmul function multiplies elements of
a Galois field. (To multiply polynomials over a Galois field, use
c = gfmul(a,b,p) multiplies
p). Each entry of
between 0 and
p is a prime
b are matrices
of the same size, the function treats each element independently.
c = gfmul(a,b,field) multiplies
GF(pm), where p is a prime number and m
is a positive integer.
elements of GF(pm) in exponential format
relative to some primitive element of GF(pm).
the matrix listing all elements of GF(pm),
arranged relative to the same primitive element.
the exponential format of the product, relative to the same primitive
element. See Representing Elements of Galois Fields for an explanation
of these formats. If
matrices of the same size, the function treats each element independently.
Arithmetic in Galois Fields contains examples. Also, the code below shows that
where A is a root of the primitive polynomial 2 + 2x + x2 for GF(9).
p = 3; m = 2; prim_poly = [2 2 1]; field = gftuple([-1:p^m-2]',prim_poly,p); a = gfmul(2,4,field)
The output is
a = 6