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::LPCryptoParametersBFV< Element > Class Template Reference

This is the parameters class for the BFV encryption scheme. This scheme is also referred to as the FV scheme. More...

#include <bfv.h>

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

Public Member Functions

 LPCryptoParametersBFV ()
 
 LPCryptoParametersBFV (const LPCryptoParametersBFV &rhs)
 
 LPCryptoParametersBFV (shared_ptr< ParmType > params, const PlaintextModulus &plaintextModulus, float distributionParameter, float assuranceMeasure, float securityLevel, usint relinWindow, const IntType &delta=IntType(0), MODE mode=RLWE, const IntType &bigModulus=IntType(0), const IntType &bigRootOfUnity=IntType(0), const IntType &bigModulusArb=IntType(0), const IntType &bigRootOfUnityArb=IntType(0), int depth=1, int maxDepth=2)
 
 LPCryptoParametersBFV (shared_ptr< ParmType > params, EncodingParams encodingParams, float distributionParameter, float assuranceMeasure, float securityLevel, usint relinWindow, const IntType &delta=IntType(0), MODE mode=RLWE, const IntType &bigModulus=IntType(0), const IntType &bigRootOfUnity=IntType(0), const IntType &bigModulusArb=IntType(0), const IntType &bigRootOfUnityArb=IntType(0), int depth=1, int maxDepth=2)
 
 LPCryptoParametersBFV (shared_ptr< ParmType > params, EncodingParams encodingParams, float distributionParameter, float assuranceMeasure, SecurityLevel securityLevel, usint relinWindow, const IntType &delta=IntType(0), MODE mode=RLWE, const IntType &bigModulus=IntType(0), const IntType &bigRootOfUnity=IntType(0), const IntType &bigModulusArb=IntType(0), const IntType &bigRootOfUnityArb=IntType(0), int depth=1, int maxDepth=2)
 
virtual ~LPCryptoParametersBFV ()
 
const IntType & GetDelta () const
 
const IntType & GetBigModulus () const
 
const IntType & GetBigRootOfUnity () const
 
const IntType & GetBigModulusArb () const
 
const IntType & GetBigRootOfUnityArb () const
 
void SetDelta (const IntType &delta)
 
void SetBigModulus (const IntType &bigModulus)
 
void SetBigRootOfUnity (const IntType &bigRootOfUnity)
 
void SetBigModulusArb (const IntType &bigModulusArb)
 
void SetBigRootOfUnityArb (const IntType &bigRootOfUnityArb)
 
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
 
template<>
 LPCryptoParametersBFV (const LPCryptoParametersBFV &rhs)
 
template<>
 LPCryptoParametersBFV (shared_ptr< ParmType > params, const PlaintextModulus &plaintextModulus, float distributionParameter, float assuranceMeasure, float securityLevel, usint relinWindow, const BigInteger &delta, MODE mode, const BigInteger &bigModulus, const BigInteger &bigRootOfUnity, const BigInteger &bigModulusArb, const BigInteger &bigRootOfUnityArb, int depth, int maxDepth)
 
template<>
 LPCryptoParametersBFV (shared_ptr< ParmType > params, EncodingParams encodingParams, float distributionParameter, float assuranceMeasure, float securityLevel, usint relinWindow, const BigInteger &delta, MODE mode, const BigInteger &bigModulus, const BigInteger &bigRootOfUnity, const BigInteger &bigModulusArb, const BigInteger &bigRootOfUnityArb, int depth, int maxDepth)
 
- 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::LPCryptoParametersBFV< Element >

This is the parameters class for the BFV encryption scheme. This scheme is also referred to as the FV scheme.

The BFV scheme parameter guidelines are introduced here:

We used the optimized parameter selection from the designs here:

Template Parameters
Elementa ring element type.

Constructor & Destructor Documentation

◆ LPCryptoParametersBFV() [1/5]

template<class Element >
lbcrypto::LPCryptoParametersBFV< Element >::LPCryptoParametersBFV ( )

Default constructor.

◆ LPCryptoParametersBFV() [2/5]

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

Copy constructor.

Parameters
rhs- source

◆ LPCryptoParametersBFV() [3/5]

template<class Element >
lbcrypto::LPCryptoParametersBFV< Element >::LPCryptoParametersBFV ( shared_ptr< ParmType >  params,
const PlaintextModulus &  plaintextModulus,
float  distributionParameter,
float  assuranceMeasure,
float  securityLevel,
usint  relinWindow,
const IntType &  delta = IntType(0),
MODE  mode = RLWE,
const IntType &  bigModulus = IntType(0),
const IntType &  bigRootOfUnity = IntType(0),
const IntType &  bigModulusArb = IntType(0),
const IntType &  bigRootOfUnityArb = IntType(0),
int  depth = 1,
int  maxDepth = 2 
)

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. This will depend on the specific class of element being used.
&plaintextModulusPlaintext modulus, typically denoted as p in most publications.
distributionParameterNoise distribution parameter, typically denoted as /sigma in most publications. Community standards typically call for a value of 3 to 6. Lower values provide more room for computation while larger values provide more security.
assuranceMeasureAssurance level, typically denoted as w in most applications. This is oftern perceived as a fudge factor in the literature, with a typical value of 9.
securityLevelSecurity level as Root Hermite Factor. We use the Root Hermite Factor representation of the security level to better conform with US ITAR and EAR export regulations. This is typically represented as /delta in the literature. Typically a Root Hermite Factor of 1.006 or less provides reasonable security for RLWE crypto schemes.
relinWindowThe size of the relinearization window. This is relevant when using this scheme for proxy re-encryption, and the value is denoted as r in the literature.
deltaBFV-specific factor that is multiplied by the plaintext polynomial.
modemode for secret polynomial, defaults to RLWE.
bigModulusmodulus used in polynomial multiplications in EvalMult
bigRootOfUnityroot of unity for bigModulus
bigModulusArbmodulus used in polynomial multiplications in EvalMult (for arbitrary cyclotomics)
bigRootOfUnityArbroot of unity for bigModulus (for arbitrary cyclotomics)
depthis the depth of computation circuit supported for these parameters (not used now; for future use).
maxDepththe maximum power of secret key for which the relinearization key is generated

◆ LPCryptoParametersBFV() [4/5]

template<class Element >
lbcrypto::LPCryptoParametersBFV< Element >::LPCryptoParametersBFV ( shared_ptr< ParmType >  params,
EncodingParams  encodingParams,
float  distributionParameter,
float  assuranceMeasure,
float  securityLevel,
usint  relinWindow,
const IntType &  delta = IntType(0),
MODE  mode = RLWE,
const IntType &  bigModulus = IntType(0),
const IntType &  bigRootOfUnity = IntType(0),
const IntType &  bigModulusArb = IntType(0),
const IntType &  bigRootOfUnityArb = IntType(0),
int  depth = 1,
int  maxDepth = 2 
)

Constructor that initializes values.

Parameters
&paramselement parameters.
&encodingParamsplaintext space parameters.
distributionParameternoise distribution parameter.
assuranceMeasureassurance level. = BigInteger::ZERO
securityLevelsecurity level (root Hermite factor).
relinWindowthe size of the relinearization window.
deltaBFV-specific factor that is multiplied by the plaintext polynomial.
modemode for secret polynomial, defaults to RLWE.
bigModulusmodulus used in polynomial multiplications in EvalMult
bigRootOfUnityroot of unity for bigModulus
bigModulusArbmodulus used in polynomial multiplications in EvalMult (arbitrary cyclotomics)
bigRootOfUnityArbroot of unity for bigModulus (arbitrary cyclotomics)
depthis the depth of computation circuit supported for these parameters (not used now; for future use).
maxDepththe maximum power of secret key for which the relinearization key is generated

◆ LPCryptoParametersBFV() [5/5]

template<class Element >
lbcrypto::LPCryptoParametersBFV< Element >::LPCryptoParametersBFV ( shared_ptr< ParmType >  params,
EncodingParams  encodingParams,
float  distributionParameter,
float  assuranceMeasure,
SecurityLevel  securityLevel,
usint  relinWindow,
const IntType &  delta = IntType(0),
MODE  mode = RLWE,
const IntType &  bigModulus = IntType(0),
const IntType &  bigRootOfUnity = IntType(0),
const IntType &  bigModulusArb = IntType(0),
const IntType &  bigRootOfUnityArb = IntType(0),
int  depth = 1,
int  maxDepth = 2 
)

Constructor that initializes values.

Parameters
&paramselement parameters.
&encodingParamsplaintext space parameters.
distributionParameternoise distribution parameter.
assuranceMeasureassurance level. = BigInteger::ZERO
securityLevelstandard security level.
relinWindowthe size of the relinearization window.
deltaBFV-specific factor that is multiplied by the plaintext polynomial.
modemode for secret polynomial, defaults to RLWE.
bigModulusmodulus used in polynomial multiplications in EvalMult
bigRootOfUnityroot of unity for bigModulus
bigModulusArbmodulus used in polynomial multiplications in EvalMult (arbitrary cyclotomics)
bigRootOfUnityArbroot of unity for bigModulus (arbitrary cyclotomics)
depthis the depth of computation circuit supported for these parameters (not used now; for future use).
maxDepththe maximum power of secret key for which the relinearization key is generated

◆ ~LPCryptoParametersBFV()

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

Destructor

Member Function Documentation

◆ GetBigModulus()

template<class Element >
const IntType& lbcrypto::LPCryptoParametersBFV< Element >::GetBigModulus ( ) const
inline

Gets the modulus used for polynomial multiplications in EvalMult

Returns
the modulus value.

◆ GetBigModulusArb()

template<class Element >
const IntType& lbcrypto::LPCryptoParametersBFV< Element >::GetBigModulusArb ( ) const
inline

Gets the modulus used for polynomial multiplications in EvalMult (arbitrary cyclotomics)

Returns
the modulus value.

◆ GetBigRootOfUnity()

template<class Element >
const IntType& lbcrypto::LPCryptoParametersBFV< Element >::GetBigRootOfUnity ( ) const
inline

Gets the primitive root of unity used for polynomial multiplications in EvalMult

Returns
the primitive root of unity value.

◆ GetBigRootOfUnityArb()

template<class Element >
const IntType& lbcrypto::LPCryptoParametersBFV< Element >::GetBigRootOfUnityArb ( ) const
inline

Gets the primitive root of unity used for polynomial multiplications in EvalMult (arbitrary cyclotomics)

Returns
the primitive root of unity value.

◆ GetDelta()

template<class Element >
const IntType& lbcrypto::LPCryptoParametersBFV< Element >::GetDelta ( ) const
inline

Gets the value of the delta factor.

Returns
the delta factor. It is an BFV-specific factor that is multiplied by the plaintext polynomial.

◆ operator==()

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

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

Parameters
&rhsLPCryptoParameters to check equality against.

Implements lbcrypto::LPCryptoParameters< Element >.

◆ SetBigModulus()

template<class Element >
void lbcrypto::LPCryptoParametersBFV< Element >::SetBigModulus ( const IntType &  bigModulus)
inline

Sets the modulus used for polynomial multiplications in EvalMult

Parameters
&bigModulusthe modulus value.

◆ SetBigModulusArb()

template<class Element >
void lbcrypto::LPCryptoParametersBFV< Element >::SetBigModulusArb ( const IntType &  bigModulusArb)
inline

Sets the modulus used for polynomial multiplications in EvalMult (arbitrary cyclotomics)

◆ SetBigRootOfUnity()

template<class Element >
void lbcrypto::LPCryptoParametersBFV< Element >::SetBigRootOfUnity ( const IntType &  bigRootOfUnity)
inline

Sets primitive root of unity used for polynomial multiplications in EvalMult

Parameters
&bigRootOfUnityis the root of unity used for EvalMult operations.

◆ SetBigRootOfUnityArb()

template<class Element >
void lbcrypto::LPCryptoParametersBFV< Element >::SetBigRootOfUnityArb ( const IntType &  bigRootOfUnityArb)
inline

Sets primitive root of unity used for polynomial multiplications in EvalMult (arbitrary cyclotomics)

◆ SetDelta()

template<class Element >
void lbcrypto::LPCryptoParametersBFV< Element >::SetDelta ( const IntType &  delta)
inline

Sets the value of the delta factor

Parameters
&deltais the delta factor

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