Esempio n. 1
0
// Constructor
Ctxt::Ctxt(const FHEPubKey& newPubKey, long newPtxtSpace):
  context(newPubKey.getContext()), pubKey(newPubKey), ptxtSpace(newPtxtSpace),
  noiseVar(to_xdouble(0.0))
{
  if (ptxtSpace<=0) ptxtSpace = pubKey.getPtxtSpace();
  else assert (GCD(ptxtSpace, pubKey.getPtxtSpace()) > 1); // sanity check
  primeSet=context.ctxtPrimes;
}
Esempio n. 2
0
File: Ctxt.cpp Progetto: 2080/HElib
// Constructor
Ctxt::Ctxt(const FHEPubKey& newPubKey, long newPtxtSpace):
  context(newPubKey.getContext()), pubKey(newPubKey), ptxtSpace(newPtxtSpace),
  noiseVar(to_xdouble(0.0))
{
  if (ptxtSpace != pubKey.getPtxtSpace()) { // plaintext-space mistamtch
    ptxtSpace = GCD(ptxtSpace, pubKey.getPtxtSpace());
    if (ptxtSpace <= 1) Error("Plaintext-space mismatch Ctxt constructor");
  }
  primeSet=context.ctxtPrimes;
}