PALISADE Lattice Crypto Library  1.11.9
A lattice crypto library for software engineers by software engineers.
Public Member Functions | Static Public Member Functions | List of all members
lbcrypto::LPCryptoParametersBGVrns< Element > Class Template Reference

Crypto parameters class for RLWE-based schemes. More...

#include <bgvrns.h>

Inheritance diagram for lbcrypto::LPCryptoParametersBGVrns< Element >:
Inheritance graph
[legend]
Collaboration diagram for lbcrypto::LPCryptoParametersBGVrns< Element >:
Collaboration graph
[legend]

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 BigIntegerGetAuxModulus () 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 NativeIntegerGetNegtInvModq (usint l) const
 
const NativeIntegerGetNegtInvModqPrecon (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
 

Detailed Description

template<class Element>
class lbcrypto::LPCryptoParametersBGVrns< Element >

Crypto parameters class for RLWE-based schemes.

Template Parameters
Elementa ring element.

Constructor & Destructor Documentation

◆ LPCryptoParametersBGVrns() [1/4]

template<class Element >
lbcrypto::LPCryptoParametersBGVrns< Element >::LPCryptoParametersBGVrns ( )
inline

Default Constructor.

◆ LPCryptoParametersBGVrns() [2/4]

template<class Element >
lbcrypto::LPCryptoParametersBGVrns< Element >::LPCryptoParametersBGVrns ( const LPCryptoParametersBGVrns< Element > &  rhs)
inline

Copy constructor.

Parameters
rhs- source

◆ LPCryptoParametersBGVrns() [3/4]

template<class Element >
lbcrypto::LPCryptoParametersBGVrns< Element >::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 
)
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.

Parameters
paramselement parameters.
&plaintextModulusplaintext modulus.
distributionParameternoise distribution parameter.
assuranceMeasureassurance level.
securityLevelsecurity level.
relinWindowthe size of the relinearization window.
modesets the mode of operation: RLWE or OPTIMIZED
depthdepth which is set to 1.
maxDepththe maximum power of secret key for which the relinearization key is generated
ksTechkey switching method
msMethodmod switch method

◆ LPCryptoParametersBGVrns() [4/4]

template<class Element >
lbcrypto::LPCryptoParametersBGVrns< Element >::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 
)
inline

Constructor that initializes values.

Parameters
paramselement parameters.
encodingParamsplaintext space parameters.
distributionParameternoise distribution parameter.
assuranceMeasureassurance level.
securityLevelsecurity level.
relinWindowthe size of the relinearization window.
modesets the mode of operation: RLWE or OPTIMIZED
depthdepth which is set to 1.
maxDepththe maximum power of secret key for which the relinearization key is generated
ksTechkey switching method
msMethodmod switch method

◆ ~LPCryptoParametersBGVrns()

template<class Element >
virtual lbcrypto::LPCryptoParametersBGVrns< Element >::~LPCryptoParametersBGVrns ( )
inlinevirtual

Destructor.

Member Function Documentation

◆ GetAuxModulus()

template<class Element >
const BigInteger& lbcrypto::LPCryptoParametersBGVrns< Element >::GetAuxModulus ( ) const
inline

Gets product P = p_j Used in GHS key switching

Returns
product p_j

◆ GetKeySwitchTechnique()

template<class Element >
enum KeySwitchTechnique lbcrypto::LPCryptoParametersBGVrns< Element >::GetKeySwitchTechnique ( ) const
inline

Method to retrieve the technique to be used for key switching.

Returns
the key switching technique.

◆ GetmodComplPartqBarrettMu()

template<class Element >
const vector<DoubleNativeInt>& lbcrypto::LPCryptoParametersBGVrns< Element >::GetmodComplPartqBarrettMu ( uint32_t  lvl,
uint32_t  part 
) const
inline

Barret multiplication precomputations getter.

Parameters
indexThe number of towers in the ciphertext.
Returns
the pre-computed values.

◆ GetModpBarrettMu()

template<class Element >
const vector<DoubleNativeInt>& lbcrypto::LPCryptoParametersBGVrns< Element >::GetModpBarrettMu ( ) const
inline

Gets the Barrett modulo reduction precomputation for p_j

Returns
the precomputed table

◆ GetModqBarrettMu()

template<class Element >
const vector<DoubleNativeInt>& lbcrypto::LPCryptoParametersBGVrns< Element >::GetModqBarrettMu ( ) const
inline

Gets the Barrett modulo reduction precomputation for q_i

Returns
the precomputed table

◆ GetModSwitchMethod()

template<class Element >
enum ModSwitchMethod lbcrypto::LPCryptoParametersBGVrns< Element >::GetModSwitchMethod ( ) const
inline

Method to retrieve the technique to be used for key switching.

Returns
the mod switching method.

◆ GetNegtInvModq()

template<class Element >
const NativeInteger& lbcrypto::LPCryptoParametersBGVrns< Element >::GetNegtInvModq ( usint  l) const
inline

Get the precomputed table of [-t^{-1}]_{q_i}

Returns
the pre-computed values.

◆ GetNegtInvModqPrecon()

template<class Element >
const NativeInteger& lbcrypto::LPCryptoParametersBGVrns< Element >::GetNegtInvModqPrecon ( usint  l) const
inline

Method that returns the NTL precomputions for [-t^{-1}]_{q_i}

Returns
the pre-computed values.

◆ GetNumPartQ()

template<class Element >
uint32_t lbcrypto::LPCryptoParametersBGVrns< Element >::GetNumPartQ ( ) const
inline

Method that returns the actual number of digits.

Returns
the number of digits.

◆ GetNumPerPartQ()

template<class Element >
uint32_t lbcrypto::LPCryptoParametersBGVrns< Element >::GetNumPerPartQ ( ) const
inline

Method that returns the number of towers within every digit. This is the alpha parameter from the paper (see documentation for KeySwitchHHybrid).

Returns
the number of towers per digit.

◆ GetParamsP()

template<class Element >
const shared_ptr<ILDCRTParams<BigInteger> > lbcrypto::LPCryptoParametersBGVrns< Element >::GetParamsP ( ) const
inline

Gets the Auxiliary CRT basis {P} = {p_1,...,p_k} Used in GHS key switching

Returns
the parameters CRT params

◆ GetParamsPartQ()

template<class Element >
const shared_ptr<ILDCRTParams<BigInteger> >& lbcrypto::LPCryptoParametersBGVrns< Element >::GetParamsPartQ ( uint32_t  j) const
inline

Method that returns the element parameters corresponding to partitions {Q_j} of Q.

Parameters
jis the number of the digit we want to get the list of towers for.
Returns
the pre-computed values.

◆ GetParamsQP()

template<class Element >
const shared_ptr<ILDCRTParams<BigInteger> > lbcrypto::LPCryptoParametersBGVrns< Element >::GetParamsQP ( ) const
inline

Gets Auxiliary expanded CRT basis Q*P = {q_1,...,q_l,p_1,...,p_k} Used in GHS key switching

Returns
the precomputed CRT params

◆ GetPartQHatInvModq()

template<class Element >
const vector<NativeInteger>& lbcrypto::LPCryptoParametersBGVrns< Element >::GetPartQHatInvModq ( uint32_t  part) const
inline

Get the precomputed table of [{Q/Q_j}^{-1}]_{q_i} Used in HYBRID key switching.

Returns
the pre-computed values.

◆ GetPartQHatModq()

template<class Element >
const vector<vector<NativeInteger> >& lbcrypto::LPCryptoParametersBGVrns< Element >::GetPartQHatModq ( ) const
inline

Get the precomputed table of [Q/Q_j]_{q_i} Used in HYBRID key switching.

Returns
the precomputed table

◆ GetPartQlHatInvModq()

template<class Element >
const vector<NativeInteger>& lbcrypto::LPCryptoParametersBGVrns< Element >::GetPartQlHatInvModq ( uint32_t  part,
uint32_t  sublvl 
) const
inline

Method that returns the precomputed values for QHat^-1 mod qj within a partition of towers, used in HYBRID.

Returns
the pre-computed values.

◆ GetPartQlHatInvModqPrecon()

template<class Element >
const vector<NativeInteger>& lbcrypto::LPCryptoParametersBGVrns< Element >::GetPartQlHatInvModqPrecon ( uint32_t  part,
uint32_t  sublvl 
) const
inline

Barret multiplication precomputations getter.

Parameters
indexThe number of towers in the ciphertext.
Returns
the pre-computed values.

◆ GetPartQlHatModp()

template<class Element >
const vector<vector<NativeInteger> >& lbcrypto::LPCryptoParametersBGVrns< Element >::GetPartQlHatModp ( uint32_t  lvl,
uint32_t  part 
) const
inline

Barret multiplication precomputations getter.

Parameters
indexThe table containing QHat mod pi.
Returns
the pre-computed values.

◆ GetPHatInvModp()

template<class Element >
const vector<NativeInteger>& lbcrypto::LPCryptoParametersBGVrns< Element >::GetPHatInvModp ( ) const
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.

Returns
the precomputed table

◆ GetPHatInvModpPrecon()

template<class Element >
const vector<NativeInteger>& lbcrypto::LPCryptoParametersBGVrns< Element >::GetPHatInvModpPrecon ( ) const
inline

Get the NTL precomputions for [(P/p_j)^{-1}]_{p_j}

Returns
the precomputed table

◆ GetPHatModq()

template<class Element >
const vector<vector<NativeInteger> >& lbcrypto::LPCryptoParametersBGVrns< Element >::GetPHatModq ( ) const
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.

Returns
the precomputed table

◆ GetPInvModq()

template<class Element >
const vector<NativeInteger>& lbcrypto::LPCryptoParametersBGVrns< Element >::GetPInvModq ( ) const
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.

Returns
the precomputed table

◆ GetPInvModqPrecon()

template<class Element >
const vector<NativeInteger>& lbcrypto::LPCryptoParametersBGVrns< Element >::GetPInvModqPrecon ( ) const
inline

Gets the NTL precomputions for [P^{-1}]_{q_i} Used for speeding up GHS key switching.

Returns
the precomputed table

◆ GetPModq()

template<class Element >
const vector<NativeInteger>& lbcrypto::LPCryptoParametersBGVrns< Element >::GetPModq ( ) const
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.

Returns
a vector holding (P mod q_j) for every j.

◆ GetQlHatInvModq()

template<class Element >
const vector<NativeInteger>& lbcrypto::LPCryptoParametersBGVrns< Element >::GetQlHatInvModq ( uint32_t  l) const
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.

Returns
the precomputed table

◆ GetQlHatInvModqPrecon()

template<class Element >
const vector<NativeInteger>& lbcrypto::LPCryptoParametersBGVrns< Element >::GetQlHatInvModqPrecon ( uint32_t  l) const
inline

Get the NTL precomputions for [(Q^(l)/q_i)^{-1}]_{q_i}

Returns
the precomputed table

◆ GetQlHatModp()

template<class Element >
const vector<vector<NativeInteger> >& lbcrypto::LPCryptoParametersBGVrns< Element >::GetQlHatModp ( uint32_t  l) const
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.

Returns
the precomputed table

◆ GetqlInvModq()

template<class Element >
const vector<NativeInteger>& lbcrypto::LPCryptoParametersBGVrns< Element >::GetqlInvModq ( usint  l) const
inline

Get the precomputed table of [q_l^{-1}]_{q_i}

Returns
the pre-computed values.

◆ GetqlInvModqPrecon()

template<class Element >
const vector<NativeInteger>& lbcrypto::LPCryptoParametersBGVrns< Element >::GetqlInvModqPrecon ( usint  l) const
inline

Method that returns the NTL precomputions for [q_l^{-1}]_{q_i}

Returns
the pre-computed values.

◆ GettInvModp()

template<class Element >
const vector<NativeInteger>& lbcrypto::LPCryptoParametersBGVrns< Element >::GettInvModp ( ) const
inline

Method that returns the precomputed values for [t^(-1)]_{p_j} Used in KeySwitching.

Returns
the pre-computed values.

◆ GettInvModpPrecon()

template<class Element >
const vector<NativeInteger>& lbcrypto::LPCryptoParametersBGVrns< Element >::GettInvModpPrecon ( ) const
inline

Method that returns the NTL precomputions for [t^{-1}]_{p_j}

Returns
the pre-computed values.

◆ GettInvModq()

template<class Element >
const vector<NativeInteger>& lbcrypto::LPCryptoParametersBGVrns< Element >::GettInvModq ( ) const
inline

Method that returns the precomputed values for [t^(-1)]_{q_i} Used in ModulusSwitching.

Returns
the pre-computed values.

◆ GettInvModqPrecon()

template<class Element >
const vector<NativeInteger>& lbcrypto::LPCryptoParametersBGVrns< Element >::GettInvModqPrecon ( ) const
inline

Method that returns the NTL precomputions for [t^{-1}]_{q_i}

Returns
the pre-computed values.

◆ GettModpPrecon()

template<class Element >
const vector<NativeInteger>& lbcrypto::LPCryptoParametersBGVrns< Element >::GettModpPrecon ( ) const
inline

Method that returns the NTL precomputions for [t]_{p_j}

Returns
the pre-computed values.

◆ GettModqPrecon()

template<class Element >
const vector<NativeInteger>& lbcrypto::LPCryptoParametersBGVrns< Element >::GettModqPrecon ( ) const
inline

Method that returns the NTL precomputions for [t]_{q_i}

Returns
the pre-computed values.

◆ operator==()

template<class Element >
bool lbcrypto::LPCryptoParametersBGVrns< Element >::operator== ( const LPCryptoParameters< Element > &  rhs) const
inlinevirtual

== operator to compare to this instance of LPCryptoParametersBGVrns object.

Parameters
&rhsLPCryptoParameters to check equality against.

Implements lbcrypto::LPCryptoParameters< Element >.

◆ PrecomputeCRTTables()

template<class Element >
bool lbcrypto::LPCryptoParametersBGVrns< Element >::PrecomputeCRTTables ( KeySwitchTechnique  ksTech,
uint32_t  numPartQ = 0 
)

Computes all tables needed for decryption, homomorphic multiplication, and key switching

Parameters
ksTechthe technique to use for key switching (e.g., BV or GHS).
numPartQnumber of Large digits
Returns
true on success

The documentation for this class was generated from the following file: