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 <bgvrns.h>
Public Member Functions | |
LPCryptoParametersBGVrns () | |
LPCryptoParametersBGVrns (const LPCryptoParametersBGVrns &rhs) | |
LPCryptoParametersBGVrns (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, ModSwitchMethod msMethod=MANUAL) | |
LPCryptoParametersBGVrns (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, ModSwitchMethod msMethod=MANUAL) | |
virtual | ~LPCryptoParametersBGVrns () |
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, uint32_t numPartQ=0) |
bool | operator== (const LPCryptoParameters< Element > &rhs) const |
void | PrintParameters (std::ostream &os) 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 ModSwitchMethod | GetModSwitchMethod () const |
const vector< vector< NativeInteger > > & | GetPartQHatModq () const |
const shared_ptr< ILDCRTParams< BigInteger > > & | GetParamsPartQ (uint32_t j) 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 |
const vector< NativeInteger > & | GettInvModq () const |
const vector< NativeInteger > & | GettModqPrecon () const |
const vector< NativeInteger > & | GettInvModqPrecon () const |
const vector< NativeInteger > & | GettInvModp () const |
const vector< NativeInteger > & | GettModpPrecon () const |
const vector< NativeInteger > & | GettInvModpPrecon () const |
const NativeInteger & | GetNegtInvModq (usint l) const |
const NativeInteger & | GetNegtInvModqPrecon (usint l) const |
const vector< NativeInteger > & | GetqlInvModq (usint l) const |
const vector< NativeInteger > & | GetqlInvModqPrecon (usint l) const |
template<> | |
bool | PrecomputeCRTTables (KeySwitchTechnique ksTech, uint32_t dnum) |
template<> | |
bool | PrecomputeCRTTables (KeySwitchTechnique ksTech, uint32_t dnum) |
template<> | |
bool | PrecomputeCRTTables (KeySwitchTechnique ksTech, 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 |
msMethod | mod switch 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 |
msMethod | mod switch 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 |
Barret 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 technique to be used for key switching.
|
inline |
Get the precomputed table of [-t^{-1}]_{q_i}
|
inline |
Method that returns the NTL precomputions for [-t^{-1}]_{q_i}
|
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 |
Get the precomputed table of [{Q/Q_j}^{-1}]_{q_i} Used in HYBRID key switching.
|
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 |
Barret multiplication precomputations getter.
index | The number of towers in the ciphertext. |
|
inline |
Barret multiplication precomputations getter.
index | The table containing QHat mod pi. |
|
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 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 |
Get the precomputed table of [q_l^{-1}]_{q_i}
|
inline |
Method that returns the NTL precomputions for [q_l^{-1}]_{q_i}
|
inline |
Method that returns the precomputed values for [t^(-1)]_{p_j} Used in KeySwitching.
|
inline |
Method that returns the NTL precomputions for [t^{-1}]_{p_j}
|
inline |
Method that returns the precomputed values for [t^(-1)]_{q_i} Used in ModulusSwitching.
|
inline |
Method that returns the NTL precomputions for [t^{-1}]_{q_i}
|
inline |
Method that returns the NTL precomputions for [t]_{p_j}
|
inline |
Method that returns the NTL precomputions for [t]_{q_i}
|
inlinevirtual |
== operator to compare to this instance of LPCryptoParametersBGVrns object.
&rhs | LPCryptoParameters to check equality against. |
Implements lbcrypto::LPCryptoParameters< Element >.
bool lbcrypto::LPCryptoParametersBGVrns< Element >::PrecomputeCRTTables | ( | KeySwitchTechnique | ksTech, |
uint32_t | numPartQ = 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). |
numPartQ | number of Large digits |