Class SchSwchParams

Page Contents

Class Documentation

class lbcrypto::SchSwchParams

Parameters of the CKKS to FHEW and FHEW to CKKS scheme switching setup (EvalCKKStoFHEWSetup, EvalSchemeSwitchingSetup and related calls)

The user-facing fields are set with the setters below. The fields marked as populated internally are filled from the CKKS cryptocontext by CryptoContextImpl::SetParamsFromCKKSCryptocontext(), and every getter throws an exception until that call has been made.

Public Functions

inline void SetSecurityLevelCKKS(SecurityLevel securityLevelCKKS0)

Sets the security level of the CKKS cryptocontext.

Parameters

securityLevelCKKS0 – security level of the CKKS cryptocontext

inline void SetSecurityLevelFHEW(BINFHE_PARAMSET securityLevelFHEW0)

Sets the FHEW/BinFHE parameter set (security level) of the FHEW cryptocontext.

Parameters

securityLevelFHEW0 – FHEW/BinFHE parameter set (security level) of the FHEW cryptocontext

inline void SetArbitraryFunctionEvaluation(bool arbitraryFunctionEvaluation0)

Sets whether the FHEW cryptocontext is created for arbitrary function evaluation.

Parameters

arbitraryFunctionEvaluation0 – true if the FHEW cryptocontext is created for arbitrary function evaluation

inline void SetUseDynamicModeFHEW(bool useDynamicModeFHEW0)

Sets whether the FHEW cryptocontext is generated in dynamic mode.

Parameters

useDynamicModeFHEW0 – true to generate the FHEW cryptocontext in dynamic mode

inline void SetComputeArgmin(bool computeArgmin0)

Sets whether the argmin computation (and its keys) should be supported.

Parameters

computeArgmin0 – true if the argmin computation (and its keys) should be supported

inline void SetOneHotEncoding(bool oneHotEncoding0)

Sets whether the argmin result is returned in one-hot encoding.

Parameters

oneHotEncoding0 – true to return the argmin result in one-hot encoding

inline void SetUseAltArgmin(bool useAltArgmin0)

Sets whether to use the alternative argmin version, which requires fewer automorphism keys.

Parameters

useAltArgmin0 – true to use the alternative argmin version, which requires fewer automorphism keys

inline void SetNumSlotsCKKS(uint32_t numSlotsCKKS0)

Sets the number of slots in the CKKS encryption.

Parameters

numSlotsCKKS0 – number of slots in the CKKS encryption

inline void SetNumValues(uint32_t numValues0)

Sets the number of values to switch.

Parameters

numValues0 – number of values to switch

inline void SetCtxtModSizeFHEWLargePrec(uint32_t ctxtModSizeFHEWLargePrec0)

Sets the bit size of the FHEW ciphertext modulus for large-precision evaluation.

Parameters

ctxtModSizeFHEWLargePrec0 – bit size of the FHEW ciphertext modulus for large-precision evaluation

inline void SetCtxtModSizeFHEWIntermedSwch(uint32_t ctxtModSizeFHEWIntermedSwch0)

Sets the bit size of the ciphertext modulus of the intermediate switch.

Parameters

ctxtModSizeFHEWIntermedSwch0 – bit size of the ciphertext modulus of the intermediate switch, chosen for security with the FHEW ring dimension

inline void SetBStepLTrCKKStoFHEW(uint32_t bStepLTrCKKStoFHEW0)

Sets the baby-step of the linear transform in the CKKS to FHEW switching.

Parameters

bStepLTrCKKStoFHEW0 – baby-step of the linear transform in the CKKS to FHEW switching (0 selects the default)

inline void SetBStepLTrFHEWtoCKKS(uint32_t bStepLTrFHEWtoCKKS0)

Sets the baby-step of the linear transform in the FHEW to CKKS switching.

Parameters

bStepLTrFHEWtoCKKS0 – baby-step of the linear transform in the FHEW to CKKS switching (0 selects the default)

inline void SetLevelLTrCKKStoFHEW(uint32_t levelLTrCKKStoFHEW0)

Sets the level at which the linear transform of the CKKS to FHEW switching is performed.

Parameters

levelLTrCKKStoFHEW0 – level at which the linear transform of the CKKS to FHEW switching is performed

inline void SetLevelLTrFHEWtoCKKS(uint32_t levelLTrFHEWtoCKKS0)

Sets the level at which the linear transform of the FHEW to CKKS switching is performed.

Parameters

levelLTrFHEWtoCKKS0 – level at which the linear transform of the FHEW to CKKS switching is performed

inline void SetParamsFromCKKSCryptocontextCalled()

Marks the object as populated from the CKKS cryptocontext, which unlocks the getters. Called by CryptoContextImpl::SetParamsFromCKKSCryptocontext().

inline void SetInitialCKKSModulus(NativeInteger initialCKKSModulus0)

Sets the first modulus of the CKKS cryptocontext. Populated internally from the CKKS cryptocontext; not meant to be set by the user.

Parameters

initialCKKSModulus0 – first (largest-level) modulus of the CKKS cryptocontext

inline void SetRingDimension(uint32_t ringDimension0)

Sets the ring dimension of the CKKS cryptocontext. Populated internally from the CKKS cryptocontext; not meant to be set by the user.

Parameters

ringDimension0 – ring dimension of the CKKS cryptocontext

inline void SetScalingModSize(uint32_t scalingModSize0)

Sets the bit size of the CKKS scaling modulus. Populated internally from the CKKS cryptocontext; not meant to be set by the user.

Parameters

scalingModSize0 – bit size of the CKKS scaling modulus

inline void SetBatchSize(uint32_t batchSize0)

Sets the batch size of the CKKS cryptocontext. Populated internally from the CKKS cryptocontext; not meant to be set by the user.

Parameters

batchSize0 – batch size of the CKKS cryptocontext

inline SecurityLevel GetSecurityLevelCKKS() const

Returns the security level of the CKKS cryptocontext. Throws an exception if SetParamsFromCKKSCryptocontext() has not been called.

Returns

the security level of the CKKS cryptocontext

inline BINFHE_PARAMSET GetSecurityLevelFHEW() const

Returns the FHEW parameter set. Throws an exception if SetParamsFromCKKSCryptocontext() has not been called.

Returns

the FHEW parameter set

inline bool GetArbitraryFunctionEvaluation() const

Returns whether the FHEW cryptocontext is created for arbitrary function evaluation. Throws an exception if SetParamsFromCKKSCryptocontext() has not been called.

Returns

whether the FHEW cryptocontext is created for arbitrary function evaluation

inline bool GetUseDynamicModeFHEW() const

Returns whether the FHEW cryptocontext is generated in dynamic mode. Throws an exception if SetParamsFromCKKSCryptocontext() has not been called.

Returns

whether the FHEW cryptocontext is generated in dynamic mode

inline bool GetComputeArgmin() const

Returns whether the argmin computation is supported. Throws an exception if SetParamsFromCKKSCryptocontext() has not been called.

Returns

whether the argmin computation is supported

inline bool GetOneHotEncoding() const

Returns whether the argmin result is returned in one-hot encoding. Throws an exception if SetParamsFromCKKSCryptocontext() has not been called.

Returns

whether the argmin result is returned in one-hot encoding

inline bool GetUseAltArgmin() const

Returns whether the alternative argmin version is used. Throws an exception if SetParamsFromCKKSCryptocontext() has not been called.

Returns

whether the alternative argmin version is used

inline uint32_t GetNumSlotsCKKS() const

Returns the number of slots in the CKKS encryption. Throws an exception if SetParamsFromCKKSCryptocontext() has not been called.

Returns

the number of slots in the CKKS encryption

inline uint32_t GetNumValues() const

Returns the number of values to switch. Throws an exception if SetParamsFromCKKSCryptocontext() has not been called.

Returns

the number of values to switch

inline uint32_t GetCtxtModSizeFHEWLargePrec() const

Returns the bit size of the FHEW ciphertext modulus for large-precision evaluation. Throws an exception if SetParamsFromCKKSCryptocontext() has not been called.

Returns

the bit size of the FHEW ciphertext modulus for large-precision evaluation

inline uint32_t GetCtxtModSizeFHEWIntermedSwch() const

Returns the bit size of the intermediate-switch ciphertext modulus. Throws an exception if SetParamsFromCKKSCryptocontext() has not been called.

Returns

the bit size of the intermediate-switch ciphertext modulus

inline uint32_t GetBStepLTrCKKStoFHEW() const

Returns the baby-step of the CKKS to FHEW linear transform. Throws an exception if SetParamsFromCKKSCryptocontext() has not been called.

Returns

the baby-step of the CKKS to FHEW linear transform

inline uint32_t GetBStepLTrFHEWtoCKKS() const

Returns the baby-step of the FHEW to CKKS linear transform. Throws an exception if SetParamsFromCKKSCryptocontext() has not been called.

Returns

the baby-step of the FHEW to CKKS linear transform

inline uint32_t GetLevelLTrCKKStoFHEW() const

Returns the level of the CKKS to FHEW linear transform. Throws an exception if SetParamsFromCKKSCryptocontext() has not been called.

Returns

the level of the CKKS to FHEW linear transform

inline uint32_t GetLevelLTrFHEWtoCKKS() const

Returns the level of the FHEW to CKKS linear transform. Throws an exception if SetParamsFromCKKSCryptocontext() has not been called.

Returns

the level of the FHEW to CKKS linear transform

inline NativeInteger GetInitialCKKSModulus() const

Returns the first modulus of the CKKS cryptocontext. Throws an exception if SetParamsFromCKKSCryptocontext() has not been called.

Returns

the first modulus of the CKKS cryptocontext

inline uint32_t GetRingDimension() const

Returns the CKKS ring dimension. Throws an exception if SetParamsFromCKKSCryptocontext() has not been called.

Returns

the CKKS ring dimension

inline uint32_t GetScalingModSize() const

Returns the bit size of the CKKS scaling modulus. Throws an exception if SetParamsFromCKKSCryptocontext() has not been called.

Returns

the bit size of the CKKS scaling modulus

inline uint32_t GetBatchSize() const

Returns the CKKS batch size. Throws an exception if SetParamsFromCKKSCryptocontext() has not been called.

Returns

the CKKS batch size

Friends

friend std::ostream &operator<<(std::ostream &s, const SchSwchParams &obj)

Prints all parameter values, including the ones populated from the CKKS cryptocontext.

Parameters
  • s – the output stream

  • obj – the parameter object to print

Returns

the output stream