Template Class CryptoParametersRLWE

Inheritance Relationships

Base Type

Template Parameter Order

  1. class Element

Class Documentation

template<class Element>
class lbcrypto::CryptoParametersRLWE : public lbcrypto::CryptoParametersBase<Element>

Inheritence diagram for lbcrypto::CryptoParametersRLWE:

digraph { graph [bgcolor="#00000000"] node [shape=rectangle style=filled fillcolor="#FFFFFF" font=Helvetica padding=2] edge [color="#1414CE"] "3" [label="lbcrypto::Serializable" tooltip="lbcrypto::Serializable"] "1" [label="lbcrypto::CryptoParametersRLWE< Element >" tooltip="lbcrypto::CryptoParametersRLWE< Element >" fillcolor="#BFBFBF"] "2" [label="lbcrypto::CryptoParametersBase< Element >" tooltip="lbcrypto::CryptoParametersBase< Element >"] "1" -> "2" [dir=forward tooltip="public-inheritance"] "2" -> "3" [dir=forward tooltip="public-inheritance"] }

Collaboration diagram for lbcrypto::CryptoParametersRLWE:

digraph { graph [bgcolor="#00000000"] node [shape=rectangle style=filled fillcolor="#FFFFFF" font=Helvetica padding=2] edge [color="#1414CE"] "3" [label="lbcrypto::Serializable" tooltip="lbcrypto::Serializable"] "1" [label="lbcrypto::CryptoParametersRLWE< Element >" tooltip="lbcrypto::CryptoParametersRLWE< Element >" fillcolor="#BFBFBF"] "2" [label="lbcrypto::CryptoParametersBase< Element >" tooltip="lbcrypto::CryptoParametersBase< Element >"] "1" -> "2" [dir=forward tooltip="public-inheritance"] "2" -> "3" [dir=forward tooltip="public-inheritance"] }

Template for crypto parameters.

Template Parameters

Element – a ring element.

Public Functions

CryptoParametersRLWE() = default

Default Constructor

inline CryptoParametersRLWE(const CryptoParametersRLWE &rhs)

Copy constructor.

inline CryptoParametersRLWE(std::shared_ptr<typename Element::Params> params, EncodingParams encodingParams, float distributionParameter, float assuranceMeasure, SecurityLevel stdLevel, usint digitSize, int maxRelinSkDeg = 2, SecretKeyDist secretKeyDist = GAUSSIAN, ProxyReEncryptionMode PREMode = INDCPA, MultipartyMode multipartyMode = FIXED_NOISE_MULTIPARTY, ExecutionMode executionMode = EXEC_EVALUATION, DecryptionNoiseMode decryptionNoiseMode = FIXED_NOISE_DECRYPT, PlaintextModulus noiseScale = 1, uint32_t statisticalSecurity = 30, uint32_t numAdversarialQueries = 1, uint32_t thresholdNumOfParties = 1)

Constructor that initializes values - uses HomomorphicEncryption.org standard security levels

Parameters
  • &params – element parameters.

  • &encodingParams – encoding-specific parameters

  • distributionParameter – noise distribution parameter.

  • assuranceMeasure – assurance level.

  • stdLevel – security level.

  • digitSize – the size of the digit size.

  • maxRelinSkDeg – the maximum power of secret key for which the relinearization key is generated

  • secretKeyDist – mode for secret polynomial, defaults to GAUSSIAN.

  • noiseScale – used in HRA-secure PRE

inline virtual ~CryptoParametersRLWE()

Destructor

inline float GetDistributionParameter() const

Returns the value of standard deviation r for discrete Gaussian distribution

Returns

the standard deviation r.

inline double GetFloodingDistributionParameter() const

Returns the value of standard deviation r for discrete Gaussian distribution with flooding

Returns

the flooding standard deviation r.

inline float GetAssuranceMeasure() const

Returns the values of assurance measure alpha

Returns

the assurance measure.

inline PlaintextModulus GetNoiseScale() const

Returns the value of noise scale.

Returns

the noise scale.

inline virtual usint GetDigitSize() const

Returns the value of digit size.

Returns

the digit size.

inline virtual uint32_t GetMaxRelinSkDeg() const

Returns the value of the maximum power of secret key for which the relinearization key is generated

Returns

maximum power of secret key

inline SecretKeyDist GetSecretKeyDist() const

Gets the secretKeyDist setting: GAUSSIAN or UNIFORM_TERNARY

Returns

the secretKeyDist setting.

inline ProxyReEncryptionMode GetPREMode() const

Gets the pre security mode setting: INDCPA, FIXED_NOISE_HRA, NOISE_FLOODING_HRA or MODULUS_SWITCHING_HRA.

Returns

the pre security mode setting.

inline MultipartyMode GetMultipartyMode() const

Gets the multiparty security mode setting.

Returns

the multiparty security mode setting.

inline ExecutionMode GetExecutionMode() const

Gets the execution mode setting.

Returns

the execution mode setting.

inline DecryptionNoiseMode GetDecryptionNoiseMode()

Gets the decryption noise mode setting.

Returns

the decryption noise mode setting.

inline SecurityLevel GetStdLevel() const

Gets the standard security level

Returns

the security level.

inline const Element::DggType &GetDiscreteGaussianGenerator() const

Returns reference to Discrete Gaussian Generator

Returns

reference to Discrete Gaussian Generaror.

inline Element::DggType &GetFloodingDiscreteGaussianGenerator()

Returns reference to Discrete Gaussian Generator with flooding for PRE

Returns

reference to Discrete Gaussian Generaror with flooding for PRE. The Std dev for this generator changes based on the PRE mode, so it is not const

inline double GetStatisticalSecurity() const

Gets the statistical security level

Returns

the statistical security level.

inline double GetNumAdversarialQueries() const

Gets the number of adversarial queries

Returns

the number of adversarial queries.

inline uint32_t GetThresholdNumOfParties() const

Gets the threshold number of parties

Returns

the threshold number of parties.

inline void SetDistributionParameter(float distributionParameter)

Sets the value of standard deviation r for discrete Gaussian distribution

Parameters

distributionParameter

inline void SetFloodingDistributionParameter(double distributionParameter)

Sets the value of flooding standard deviation r for discrete Gaussian distribution with flooding

Parameters

distributionParameter

inline void SetAssuranceMeasure(float assuranceMeasure)

Sets the values of assurance measure alpha

Parameters

assuranceMeasure

inline void SetStdLevel(SecurityLevel securityLevel)

Sets the standard security level

Parameters

standard – security level

inline void SetNoiseScale(PlaintextModulus noiseScale)

Sets the value of noise scale

Parameters

noiseScale

inline void SetDigitSize(usint digitSize)

Sets the value of digit size

Parameters

digitSize

inline void SetMaxRelinSkDeg(uint32_t maxRelinSkDeg)

Sets the value of the maximum power of secret key for which the relinearization key is generated

Parameters

maxRelinSkDeg

inline void SetSecretKeyDist(SecretKeyDist secretKeyDist)

Configures the secretKeyDist for generating the secret key polynomial

Parameters

secretKeyDist – is GAUSSIAN or UNIFORM_TERNARY

inline void SetPREMode(ProxyReEncryptionMode PREMode)

Configures the security mode for pre

Parameters

PREMode – is INDCPA, FIXED_NOISE_HRA, NOISE_FLOODING_HRA or MODULUS_SWITCHING_HRA.

inline void SetMultipartyMode(MultipartyMode multipartyMode)

Configures the security mode for multiparty

Parameters

multipartyMode – Security mode for multiparty decryption.

inline void SetExecutionMode(ExecutionMode executionMode)

Configures the execution for CKKS noise flooding

Parameters

executionMode – Execution mode.

inline void SetDecryptionNoiseMode(DecryptionNoiseMode decryptionNoiseMode)

Configures the decryption noise mode for CKKS noise flooding

Parameters

decryptionNoiseMode – Decryption noise mode.

inline void SetStatisticalSecurity(uint32_t statisticalSecurity)

Configures the decryption noise mode for CKKS noise flooding and PRE

Parameters

statisticalSecurity.

inline void SetNumAdversarialQueries(uint32_t numAdversarialQueries)

Configures the decryption noise mode for CKKS noise flooding and PRE

Parameters

numAdversarialQueries.

inline void SetThresholdNumOfParties(uint32_t thresholdNumOfParties)

Configures the number of parties in thresholdFHE

Parameters

thresholdNumOfParties.

inline virtual bool operator==(const CryptoParametersBase<Element> &rhs) const

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

Parameters

&rhs – CryptoParameters to check equality against.

inline virtual void PrintParameters(std::ostream &os) const
template<class Archive>
inline void save(Archive &ar, std::uint32_t const version) const
template<class Archive>
inline void load(Archive &ar, std::uint32_t const version)
inline virtual std::string SerializedObjectName() const

Protected Attributes

float m_distributionParameter = 0
double m_floodingDistributionParameter = 0
float m_assuranceMeasure = 0
PlaintextModulus m_noiseScale = 1
usint m_digitSize = 1
uint32_t m_maxRelinSkDeg = 2
SecretKeyDist m_secretKeyDist = GAUSSIAN
SecurityLevel m_stdLevel = HEStd_NotSet
Element::DggType m_dgg = typename Element::DggType(0)
Element::DggType m_dggFlooding = typename Element::DggType(0)
ProxyReEncryptionMode m_PREMode = NOT_SET
MultipartyMode m_multipartyMode = FIXED_NOISE_MULTIPARTY
ExecutionMode m_executionMode = EXEC_EVALUATION
DecryptionNoiseMode m_decryptionNoiseMode = FIXED_NOISE_DECRYPT
double m_statisticalSecurity = 30
double m_numAdversarialQueries = 1
usint m_thresholdNumOfParties = 1