Communications Toolbox    

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 Element
How to Indicate Primitive Polynomial
What 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

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.


  Default Primitive Polynomials Example: Generating a List of Galois Field Elements