PALISADE Lattice Crypto Library
1.11.9
A lattice crypto library for software engineers by software engineers.
|
This is the parameters class for the BFV encryption scheme. This scheme is also referred to as the FV scheme. More...
#include <bfv.h>
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 |
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:
Element | a ring element type. |
lbcrypto::LPCryptoParametersBFV< Element >::LPCryptoParametersBFV | ( | ) |
Default constructor.
lbcrypto::LPCryptoParametersBFV< Element >::LPCryptoParametersBFV | ( | const LPCryptoParametersBFV< Element > & | rhs | ) |
Copy constructor.
rhs | - source |
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.
¶ms | Element parameters. This will depend on the specific class of element being used. |
&plaintextModulus | Plaintext modulus, typically denoted as p in most publications. |
distributionParameter | Noise 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. |
assuranceMeasure | Assurance 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. |
securityLevel | Security 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. |
relinWindow | The 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. |
delta | BFV-specific factor that is multiplied by the plaintext polynomial. |
mode | mode for secret polynomial, defaults to RLWE. |
bigModulus | modulus used in polynomial multiplications in EvalMult |
bigRootOfUnity | root of unity for bigModulus |
bigModulusArb | modulus used in polynomial multiplications in EvalMult (for arbitrary cyclotomics) |
bigRootOfUnityArb | root of unity for bigModulus (for arbitrary cyclotomics) |
depth | is the depth of computation circuit supported for these parameters (not used now; for future use). |
maxDepth | the maximum power of secret key for which the relinearization key is generated |
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.
¶ms | element parameters. |
&encodingParams | plaintext space parameters. |
distributionParameter | noise distribution parameter. |
assuranceMeasure | assurance level. = BigInteger::ZERO |
securityLevel | security level (root Hermite factor). |
relinWindow | the size of the relinearization window. |
delta | BFV-specific factor that is multiplied by the plaintext polynomial. |
mode | mode for secret polynomial, defaults to RLWE. |
bigModulus | modulus used in polynomial multiplications in EvalMult |
bigRootOfUnity | root of unity for bigModulus |
bigModulusArb | modulus used in polynomial multiplications in EvalMult (arbitrary cyclotomics) |
bigRootOfUnityArb | root of unity for bigModulus (arbitrary cyclotomics) |
depth | is the depth of computation circuit supported for these parameters (not used now; for future use). |
maxDepth | the maximum power of secret key for which the relinearization key is generated |
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.
¶ms | element parameters. |
&encodingParams | plaintext space parameters. |
distributionParameter | noise distribution parameter. |
assuranceMeasure | assurance level. = BigInteger::ZERO |
securityLevel | standard security level. |
relinWindow | the size of the relinearization window. |
delta | BFV-specific factor that is multiplied by the plaintext polynomial. |
mode | mode for secret polynomial, defaults to RLWE. |
bigModulus | modulus used in polynomial multiplications in EvalMult |
bigRootOfUnity | root of unity for bigModulus |
bigModulusArb | modulus used in polynomial multiplications in EvalMult (arbitrary cyclotomics) |
bigRootOfUnityArb | root of unity for bigModulus (arbitrary cyclotomics) |
depth | is the depth of computation circuit supported for these parameters (not used now; for future use). |
maxDepth | the maximum power of secret key for which the relinearization key is generated |
|
inlinevirtual |
Destructor
|
inline |
Gets the modulus used for polynomial multiplications in EvalMult
|
inline |
Gets the modulus used for polynomial multiplications in EvalMult (arbitrary cyclotomics)
|
inline |
Gets the primitive root of unity used for polynomial multiplications in EvalMult
|
inline |
Gets the primitive root of unity used for polynomial multiplications in EvalMult (arbitrary cyclotomics)
|
inline |
Gets the value of the delta factor.
|
inlinevirtual |
== operator to compare to this instance of LPCryptoParametersBFV object.
&rhs | LPCryptoParameters to check equality against. |
Implements lbcrypto::LPCryptoParameters< Element >.
|
inline |
Sets the modulus used for polynomial multiplications in EvalMult
&bigModulus | the modulus value. |
|
inline |
Sets the modulus used for polynomial multiplications in EvalMult (arbitrary cyclotomics)
|
inline |
Sets primitive root of unity used for polynomial multiplications in EvalMult
&bigRootOfUnity | is the root of unity used for EvalMult operations. |
|
inline |
Sets primitive root of unity used for polynomial multiplications in EvalMult (arbitrary cyclotomics)
|
inline |
Sets the value of the delta factor
&delta | is the delta factor |