Class FHECKKSRNS

Inheritance Relationships

Base Type

Class Documentation

class lbcrypto::FHECKKSRNS : public lbcrypto::FHERNS

Inheritence diagram for lbcrypto::FHECKKSRNS:

digraph { graph [bgcolor="#00000000"] node [shape=rectangle style=filled fillcolor="#FFFFFF" font=Helvetica padding=2] edge [color="#1414CE"] "3" [label="lbcrypto::FHEBase< DCRTPoly >" tooltip="lbcrypto::FHEBase< DCRTPoly >"] "1" [label="lbcrypto::FHECKKSRNS" tooltip="lbcrypto::FHECKKSRNS" fillcolor="#BFBFBF"] "2" [label="lbcrypto::FHERNS" tooltip="lbcrypto::FHERNS"] "1" -> "2" [dir=forward tooltip="public-inheritance"] "2" -> "3" [dir=forward tooltip="public-inheritance"] }

Collaboration diagram for lbcrypto::FHECKKSRNS:

digraph { graph [bgcolor="#00000000"] node [shape=rectangle style=filled fillcolor="#FFFFFF" font=Helvetica padding=2] edge [color="#1414CE"] "3" [label="lbcrypto::FHEBase< DCRTPoly >" tooltip="lbcrypto::FHEBase< DCRTPoly >"] "1" [label="lbcrypto::FHECKKSRNS" tooltip="lbcrypto::FHECKKSRNS" fillcolor="#BFBFBF"] "2" [label="lbcrypto::FHERNS" tooltip="lbcrypto::FHERNS"] "1" -> "2" [dir=forward tooltip="public-inheritance"] "2" -> "3" [dir=forward tooltip="public-inheritance"] }

Public Functions

inline virtual ~FHECKKSRNS()
virtual void EvalBootstrapSetup(const CryptoContextImpl<DCRTPoly> &cc, std::vector<uint32_t> levelBudget, std::vector<uint32_t> dim1, uint32_t slots, uint32_t correctionFactor, bool precompute) override

Bootstrap functionality: There are three methods that have to be called in this specific order:

  1. EvalBootstrapSetup: computes and encodes the coefficients for encoding and decoding and stores the necessary parameters

  2. EvalBootstrapKeyGen: computes and stores the keys for rotations and conjugation

  3. EvalBootstrap: refreshes the given ciphertext Sets all parameters for the linear method for the FFT-like method

Parameters
  • levelBudget – - vector of budgets for the amount of levels in encoding and decoding

  • dim1 – - vector of inner dimension in the baby-step giant-step routine for encoding and decoding

  • slots – - number of slots to be bootstrapped

  • correctionFactor – - value to rescale message by to improve precision. If set to 0, we use the default logic. This value is only used when NATIVE_SIZE=64

  • precompute – - flag specifying whether to precompute the plaintexts for encoding and decoding.

virtual std::shared_ptr<std::map<usint, EvalKey<DCRTPoly>>> EvalBootstrapKeyGen(const PrivateKey<DCRTPoly> privateKey, uint32_t slots) override

Virtual function to define the generation of all automorphism keys for EvalBT (with FFT evaluation). EvalBTKeyGen uses the baby-step/giant-step strategy.

Parameters
  • privateKey – private key.

  • slots – - number of slots to be bootstrapped

Returns

the dictionary of evaluation key indices.

virtual void EvalBootstrapPrecompute(const CryptoContextImpl<DCRTPoly> &cc, uint32_t slots) override

Computes the plaintexts for encoding and decoding for both linear and FFT-like methods. Supported in CKKS only.

Parameters

slots – - number of slots to be bootstrapped

virtual Ciphertext<DCRTPoly> EvalBootstrap(ConstCiphertext<DCRTPoly> ciphertext, uint32_t numIterations, uint32_t precision) const override

Defines the bootstrapping evaluation of ciphertext

The flavor of bootstrapping that uses the numIterations and precision parameters is described in the Meta-BTS paper. Source: Bae Y., Cheon J., Cho W., Kim J., and Kim T. META-BTS: Bootstrapping Precision Beyond the Limit. Cryptology ePrint Archive, Report 2022/1167. (https://eprint.iacr.org/2022/1167.pdf)

Parameters
  • ciphertext – the input ciphertext.

  • numIterations – number of iterations to run iterative bootstrapping (Meta-BTS). Increasing the iterations increases the precision of bootstrapping.

  • precision – precision of initial bootstrapping algorithm. This value is determined by the user experimentally by first running EvalBootstrap with numIterations = 1 and precision = 0 (unused).

Returns

the refreshed ciphertext.

std::vector<int32_t> FindBootstrapRotationIndices(uint32_t slots, uint32_t M)
std::vector<int32_t> FindLinearTransformRotationIndices(uint32_t slots, uint32_t M)
std::vector<int32_t> FindCoeffsToSlotsRotationIndices(uint32_t slots, uint32_t M)
std::vector<int32_t> FindSlotsToCoeffsRotationIndices(uint32_t slots, uint32_t M)
std::vector<ConstPlaintext> EvalLinearTransformPrecompute(const CryptoContextImpl<DCRTPoly> &cc, const std::vector<std::vector<std::complex<double>>> &A, double scale = 1, uint32_t L = 0) const
std::vector<ConstPlaintext> EvalLinearTransformPrecompute(const CryptoContextImpl<DCRTPoly> &cc, const std::vector<std::vector<std::complex<double>>> &A, const std::vector<std::vector<std::complex<double>>> &B, uint32_t orientation = 0, double scale = 1, uint32_t L = 0) const
std::vector<std::vector<ConstPlaintext>> EvalCoeffsToSlotsPrecompute(const CryptoContextImpl<DCRTPoly> &cc, const std::vector<std::complex<double>> &A, const std::vector<uint32_t> &rotGroup, bool flag_i, double scale = 1, uint32_t L = 0) const
std::vector<std::vector<ConstPlaintext>> EvalSlotsToCoeffsPrecompute(const CryptoContextImpl<DCRTPoly> &cc, const std::vector<std::complex<double>> &A, const std::vector<uint32_t> &rotGroup, bool flag_i, double scale = 1, uint32_t L = 0) const
Ciphertext<DCRTPoly> EvalLinearTransform(const std::vector<ConstPlaintext> &A, ConstCiphertext<DCRTPoly> ct) const
Ciphertext<DCRTPoly> EvalCoeffsToSlots(const std::vector<std::vector<ConstPlaintext>> &A, ConstCiphertext<DCRTPoly> ctxt) const
Ciphertext<DCRTPoly> EvalSlotsToCoeffs(const std::vector<std::vector<ConstPlaintext>> &A, ConstCiphertext<DCRTPoly> ctxt) const
template<class Archive>
inline void save(Archive &ar) const
template<class Archive>
inline void load(Archive &ar)
inline std::string SerializedObjectName() const

Public Static Functions

static uint32_t GetBootstrapDepth(uint32_t approxModDepth, const std::vector<uint32_t> &levelBudget, SecretKeyDist secretKeyDist)
static uint32_t GetBootstrapDepth(const std::vector<uint32_t> &levelBudget, SecretKeyDist secretKeyDist)