/* If B0 = 0, TT = 2. deg(g(x)) = 2*TT = 4. g(x) = (x+1) (x+@) (x+@**2) (x+@**3)  */
static void gen_poly(void)
/* If B0 = 0, TT = 2. deg(g(x)) = 2*TT = 4. g(x) = (x+1) (x+@) (x+@**2) (x+@**3)  */
static void gen_poly(void)
{
  register int i, j;
  Gg[0] = 1;
  for (i = 0; i < NN - KK; i++) {
    Gg[i+1] = 1;
    for (j = i; j > 0; j--)
      if (Gg[j] != 0)
        Gg[j] = Gg[j - 1] ^ Alpha_to[modnn((Index_of[Gg[j]]) + (B0 + i) *PRIM)];
      else
        Gg[j] = Gg[j - 1];
    Gg[0] = Alpha_to[modnn(Index_of[Gg[0]] + (B0 + i) * PRIM)];
  }
  for (i = 0; i <= NN - KK; i++)
    Gg[i] = Index_of[Gg[i]];
}