// 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; }
// 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; }