Converting and Simplifying Element Formats

This section describes how to convert between the exponential and polynomial formats for Galois field elements, as well as how to simplify a given representation.

Converting to Simplest Polynomial Format

The gftuple function produces the simplest polynomial representation of an element of GF(pm), given either an exponential representation or a polynomial representation of that element. This can be useful for generating the list of elements of GF(pm) that other functions require.

Using gftuple requires three arguments: one representing an element of GF(pm), one indicating the primitive polynomial that MATLAB should use when computing the output, and the prime p. The table below indicates how gftuple behaves when given the first two arguments in various formats.

Behavior of gftuple Depending on Format of First Two Inputs

How to Specify ElementHow to Indicate Primitive PolynomialWhat gftuple Produces
Exponential format; c = any integer Integer m > 1 Polynomial format of Ac, where A is a root of the default primitive polynomial for GF(pm)
Example: tp = gftuple(6,2,3); % c = 6 here
Exponential format; c = any integer Vector of coefficients of primitive polynomial Polynomial format of Ac, where A is a root of the given primitive polynomial
Example: polynomial = gfprimdf(2,3); tp = gftuple(6,polynomial,3); % c = 6 here
Polynomial format of any degree Integer m > 1 Polynomial format of degree < m, using default primitive polynomial for GF(pm) to simplify
Example: tp = gftuple([0 0 0 0 0 0 1],2,3);
Polynomial format of any degree Vector of coefficients of primitive polynomial Polynomial format of degree < m, using the given primitive polynomial for GF(pm) to simplify
Example: polynomial = gfprimdf(2,3); tp = gftuple([0 0 0 0 0 0 1],polynomial,3);

The four examples that appear in the table above all produce the same vector tp = [2, 1], but their different inputs to gftuple correspond to the lines of the table. Each example expresses the fact that A6 = 2+A, where A is a root of the (default) primitive polynomial 2 + x+ x2 for GF(32).

Example

This example shows how gfconv and gftuple combine to multiply two polynomial-format elements of GF(34). Initially, gfconv multiplies the two polynomials, treating the primitive element as if it were a variable. This produces a high-order polynomial, which gftuple simplifies using the polynomial equation that the primitive element satisfies. The final result is the simplest polynomial format of the product.

p = 3; m = 4;
a = [1 2 0 1]; b = [2 2 1 2];
notsimple = gfconv(a,b,p) % a times b, using high powers of alpha
simple = gftuple(notsimple,m,p) %Highest exponent of alpha is m-1

The output is below.

notsimple =

     2     0     2     0     0     1     2


simple =

     2     1     0     1


© 1994-2005 The MathWorks, Inc.