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

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

   long d = GF2E::WordLength();
   BasicBlockConstruct(x, n, d);
}
Exemple #2
0
void BlockConstruct(ZZ_p* x, long n)
{
    if (n <= 0) return;

    if (!ZZ_pInfo)
        LogicError("ZZ_p constructor called while modulus undefined");

    long d = ZZ_p::ModulusSize();

    BasicBlockConstruct(x, n, d);
}
void BlockConstructFromVec(GF2E* x, long n, const GF2E* y)
{
   if (n <= 0) return;

   long d = y->_GF2E__rep.xrep.MaxLength();
   BasicBlockConstruct(x, n, d);

   NTL_SCOPE(guard) { BlockDestroy(x, n); };

   long i;
   for (i = 0; i < n; i++) x[i] = y[i];

   guard.relax();
}
void BlockConstructFromVec(ZZ_p* x, long n, const ZZ_p* y)
{
   if (n <= 0) return;

   long d = y->_ZZ_p__rep.MaxAlloc() - 1;
   BasicBlockConstruct(x, n, d);

   NTL_SCOPE(guard) { BlockDestroy(x, n); };

   long i;
   for (i = 0; i < n; i++) x[i] = y[i];

   guard.relax();
}
void BlockConstructFromObj(GF2E* x, long n, const GF2E& y)
{
   if (n <= 0) return;

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

   long d = GF2E::WordLength();

   BasicBlockConstruct(x, n, d);

   NTL_SCOPE(guard) { BlockDestroy(x, n); };

   long i;
   for (i = 0; i < n; i++) x[i] = y;

   guard.relax();
}
void BlockConstructFromObj(ZZ_p* x, long n, const ZZ_p& y)
{
   if (n <= 0) return;


   if (!ZZ_pInfo)
      LogicError("ZZ_p constructor called while modulus undefined");

   long d = ZZ_p::ModulusSize();

   BasicBlockConstruct(x, n, d);

   NTL_SCOPE(guard) { BlockDestroy(x, n); };

   long i;
   for (i = 0; i < n; i++) x[i] = y;

   guard.relax();
}