PALISADE Lattice Crypto Library
1.11.9
A lattice crypto library for software engineers by software engineers.
|
Crypto parameters class for RLWE-based schemes. More...
#include <ckks.h>
Public Member Functions | |
LPCryptoParametersCKKS () | |
LPCryptoParametersCKKS (const LPCryptoParametersCKKS &rhs) | |
LPCryptoParametersCKKS (shared_ptr< ParmType > params, const PlaintextModulus &plaintextModulus, float distributionParameter, float assuranceMeasure, float securityLevel, usint relinWindow, MODE mode, int depth=1, int maxDepth=2, KeySwitchTechnique ksTech=BV, RescalingTechnique rsTech=APPROXRESCALE) | |
LPCryptoParametersCKKS (shared_ptr< ParmType > params, EncodingParams encodingParams, float distributionParameter, float assuranceMeasure, float securityLevel, usint relinWindow, MODE mode, int depth=1, int maxDepth=2, KeySwitchTechnique ksTech=BV, RescalingTechnique rsTech=APPROXRESCALE) | |
virtual | ~LPCryptoParametersCKKS () |
template<class Archive > | |
void | save (Archive &ar, std::uint32_t const version) const |
template<class Archive > | |
void | load (Archive &ar, std::uint32_t const version) |
std::string | SerializedObjectName () const |
bool | PrecomputeCRTTables (KeySwitchTechnique ksTech, RescalingTechnique rsTech, uint32_t numLargeDigits=0) |
bool | operator== (const LPCryptoParameters< Element > &rhs) const |
void | PrintParameters (std::ostream &os) const |
const std::vector< NativeInteger > & | GetQlQlInvModqlDivqlModq (size_t i) const |
const std::vector< NativeInteger > & | GetQlQlInvModqlDivqlModqPrecon (size_t i) const |
const std::vector< NativeInteger > & | GetqInvModq (size_t i) const |
const std::vector< NativeInteger > & | GetqInvModqPrecon (size_t i) const |
const shared_ptr< ILDCRTParams< BigInteger > > | GetParamsP () const |
const BigInteger & | GetAuxModulus () const |
const shared_ptr< ILDCRTParams< BigInteger > > | GetParamsQP () const |
const vector< NativeInteger > & | GetPInvModq () const |
const vector< NativeInteger > & | GetPInvModqPrecon () const |
const vector< NativeInteger > & | GetPHatInvModp () const |
const vector< NativeInteger > & | GetPHatInvModpPrecon () const |
const vector< NativeInteger > & | GetQlHatInvModq (uint32_t l) const |
const vector< NativeInteger > & | GetQlHatInvModqPrecon (uint32_t l) const |
const vector< vector< NativeInteger > > & | GetPHatModq () const |
const vector< vector< NativeInteger > > & | GetQlHatModp (uint32_t l) const |
const vector< NativeInteger > & | GetPModq () const |
const vector< DoubleNativeInt > & | GetModqBarrettMu () const |
const vector< DoubleNativeInt > & | GetModpBarrettMu () const |
enum KeySwitchTechnique | GetKeySwitchTechnique () const |
enum RescalingTechnique | GetRescalingTechnique () const |
double | GetScalingFactorOfLevel (uint32_t l=0) const |
double | GetModReduceFactor (uint32_t l=0) const |
const vector< vector< NativeInteger > > & | GetPartQHatModq () const |
const shared_ptr< ILDCRTParams< BigInteger > > & | GetParamsPartQ (uint32_t part) const |
const shared_ptr< ILDCRTParams< BigInteger > > & | GetParamsComplPartQ (uint32_t numTowers, uint32_t digit) const |
uint32_t | GetNumberOfQPartitions () const |
const vector< NativeInteger > & | GetPartQHatInvModq (uint32_t part) const |
uint32_t | GetNumPartQ () const |
uint32_t | GetNumPerPartQ () const |
const vector< NativeInteger > & | GetPartQlHatInvModq (uint32_t part, uint32_t sublvl) const |
const vector< NativeInteger > & | GetPartQlHatInvModqPrecon (uint32_t part, uint32_t sublvl) const |
const vector< vector< NativeInteger > > & | GetPartQlHatModp (uint32_t lvl, uint32_t part) const |
const vector< DoubleNativeInt > & | GetmodComplPartqBarrettMu (uint32_t lvl, uint32_t part) const |
template<> | |
bool | PrecomputeCRTTables (KeySwitchTechnique ksTech, RescalingTechnique rsTech, uint32_t dnum) |
template<> | |
bool | PrecomputeCRTTables (KeySwitchTechnique ksTech, RescalingTechnique rsTech, uint32_t dnum) |
template<> | |
bool | PrecomputeCRTTables (KeySwitchTechnique ksTech, RescalingTechnique rsTech, uint32_t numLargeDigits) |
Public Member Functions inherited from lbcrypto::LPCryptoParametersRLWE< Element > | |
LPCryptoParametersRLWE () | |
LPCryptoParametersRLWE (const LPCryptoParametersRLWE &rhs) | |
LPCryptoParametersRLWE (shared_ptr< typename Element::Params > params, EncodingParams encodingParams, float distributionParameter, float assuranceMeasure, float securityLevel, usint relinWindow, int depth=1, int maxDepth=2, MODE mode=RLWE) | |
LPCryptoParametersRLWE (shared_ptr< typename Element::Params > params, EncodingParams encodingParams, float distributionParameter, float assuranceMeasure, SecurityLevel stdLevel, usint relinWindow, int depth=1, int maxDepth=2, MODE mode=RLWE) | |
virtual | ~LPCryptoParametersRLWE () |
float | GetDistributionParameter () const |
float | GetAssuranceMeasure () const |
float | GetSecurityLevel () const |
usint | GetRelinWindow () const |
int | GetDepth () const |
size_t | GetMaxDepth () const |
MODE | GetMode () const |
SecurityLevel | GetStdLevel () const |
const Element::DggType & | GetDiscreteGaussianGenerator () const |
void | SetDistributionParameter (float distributionParameter) |
void | SetAssuranceMeasure (float assuranceMeasure) |
void | SetSecurityLevel (float securityLevel) |
void | SetStdLevel (SecurityLevel securityLevel) |
void | SetRelinWindow (usint relinWindow) |
void | SetDepth (int depth) |
void | SetMaxDepth (size_t maxDepth) |
void | SetMode (MODE mode) |
bool | operator== (const LPCryptoParameters< Element > &rhs) const |
void | PrintParameters (std::ostream &os) const |
template<class Archive > | |
void | save (Archive &ar, std::uint32_t const version) const |
template<class Archive > | |
void | load (Archive &ar, std::uint32_t const version) |
std::string | SerializedObjectName () const |
Public Member Functions inherited from lbcrypto::LPCryptoParameters< Element > | |
virtual const PlaintextModulus & | GetPlaintextModulus () const |
virtual const shared_ptr< typename Element::Params > | GetElementParams () const |
virtual const EncodingParams | GetEncodingParams () const |
virtual void | SetPlaintextModulus (const PlaintextModulus &plaintextModulus) |
virtual bool | operator!= (const LPCryptoParameters< Element > &cmp) const |
virtual void | SetElementParams (shared_ptr< typename Element::Params > params) |
virtual void | SetEncodingParams (EncodingParams encodingParams) |
template<class Archive > | |
void | save (Archive &ar, std::uint32_t const version) const |
template<class Archive > | |
void | load (Archive &ar, std::uint32_t const version) |
Static Public Member Functions | |
static uint32_t | SerializedVersion () |
Static Public Member Functions inherited from lbcrypto::LPCryptoParameters< Element > | |
static uint32_t | SerializedVersion () |
Additional Inherited Members | |
Protected Member Functions inherited from lbcrypto::LPCryptoParameters< Element > | |
LPCryptoParameters (const PlaintextModulus &plaintextModulus) | |
LPCryptoParameters (shared_ptr< typename Element::Params > params, const PlaintextModulus &plaintextModulus) | |
LPCryptoParameters (shared_ptr< typename Element::Params > params, EncodingParams encodingParams) | |
LPCryptoParameters (LPCryptoParameters< Element > *from, shared_ptr< typename Element::Params > newElemParms) | |
Protected Attributes inherited from lbcrypto::LPCryptoParametersRLWE< Element > | |
float | m_distributionParameter |
float | m_assuranceMeasure |
float | m_securityLevel |
usint | m_relinWindow |
int | m_depth |
uint32_t | m_maxDepth |
MODE | m_mode |
SecurityLevel | m_stdLevel |
Element::DggType | m_dgg |
Crypto parameters class for RLWE-based schemes.
Element | a ring element. |
|
inline |
Default Constructor.
|
inline |
Copy constructor.
rhs | - source |
|
inline |
Constructor that initializes values. Note that it is possible to set parameters in a way that is overall infeasible for actual use. There are fewer degrees of freedom than parameters provided. Typically one chooses the basic noise, assurance and security parameters as the typical community-accepted values, then chooses the plaintext modulus and depth as needed. The element parameters should then be choosen to provide correctness and security. In some cases we would need to operate over already encrypted/provided ciphertext and the depth needs to be pre-computed for initial settings.
params | element parameters. |
&plaintextModulus | plaintext modulus. |
distributionParameter | noise distribution parameter. |
assuranceMeasure | assurance level. |
securityLevel | security level. |
relinWindow | the size of the relinearization window. |
mode | sets the mode of operation: RLWE or OPTIMIZED |
depth | depth which is set to 1. |
maxDepth | the maximum power of secret key for which the relinearization key is generated |
ksTech | key switching method |
rsTech | rescaling method |
|
inline |
Constructor that initializes values.
params | element parameters. |
encodingParams | plaintext space parameters. |
distributionParameter | noise distribution parameter. |
assuranceMeasure | assurance level. |
securityLevel | security level. |
relinWindow | the size of the relinearization window. |
mode | sets the mode of operation: RLWE or OPTIMIZED |
depth | depth which is set to 1. |
maxDepth | the maximum power of secret key for which the relinearization key is generated |
ksTech | key switching method |
rsTech | rescaling method |
|
inlinevirtual |
Destructor.
|
inline |
Gets product P = p_j Used in GHS key switching
|
inline |
Method to retrieve the technique to be used for key switching.
|
inline |
Barrett multiplication precomputations getter.
index | The number of towers in the ciphertext. |
|
inline |
Gets the Barrett modulo reduction precomputation for p_j
|
inline |
Gets the Barrett modulo reduction precomputation for q_i
|
inline |
Method to retrieve the modulus to be dropped of level l. For APPROXRESCALE rescaling technique method always returns 2^p, where p corresponds to plaintext modulus
l | index of modulus to be dropped for EXACTRESCALE rescaling technique |
|
inline |
Method that returns the actual number of digits.
|
inline |
Method that returns the number of towers within every digit. This is the alpha parameter from the paper (see documentation for KeySwitchHHybrid).
|
inline |
Gets the Auxiliary CRT basis {P} = {p_1,...,p_k} Used in GHS key switching
|
inline |
Method that returns the element parameters corresponding to partitions {Q_j} of Q.
j | is the number of the digit we want to get the list of towers for. |
|
inline |
Gets Auxiliary expanded CRT basis Q*P = {q_1,...,q_l,p_1,...,p_k} Used in GHS key switching
|
inline |
Method that returns the precomputed values for QHat^-1 mod qj, used in HYBRID.
|
inline |
Get the precomputed table of [Q/Q_j]_{q_i} Used in HYBRID key switching.
|
inline |
Method that returns the precomputed values for QHat^-1 mod qj within a partition of towers, used in HYBRID.
|
inline |
Barrett multiplication precomputations getter.
index | The number of towers in the ciphertext. |
|
inline |
Barrett multiplication precomputations getter.
index | The table containing [PartQHat]_{p_j} |
|
inline |
Get the precomputed table of [(P/p_j)^{-1}]_{p_j} Used in GHS key switching.
See more in "A full RNS variant of approximate homomorphic encryption" by Cheon, et. al. Section 4.
|
inline |
Get the NTL precomputions for [(P/p_j)^{-1}]_{p_j}
|
inline |
Gets the precomputed table of [P/p_j]_{q_i} Used in GHS key switching.
See more in "A full RNS variant of approximate homomorphic encryption" by Cheon, et. al. Section 4.
|
inline |
Gets the precomputed table of [P^{-1}]_{q_i} Used in GHS key switching
See more in "A full RNS variant of approximate homomorphic encryption" by Cheon, et. al. Section 4.
|
inline |
Gets the NTL precomputions for [P^{-1}]_{q_i} Used for speeding up GHS key switching.
|
inline |
Gets the precomputed table of [P]_{q_i} Used in GHS key switching.
See more in "A full RNS variant of approximate homomorphic encryption" by Cheon, et. al. Section 4.
|
inline |
Gets the precomputed table of [q_i^{-1}]_{q_j}
|
inline |
Gets the NTL precomputions for [q_i^{-1}]_{q_j}
|
inline |
Gets the leveled precomputed table of [(Q^(l)/q_i)^{-1}]_{q_i} Used in GHS key switching.
See more in "A full RNS variant of approximate homomorphic encryption" by Cheon, et. al. Section 4.
|
inline |
Get the NTL precomputions for [(Q^(l)/q_i)^{-1}]_{q_i}
|
inline |
Gets the leveled precomputed table of [Q^(l)/q_i]_{p_j} Used in GHS key switching.
See more in "A full RNS variant of approximate homomorphic encryption" by Cheon, et. al. Section 4.
|
inline |
Q^(l) = {j=0}^{l-1} Gets the precomputed table of [Q^(l)*[Q^(l)^{-1}]_{q_l}/q_l]_{q_i}
|
inline |
Q^(l) = {j=0}^{l-1} Gets the NTL precomputions for [Q^(l)*[Q^(l)^{-1}]_{q_l}/q_l]_{q_i}
|
inline |
Method to retrieve the technique to be used for rescaling.
|
inline |
Method to retrieve the scaling factor of level l. For APPROXRESCALE rescaling technique method always returns 2^p, where p corresponds to plaintext modulus
l | For EXACTRESCALE rescaling technique the level whose scaling factor we want to learn. Levels start from 0 (no rescaling done - all towers) and go up to K-1, where K is the number of towers supported. |
|
inlinevirtual |
== operator to compare to this instance of LPCryptoParametersCKKS object.
&rhs | LPCryptoParameters to check equality against. |
Implements lbcrypto::LPCryptoParameters< Element >.
bool lbcrypto::LPCryptoParametersCKKS< Element >::PrecomputeCRTTables | ( | KeySwitchTechnique | ksTech, |
RescalingTechnique | rsTech, | ||
uint32_t | numLargeDigits = 0 |
||
) |
Computes all tables needed for decryption, homomorphic multiplication, and key switching
ksTech | the technique to use for key switching (e.g., BV or GHS). |
rsTech | the technique to use for rescaling (e.g., EXACTRESCALE or APPROXRESCALE). |