Let \(\mathbb {F}_r^m\)  be the \(m\) -dimensional vector space over \(\mathbb {F}_r\)  formed by all row vectors \((c_0,c_1,\ldots ,c_{m-1})\)  with entries in \(\mathbb {F}_r\) . Let \(C\)  be a linear \([m,k]_r\)  code, that is, a \(k\) -dimensional
vector subspace in \(\mathbb {F}_r^m\) . A linear code \(C\)  is cyclic if \((c_0,c_1,\ldots ,c_{m-1})\in C\)  implies \((c_{m-1},c_0,\ldots ,c_{m-2})\in C\) . The vector space \(\mathbb {F}_r^m\)  can be identified with the principal ideal domain \(\mathbb {F}_r[x]/(x^m-1)\) . Under this identification, cyclic codes correspond
exactly to the ideals in \(\mathbb {F}_r[x]/(x^m-1)\)  (see [1]} or [2]}).
The generating polynomial \(g(x)\)  of a nonzero cyclic code \(C\)  is
the unique monic polynomial of the lowest degree in \(C\) . In this case
\(C=\langle g(x)\rangle :=\lbrace a(x)g(x) \colon a(x)\in \mathbb {F}_r[x])\rbrace \) ,
where the multiplication is done modulo \(x^m-1\) . Moreover, \(g(x)\) 
divides the polynomial \(x^m-1\)  in \(\mathbb {F}_r[x]\) , and the dimension
of the cyclic code \(C\)  equals \(k=m-\deg g(x)\) .
The polynomial \(h(x)=(x^m-1)/g(x)\) 
is the parity-check polynomial of \(C\) . If \(g(x)=\sum _{i=0}^{m-k}g_i x^i\)  where \(g_i\in \mathbb {F}_r\) , then \(C\) , viewed in \(\mathbb {F}_r^m\) , is spanned by \(k\)  vectors
\((g_0,g_1,\ldots ,g_{m-k},0,\ldots ,0), (0,g_0,g_1,\ldots ,g_{m-k},0,\ldots ,0), \ldots , (0,\ldots ,0,g_0,g_1,\ldots ,g_{m-k}).\) 
