コード例 #1
0
ファイル: Ctxt.cpp プロジェクト: Kverma517/HElib
// 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;
}
コード例 #2
0
ファイル: Ctxt.cpp プロジェクト: 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;
}