Simplify or convert Galois field element formatting
tp = gftuple(a,m)
tp = gftuple(a,prim_poly)
tp = gftuple(a,m,p)
tp = gftuple(a,prim_poly,p)
tp = gftuple(a,prim_poly,p,prim_ck)
[tp,expform] = gftuple(...)
This function performs computations in GF(pm),
where p is prime. To perform equivalent computations in GF(2m),
gftuple serves to simplify the polynomial
or exponential format of Galois field elements, or to convert from
one format to another. For an explanation of the formats that
see Representing Elements of Galois Fields.
In this discussion, the format of an element of GF(pm) is called "simplest" if all exponents of the primitive element are
Between 0 and m-1 for the polynomial format
-Inf, or between 0 and pm-2,
for the exponential format
For all syntaxes,
a is a matrix, each row
of which represents an element of a Galois field. The format of
how MATLAB interprets it:
a is a column of integers, MATLAB
interprets each row as an exponential format
of an element. Negative integers are equivalent to
that they all represent the zero element of the field.
a has more than one column,
MATLAB interprets each row as a polynomial format
of an element. (Each entry of
a must be an integer
between 0 and
The exponential or polynomial formats mentioned above are all relative to a primitive element specified by the second input argument. The second argument is described below.
tp = gftuple(a,m) returns
the simplest polynomial format of the elements that
where the kth row of
tp corresponds to the kth
a. The formats are relative to a root of
the default primitive polynomial for GF(
a positive integer.
tp = gftuple(a,prim_poly) is
the same as the syntax above, except that
a polynomial character vector or
a row vector that lists the coefficients of a degree
polynomial for GF(
2^m) in order of ascending exponents.
tp = gftuple(a,m,p)
is the same as
tp = gftuple(a,m) except that 2
is replaced by a prime number
tp = gftuple(a,prim_poly,p) is
the same as
tp = gftuple(a,prim_poly) except that
2 is replaced by a prime number
tp = gftuple(a,prim_poly,p,prim_ck) is
the same as
tp = gftuple(a,prim_poly,p) except
gftuple checks whether
a polynomial that is indeed primitive. If not, then
an error and
tp is not returned. The input argument
be any number or character vector; only its existence matters.
[tp,expform] = gftuple(...) returns
the additional matrix
expform. The kth row of
the simplest exponential format of the element that the kth row of
All other features are as described in earlier parts of this "Description"
section, depending on the input arguments.
As another example, the
gftuple command below
generates a list of elements of GF(
relative to a root of the default primitive polynomial. Some functions
in this toolbox use such a list as an input argument.
p = 5; % Or any prime number m = 4; % Or any positive integer field = gftuple([-1:p^m-2]',m,p);
Finally, the two commands below illustrate the influence of the shape of the input matrix. In the first command, a column vector is treated as a sequence of elements expressed in exponential format. In the second command, a row vector is treated as a single element expressed in polynomial format.
tp1 = gftuple([0; 1],3,3) tp2 = gftuple([0, 0, 0, 1],3,3)
The output is below.
tp1 = 1 0 0 0 1 0 tp2 = 2 1 0
The outputs reflect that, according to the default primitive polynomial for GF(33), the relations below are true.
gftuple uses recursive callbacks to determine
the exponential format.