True for primitive polynomial for Galois field
the polynomial that
a represents is primitive for
the Galois field GF(2m), and
a can represent the polynomial using
one of these formats:
A nonnegative integer less than 217.
The binary representation of this integer indicates the coefficients
of the polynomial. In this case, m is
A Galois row vector in GF(2), listing the coefficients
of the polynomial in order of descending powers. In this case, m is
the order of the polynomial represented by
The example below finds all primitive polynomials for GF(8)
and then checks using
isprimitive whether specific
polynomials are primitive.
a = primpoly(3,'all','nodisplay'); % All primitive polys for GF(8) isp1 = isprimitive(13) % 13 represents a primitive polynomial. isp2 = isprimitive(14) % 14 represents a nonprimitive polynomial.
The output is below. If you examine the vector
isp1 is true because
an element in
14 is not an element in
isp1 = 1 isp2 = 0