Пример #1
0
NTL_START_IMPL






void BlockConstruct(GF2E* x, long n)
{
   if (n <= 0) return;

   if (!GF2EInfo)
      Error("GF2E constructor called while modulus undefined");

   long d = GF2E::WordLength();

   long m, j;

   long i = 0;

   while (i < n) {
      m = WV_BlockConstructAlloc(x[i]._GF2E__rep.xrep, d, n-i);
      for (j = 1; j < m; j++)
         WV_BlockConstructSet(x[i]._GF2E__rep.xrep, x[i+j]._GF2E__rep.xrep, j);
      i += m;
   }
}
Пример #2
0
NTL_START_IMPL

static
void BasicBlockConstruct(GF2E* x, long n, long d)
{
   long m, j;
 
   long i = 0;

   NTL_SCOPE(guard) { BlockDestroy(x, i); };
 
   while (i < n) {
      m = WV_BlockConstructAlloc(x[i]._GF2E__rep.xrep, d, n-i);
      for (j = 1; j < m; j++)
         WV_BlockConstructSet(x[i]._GF2E__rep.xrep, x[i+j]._GF2E__rep.xrep, j);
      i += m;
   }

   guard.relax();
}