Template Class SchemeBase

Template Parameter Order

  1. typename Element

Class Documentation

template<typename Element>
class lbcrypto::SchemeBase

Abstract interface for public key encryption schemes.

Template Parameters

Element – a ring element.

Public Functions

inline SchemeBase()
inline virtual ~SchemeBase()
inline virtual bool operator==(const SchemeBase &sch) const
inline virtual bool operator!=(const SchemeBase &sch) const
inline void Enable(uint32_t mask)

Enable features with a bit mast of PKESchemeFeature codes

Parameters

mask

inline uint32_t GetEnabled() const
inline bool IsFeatureEnabled(PKESchemeFeature feature)
inline virtual void Enable(PKESchemeFeature feature)
inline virtual bool ParamsGenBFVRNS(std::shared_ptr<CryptoParametersBase<Element>> cryptoParams, uint32_t evalAddCount, uint32_t multiplicativeDepth, uint32_t keySwitchCount, size_t dcrtBits, uint32_t n, uint32_t numPartQ) const
inline virtual bool ParamsGenCKKSRNS(std::shared_ptr<CryptoParametersBase<Element>> cryptoParams, usint cyclOrder, usint numPrimes, usint scalingModSize, usint firstModSize, uint32_t numPartQ, COMPRESSION_LEVEL mPIntBootCiphertextCompressionLevel) const
inline virtual bool ParamsGenBGVRNS(std::shared_ptr<CryptoParametersBase<DCRTPoly>> cryptoParams, uint32_t evalAddCount, uint32_t keySwitchCount, usint cyclOrder, usint numPrimes, usint firstModSize, usint dcrtBits, uint32_t numPartQ, usint multihopQBound) const
inline virtual KeyPair<Element> KeyGen(CryptoContext<Element> cc, bool makeSparse)
inline virtual Ciphertext<Element> Encrypt(const Element &plaintext, const PrivateKey<Element> privateKey) const
inline virtual Ciphertext<Element> Encrypt(const Element &plaintext, const PublicKey<Element> publicKey) const
inline virtual DecryptResult Decrypt(ConstCiphertext<Element> ciphertext, const PrivateKey<Element> privateKey, NativePoly *plaintext) const
inline virtual DecryptResult Decrypt(ConstCiphertext<Element> ciphertext, const PrivateKey<Element> privateKey, Poly *plaintext) const
inline std::shared_ptr<std::vector<Element>> EncryptZeroCore(const PrivateKey<Element> privateKey) const
inline std::shared_ptr<std::vector<Element>> EncryptZeroCore(const PublicKey<Element> publicKey) const
inline Element DecryptCore(ConstCiphertext<Element> ciphertext, const PrivateKey<Element> privateKey) const
inline virtual EvalKey<Element> KeySwitchGen(const PrivateKey<Element> oldPrivateKey, const PrivateKey<Element> newPrivateKey) const
inline virtual EvalKey<Element> KeySwitchGen(const PrivateKey<Element> oldPrivateKey, const PrivateKey<Element> newPrivateKey, const EvalKey<Element> evalKey) const
inline virtual EvalKey<Element> KeySwitchGen(const PrivateKey<Element> oldPrivateKey, const PublicKey<Element> newPublicKey) const
inline virtual Ciphertext<Element> KeySwitch(ConstCiphertext<Element> ciphertext, const EvalKey<Element> evalKey) const
inline virtual void KeySwitchInPlace(Ciphertext<Element> &ciphertext, const EvalKey<Element> evalKey) const
inline virtual Ciphertext<Element> KeySwitchDown(ConstCiphertext<Element> ciphertext) const
inline virtual std::shared_ptr<std::vector<Element>> EvalKeySwitchPrecomputeCore(const Element &c, std::shared_ptr<CryptoParametersBase<Element>> cryptoParamsBase) const
inline virtual std::shared_ptr<std::vector<Element>> EvalFastKeySwitchCoreExt(const std::shared_ptr<std::vector<Element>> digits, const EvalKey<Element> evalKey, const std::shared_ptr<ParmType> params) const
inline virtual std::shared_ptr<std::vector<Element>> EvalFastKeySwitchCore(const std::shared_ptr<std::vector<Element>> digits, const EvalKey<Element> evalKey, const std::shared_ptr<ParmType> params) const
inline virtual std::shared_ptr<std::vector<Element>> KeySwitchCore(const Element &a, const EvalKey<Element> evalKey) const
virtual EvalKey<Element> ReKeyGen(const PrivateKey<Element> oldPrivateKey, const PublicKey<Element> newPublicKey) const
virtual Ciphertext<Element> ReEncrypt(ConstCiphertext<Element> ciphertext, const EvalKey<Element> evalKey, const PublicKey<Element> publicKey) const
inline virtual Ciphertext<Element> EvalNegate(ConstCiphertext<Element> ciphertext) const
inline virtual void EvalNegateInPlace(Ciphertext<Element> &ciphertext) const
inline virtual Ciphertext<Element> EvalAdd(ConstCiphertext<Element> ciphertext1, ConstCiphertext<Element> ciphertext2) const
inline virtual void EvalAddInPlace(Ciphertext<Element> &ciphertext1, ConstCiphertext<Element> ciphertext2) const
inline virtual Ciphertext<Element> EvalAddMutable(Ciphertext<Element> &ciphertext1, Ciphertext<Element> &ciphertext2) const
inline virtual void EvalAddMutableInPlace(Ciphertext<Element> &ciphertext1, Ciphertext<Element> &ciphertext2) const
inline virtual Ciphertext<Element> EvalAdd(ConstCiphertext<Element> ciphertext, ConstPlaintext plaintext) const
inline virtual void EvalAddInPlace(Ciphertext<Element> &ciphertext, ConstPlaintext plaintext) const
inline virtual Ciphertext<Element> EvalAddMutable(Ciphertext<Element> &ciphertext, Plaintext plaintext) const
inline virtual void EvalAddInPlace(Ciphertext<Element> &ciphertext, const NativeInteger &constant) const
inline virtual Ciphertext<Element> EvalAdd(ConstCiphertext<Element> ciphertext, double constant) const
inline virtual void EvalAddInPlace(Ciphertext<Element> &ciphertext, double constant) const
inline virtual Ciphertext<Element> EvalSub(ConstCiphertext<Element> ciphertext1, ConstCiphertext<Element> ciphertext2) const
inline virtual void EvalSubInPlace(Ciphertext<Element> &ciphertext1, ConstCiphertext<Element> ciphertext2) const
inline virtual Ciphertext<Element> EvalSubMutable(Ciphertext<Element> &ciphertext1, Ciphertext<Element> &ciphertext2) const
inline virtual void EvalSubMutableInPlace(Ciphertext<Element> &ciphertext1, Ciphertext<Element> &ciphertext2) const
inline virtual Ciphertext<Element> EvalSub(ConstCiphertext<Element> ciphertext, ConstPlaintext plaintext) const
inline virtual void EvalSubInPlace(Ciphertext<Element> &ciphertext, ConstPlaintext plaintext) const
inline virtual Ciphertext<Element> EvalSubMutable(Ciphertext<Element> &ciphertext, Plaintext plaintext) const
inline virtual Ciphertext<Element> EvalSub(ConstCiphertext<Element> ciphertext, const NativeInteger &constant) const
inline virtual void EvalSubInPlace(Ciphertext<Element> &ciphertext, const NativeInteger &constant) const
inline virtual Ciphertext<Element> EvalSub(ConstCiphertext<Element> ciphertext, double constant) const
inline virtual void EvalSubInPlace(Ciphertext<Element> &ciphertext, double constant) const
virtual EvalKey<Element> EvalMultKeyGen(const PrivateKey<Element> privateKey) const
virtual std::vector<EvalKey<Element>> EvalMultKeysGen(const PrivateKey<Element> privateKey) const
inline virtual Ciphertext<Element> EvalMult(ConstCiphertext<Element> ciphertext1, ConstCiphertext<Element> ciphertext2) const
inline virtual Ciphertext<Element> EvalMultMutable(Ciphertext<Element> &ciphertext1, Ciphertext<Element> &ciphertext2) const
inline virtual Ciphertext<Element> EvalSquare(ConstCiphertext<Element> ciphertext) const
inline virtual Ciphertext<Element> EvalSquareMutable(Ciphertext<Element> &ciphertext) const
inline virtual Ciphertext<Element> EvalMult(ConstCiphertext<Element> ciphertext1, ConstCiphertext<Element> ciphertext2, const EvalKey<Element> evalKey) const
inline virtual void EvalMultInPlace(Ciphertext<Element> &ciphertext1, ConstCiphertext<Element> ciphertext2, const EvalKey<Element> evalKey) const
inline virtual Ciphertext<Element> EvalMultMutable(Ciphertext<Element> &ciphertext1, Ciphertext<Element> &ciphertext2, const EvalKey<Element> evalKey) const
inline virtual void EvalMultMutableInPlace(Ciphertext<Element> &ciphertext1, Ciphertext<Element> &ciphertext2, const EvalKey<Element> evalKey) const
inline virtual Ciphertext<Element> EvalSquare(ConstCiphertext<Element> ciphertext, const EvalKey<Element> evalKey) const
inline virtual void EvalSquareInPlace(Ciphertext<Element> &ciphertext, const EvalKey<Element> evalKey) const
inline virtual Ciphertext<Element> EvalSquareMutable(Ciphertext<Element> &ciphertext, const EvalKey<Element> evalKey) const
inline virtual Ciphertext<Element> EvalMultAndRelinearize(ConstCiphertext<Element> ciphertext1, ConstCiphertext<Element> ciphertext2, const std::vector<EvalKey<Element>> &evalKeyVec) const
inline virtual Ciphertext<Element> Relinearize(ConstCiphertext<Element> ciphertext, const std::vector<EvalKey<Element>> &evalKeyVec) const
inline virtual void RelinearizeInPlace(Ciphertext<Element> &ciphertext, const std::vector<EvalKey<Element>> &evalKeyVec) const
inline virtual Ciphertext<Element> EvalMult(ConstCiphertext<Element> ciphertext, ConstPlaintext plaintext) const
inline virtual void EvalMultInPlace(Ciphertext<Element> &ciphertext, ConstPlaintext plaintext) const
inline virtual Ciphertext<Element> EvalMultMutable(Ciphertext<Element> &ciphertext, Plaintext plaintext) const
inline virtual Ciphertext<Element> MultByMonomial(ConstCiphertext<Element> ciphertext, usint power) const
inline virtual void MultByMonomialInPlace(Ciphertext<Element> &ciphertext, usint power) const
inline virtual Ciphertext<Element> EvalMult(ConstCiphertext<Element> ciphertext, double constant) const
inline virtual void EvalMultInPlace(Ciphertext<Element> &ciphertext, double constant) const
inline virtual Ciphertext<DCRTPoly> MultByInteger(ConstCiphertext<DCRTPoly> ciphertext, uint64_t integer) const
inline virtual void MultByIntegerInPlace(Ciphertext<DCRTPoly> &ciphertext, uint64_t integer) const
virtual std::shared_ptr<std::map<usint, EvalKey<Element>>> EvalAutomorphismKeyGen(const PrivateKey<Element> privateKey, const std::vector<usint> &indexList) const
virtual std::shared_ptr<std::map<usint, EvalKey<Element>>> EvalAutomorphismKeyGen(const PublicKey<Element> publicKey, const PrivateKey<Element> privateKey, const std::vector<usint> &indexList) const
inline virtual Ciphertext<Element> EvalAutomorphism(ConstCiphertext<Element> ciphertext, usint i, const std::map<usint, EvalKey<Element>> &evalKeyMap, CALLER_INFO_ARGS_HDR) const
inline virtual Ciphertext<Element> EvalFastRotation(ConstCiphertext<Element> ciphertext, const usint index, const usint m, const std::shared_ptr<std::vector<Element>> digits) const
inline virtual std::shared_ptr<std::vector<Element>> EvalFastRotationPrecompute(ConstCiphertext<Element> ciphertext) const
inline virtual Ciphertext<Element> EvalFastRotationExt(ConstCiphertext<Element> ciphertext, usint index, const std::shared_ptr<std::vector<Element>> digits, bool addFirst, const std::map<usint, EvalKey<Element>> &evalKeys) const

Only supported for hybrid key switching. Performs fast (hoisted) rotation and returns the results in the extended CRT basis P*Q

Parameters
  • ciphertext – input ciphertext

  • index – the rotation index.

  • precomp – the precomputed digits for the ciphertext

  • addFirst – if true, the the first element c0 is also computed (otherwise ignored)

Returns

resulting ciphertext

inline Element KeySwitchDownFirstElement(ConstCiphertext<Element> ciphertext) const

Only supported for hybrid key switching. Scales down the polynomial c0 from extended basis P*Q to Q.

Parameters

ciphertext – input ciphertext in the extended basis

Returns

resulting polynomial

inline virtual Ciphertext<Element> KeySwitchExt(ConstCiphertext<Element> ciphertext, bool addFirst) const
virtual std::shared_ptr<std::map<usint, EvalKey<Element>>> EvalAtIndexKeyGen(const PublicKey<Element> publicKey, const PrivateKey<Element> privateKey, const std::vector<int32_t> &indexList) const
inline virtual Ciphertext<Element> EvalAtIndex(ConstCiphertext<Element> ciphertext, usint i, const std::map<usint, EvalKey<Element>> &evalKeyMap) const
inline virtual usint FindAutomorphismIndex(usint index, usint m)
virtual Ciphertext<Element> ComposedEvalMult(ConstCiphertext<Element> ciphertext1, ConstCiphertext<Element> ciphertext2, const EvalKey<Element> evalKey) const
virtual Ciphertext<Element> ModReduce(ConstCiphertext<Element> ciphertext, size_t levels) const
inline virtual void ModReduceInPlace(Ciphertext<Element> &ciphertext, size_t levels) const
inline virtual Ciphertext<Element> ModReduceInternal(ConstCiphertext<Element> ciphertext, size_t levels) const
inline virtual void ModReduceInternalInPlace(Ciphertext<Element> &ciphertext, size_t levels) const
inline virtual Ciphertext<Element> LevelReduce(ConstCiphertext<Element> ciphertext, const EvalKey<Element> evalKey, size_t levels) const
inline virtual void LevelReduceInPlace(Ciphertext<Element> &ciphertext, const EvalKey<Element> evalKey, size_t levels) const
inline virtual Ciphertext<Element> LevelReduceInternal(ConstCiphertext<Element> ciphertext, size_t levels) const
inline virtual void LevelReduceInternalInPlace(Ciphertext<Element> &ciphertext, size_t levels) const
inline virtual Ciphertext<Element> Compress(ConstCiphertext<Element> ciphertext, size_t towersLeft) const
inline virtual void AdjustLevelsInPlace(Ciphertext<DCRTPoly> &ciphertext1, Ciphertext<DCRTPoly> &ciphertext2) const
inline virtual void AdjustLevelsAndDepthInPlace(Ciphertext<DCRTPoly> &ciphertext1, Ciphertext<DCRTPoly> &ciphertext2) const
inline virtual void AdjustLevelsAndDepthToOneInPlace(Ciphertext<DCRTPoly> &ciphertext1, Ciphertext<DCRTPoly> &ciphertext2) const
inline virtual Ciphertext<Element> EvalAddMany(const std::vector<Ciphertext<Element>> &ciphertextVec) const
inline virtual Ciphertext<Element> EvalAddManyInPlace(std::vector<Ciphertext<Element>> &ciphertextVec) const
inline virtual Ciphertext<Element> EvalMultMany(const std::vector<Ciphertext<Element>> &ciphertextVec, const std::vector<EvalKey<Element>> &evalKeyVec) const
inline virtual Ciphertext<Element> EvalLinearWSum(std::vector<ConstCiphertext<Element>> &ciphertextVec, const std::vector<double> &constantVec) const
inline virtual Ciphertext<Element> EvalLinearWSumMutable(std::vector<Ciphertext<Element>> &ciphertextVec, const std::vector<double> &constantVec) const
inline Ciphertext<Element> EvalPoly(ConstCiphertext<Element> ciphertext, const std::vector<double> &coefficients) const
inline Ciphertext<Element> EvalPolyLinear(ConstCiphertext<Element> ciphertext, const std::vector<double> &coefficients) const
inline Ciphertext<Element> EvalPolyPS(ConstCiphertext<Element> ciphertext, const std::vector<double> &coefficients) const
inline Ciphertext<Element> EvalChebyshevSeries(ConstCiphertext<Element> ciphertext, const std::vector<double> &coefficients, double a, double b) const
inline Ciphertext<Element> EvalChebyshevSeriesLinear(ConstCiphertext<Element> ciphertext, const std::vector<double> &coefficients, double a, double b) const
inline Ciphertext<Element> EvalChebyshevSeriesPS(ConstCiphertext<Element> ciphertext, const std::vector<double> &coefficients, double a, double b) const
virtual std::shared_ptr<std::map<usint, EvalKey<Element>>> EvalSumKeyGen(const PrivateKey<Element> privateKey, const PublicKey<Element> publicKey) const
virtual std::shared_ptr<std::map<usint, EvalKey<Element>>> EvalSumRowsKeyGen(const PrivateKey<Element> privateKey, const PublicKey<Element> publicKey, usint rowSize, usint subringDim) const
virtual std::shared_ptr<std::map<usint, EvalKey<Element>>> EvalSumColsKeyGen(const PrivateKey<Element> privateKey, const PublicKey<Element> publicKey) const
inline virtual Ciphertext<Element> EvalSum(ConstCiphertext<Element> ciphertext, usint batchSize, const std::map<usint, EvalKey<Element>> &evalKeyMap) const
inline virtual Ciphertext<Element> EvalSumRows(ConstCiphertext<Element> ciphertext, usint rowSize, const std::map<usint, EvalKey<Element>> &evalKeyMap, usint subringDim) const
inline virtual Ciphertext<Element> EvalSumCols(ConstCiphertext<Element> ciphertext, usint batchSize, const std::map<usint, EvalKey<Element>> &evalKeyMap, const std::map<usint, EvalKey<Element>> &rightEvalKeyMap) const
virtual Ciphertext<Element> EvalInnerProduct(ConstCiphertext<Element> ciphertext1, ConstCiphertext<Element> ciphertext2, usint batchSize, const std::map<usint, EvalKey<Element>> &evalSumKeyMap, const EvalKey<Element> evalMultKey) const
inline virtual Ciphertext<Element> EvalInnerProduct(ConstCiphertext<Element> ciphertext, ConstPlaintext plaintext, usint batchSize, const std::map<usint, EvalKey<Element>> &evalSumKeyMap) const
inline virtual Ciphertext<Element> AddRandomNoise(ConstCiphertext<Element> ciphertext) const
inline virtual Ciphertext<Element> EvalMerge(const std::vector<Ciphertext<Element>> &ciphertextVec, const std::map<usint, EvalKey<Element>> &evalKeyMap) const
virtual KeyPair<Element> MultipartyKeyGen(CryptoContext<Element> cc, const std::vector<PrivateKey<Element>> &privateKeyVec, bool makeSparse)
virtual KeyPair<Element> MultipartyKeyGen(CryptoContext<Element> cc, const PublicKey<Element> publicKey, bool makeSparse, bool PRE)
virtual Ciphertext<Element> MultipartyDecryptMain(ConstCiphertext<Element> ciphertext, const PrivateKey<Element> privateKey) const
virtual Ciphertext<Element> MultipartyDecryptLead(ConstCiphertext<Element> ciphertext, const PrivateKey<Element> privateKey) const
inline virtual DecryptResult MultipartyDecryptFusion(const std::vector<Ciphertext<Element>> &ciphertextVec, NativePoly *plaintext) const
inline virtual DecryptResult MultipartyDecryptFusion(const std::vector<Ciphertext<Element>> &ciphertextVec, Poly *plaintext) const
virtual EvalKey<Element> MultiKeySwitchGen(const PrivateKey<Element> oldPrivateKey, const PrivateKey<Element> newPrivateKey, const EvalKey<Element> evalKey) const
virtual std::shared_ptr<std::map<usint, EvalKey<Element>>> MultiEvalAutomorphismKeyGen(const PrivateKey<Element> privateKey, const std::shared_ptr<std::map<usint, EvalKey<Element>>> evalAutoKeyMap, const std::vector<usint> &indexList, const std::string &keyId)
virtual std::shared_ptr<std::map<usint, EvalKey<Element>>> MultiEvalAtIndexKeyGen(const PrivateKey<Element> privateKey, const std::shared_ptr<std::map<usint, EvalKey<Element>>> evalAutoKeyMap, const std::vector<int32_t> &indexList, const std::string &keyId)
virtual std::shared_ptr<std::map<usint, EvalKey<Element>>> MultiEvalSumKeyGen(const PrivateKey<Element> privateKey, const std::shared_ptr<std::map<usint, EvalKey<Element>>> evalSumKeyMap, const std::string &keyId = "")
virtual EvalKey<Element> MultiAddEvalKeys(EvalKey<Element> evalKey1, EvalKey<Element> evalKey2, const std::string &keyId)
virtual EvalKey<Element> MultiMultEvalKey(PrivateKey<Element> privateKey, EvalKey<Element> evalKey, const std::string &keyId)
virtual std::shared_ptr<std::map<usint, EvalKey<Element>>> MultiAddEvalSumKeys(const std::shared_ptr<std::map<usint, EvalKey<Element>>> evalSumKeyMap1, const std::shared_ptr<std::map<usint, EvalKey<Element>>> evalSumKeyMap2, const std::string &keyId)
virtual std::shared_ptr<std::map<usint, EvalKey<Element>>> MultiAddEvalAutomorphismKeys(const std::shared_ptr<std::map<usint, EvalKey<Element>>> evalSumKeyMap1, const std::shared_ptr<std::map<usint, EvalKey<Element>>> evalSumKeyMap2, const std::string &keyId)
virtual PublicKey<Element> MultiAddPubKeys(PublicKey<Element> publicKey1, PublicKey<Element> publicKey2, const std::string &keyId)
virtual EvalKey<Element> MultiAddEvalMultKeys(EvalKey<Element> evalKey1, EvalKey<Element> evalKey2, const std::string &keyId)
inline virtual Ciphertext<Element> IntMPBootAdjustScale(ConstCiphertext<Element> ciphertext) const
inline virtual Ciphertext<Element> IntMPBootRandomElementGen(std::shared_ptr<CryptoParametersCKKSRNS> cryptoParameters, const PublicKey<Element> publicKey) const
inline virtual std::vector<Ciphertext<Element>> IntMPBootDecrypt(const PrivateKey<Element> privateKey, ConstCiphertext<Element> ciphertext, ConstCiphertext<Element> a) const
inline std::vector<Ciphertext<Element>> IntMPBootAdd(std::vector<std::vector<Ciphertext<Element>>> &sharesPairVec) const
inline Ciphertext<Element> IntMPBootEncrypt(const PublicKey<Element> publicKey, const std::vector<Ciphertext<Element>> &sharesPair, ConstCiphertext<Element> a, ConstCiphertext<Element> ciphertext) const
inline void EvalBootstrapSetup(const CryptoContextImpl<Element> &cc, const std::vector<uint32_t> &levelBudget = {5, 4}, const std::vector<uint32_t> &dim1 = {0, 0}, uint32_t slots = 0, uint32_t correctionFactor = 0, bool precompute = true)
inline std::shared_ptr<std::map<usint, EvalKey<Element>>> EvalBootstrapKeyGen(const PrivateKey<Element> privateKey, uint32_t slots)
inline void EvalBootstrapPrecompute(const CryptoContextImpl<Element> &cc, uint32_t slots = 0)
inline Ciphertext<Element> EvalBootstrap(ConstCiphertext<Element> ciphertext, uint32_t numIterations = 1, uint32_t precision = 0) const
inline LWEPrivateKey EvalCKKStoFHEWSetup(const SchSwchParams &params)
inline std::shared_ptr<std::map<usint, EvalKey<Element>>> EvalCKKStoFHEWKeyGen(const KeyPair<Element> &keyPair, ConstLWEPrivateKey &lwesk)
inline void EvalCKKStoFHEWPrecompute(const CryptoContextImpl<Element> &cc, double scale = 1.0)
inline std::vector<std::shared_ptr<LWECiphertextImpl>> EvalCKKStoFHEW(ConstCiphertext<Element> ciphertext, uint32_t numCtxts = 0)
inline void EvalFHEWtoCKKSSetup(const CryptoContextImpl<DCRTPoly> &ccCKKS, const std::shared_ptr<BinFHEContext> &ccLWE, uint32_t numSlotsCKKS = 0, uint32_t logQ = 25)
inline std::shared_ptr<std::map<usint, EvalKey<Element>>> EvalFHEWtoCKKSKeyGen(const KeyPair<Element> &keyPair, ConstLWEPrivateKey &lwesk, uint32_t numSlots = 0, uint32_t numCtxts = 0, uint32_t dim1 = 0, uint32_t L = 0)
inline void EvalCompareSwitchPrecompute(const CryptoContextImpl<Element> &ccCKKS, uint32_t pLWE = 0, double scaleSign = 1.0, bool unit = false)
inline Ciphertext<Element> EvalFHEWtoCKKS(std::vector<std::shared_ptr<LWECiphertextImpl>> &LWECiphertexts, uint32_t numCtxts = 0, uint32_t numSlots = 0, uint32_t p = 4, double pmin = 0.0, double pmax = 2.0, uint32_t dim1 = 0) const
inline LWEPrivateKey EvalSchemeSwitchingSetup(const SchSwchParams &params)
inline std::shared_ptr<std::map<usint, EvalKey<Element>>> EvalSchemeSwitchingKeyGen(const KeyPair<Element> &keyPair, ConstLWEPrivateKey &lwesk)
inline Ciphertext<Element> EvalCompareSchemeSwitching(ConstCiphertext<Element> ciphertext1, ConstCiphertext<Element> ciphertext2, uint32_t numCtxts = 0, uint32_t numSlots = 0, uint32_t pLWE = 0, double scaleSign = 1.0, bool unit = false)
inline std::vector<Ciphertext<Element>> EvalMinSchemeSwitching(ConstCiphertext<Element> ciphertext, PublicKey<Element> publicKey, uint32_t numValues = 0, uint32_t numSlots = 0, uint32_t pLWE = 0, double scaleSign = 1.0)
inline std::vector<Ciphertext<Element>> EvalMinSchemeSwitchingAlt(ConstCiphertext<Element> ciphertext, PublicKey<Element> publicKey, uint32_t numValues = 0, uint32_t numSlots = 0, uint32_t pLWE = 0, double scaleSign = 1.0)
inline std::vector<Ciphertext<Element>> EvalMaxSchemeSwitching(ConstCiphertext<Element> ciphertext, PublicKey<Element> publicKey, uint32_t numValues = 0, uint32_t numSlots = 0, uint32_t pLWE = 0, double scaleSign = 1.0)
inline std::vector<Ciphertext<Element>> EvalMaxSchemeSwitchingAlt(ConstCiphertext<Element> ciphertext, PublicKey<Element> publicKey, uint32_t numValues = 0, uint32_t numSlots = 0, uint32_t pLWE = 0, double scaleSign = 1.0)
inline std::shared_ptr<lbcrypto::BinFHEContext> GetBinCCForSchemeSwitch()
inline void SetBinCCForSchemeSwitch(std::shared_ptr<lbcrypto::BinFHEContext> ccLWE)
inline Ciphertext<Element> GetSwkFC()
inline void SetSwkFC(Ciphertext<Element> FHEWtoCKKSswk)
template<class Archive>
inline void save(Archive &ar, std::uint32_t const version) const
template<class Archive>
inline void load(Archive &ar, std::uint32_t const version)
inline virtual std::string SerializedObjectName() const
inline void VerifyAdvancedSHEEnabled(const std::string &functionName) const

VerifyAdvancedSHEEnabled is to check if Enable(ADVANCEDSHE) has been called and if it has not it will thow an exception.

Parameters

functionName – is the calling function name. func can be used instead

inline void VerifyMultipartyEnabled(const std::string &functionName) const

VerifyMultipartyEnabled is to check if Enable(MULTIPARTY) has been called and if it has not it will thow an exception.

Parameters

functionName – is the calling function name. func can be used instead

inline void VerifyLeveledSHEEnabled(const std::string &functionName) const

VerifyLeveledSHEEnabled is to check if Enable(LEVELEDSHE) has been called and if it has not it will thow an exception.

Parameters

functionName – is the calling function name. func can be used instead

inline void VerifyPKEEnabled(const std::string &functionName) const

VerifyPKEEnabled is to check if Enable(PKE) has been called and if it has not it will thow an exception.

Parameters

functionName – is the calling function name. func can be used instead

inline void VerifyPREEnabled(const std::string &functionName) const

VerifyPREEnabled is to check if Enable(PRE) has been called and if it has not it will thow an exception.

Parameters

functionName – is the calling function name. func can be used instead

inline void VerifyKeySwitchEnabled(const std::string &functionName) const

VerifyKeySwitchEnabled is to check if Enable(KEYSWITCH) has been called and if it has not it will thow an exception.

Parameters

functionName – is the calling function name. func can be used instead

inline void VerifyFHEEnabled(const std::string &functionName) const

VerifyFHEEnabled is to check if Enable(FHE) has been called and if it has not it will thow an exception.

Parameters

functionName – is the calling function name. func can be used instead

inline void VerifySchemeSwitchEnabled(const std::string &functionName) const

VerifySchemeSwitchEnabled is to check if Enable(SCHEMESWITCH) has been called and if it has not it will thow an exception.

Parameters

functionName – is the calling function name. func can be used instead

Public Static Functions

static inline uint32_t SerializedVersion()

Protected Functions

inline void CheckMultipartyDecryptCompatibility(ConstCiphertext<Element> &ciphertext, CALLER_INFO_ARGS_HDR) const

Protected Attributes

std::shared_ptr<ParameterGenerationBase<Element>> m_ParamsGen
std::shared_ptr<PKEBase<Element>> m_PKE
std::shared_ptr<KeySwitchBase<Element>> m_KeySwitch
std::shared_ptr<PREBase<Element>> m_PRE
std::shared_ptr<LeveledSHEBase<Element>> m_LeveledSHE
std::shared_ptr<AdvancedSHEBase<Element>> m_AdvancedSHE
std::shared_ptr<MultipartyBase<Element>> m_Multiparty
std::shared_ptr<FHEBase<Element>> m_FHE
std::shared_ptr<FHEBase<Element>> m_SchemeSwitch

Friends

inline friend std::ostream &operator<<(std::ostream &out, const SchemeBase<Element> &s)