Template Class CryptoParametersBase

Inheritance Relationships

Base Type

Derived Types

Template Parameter Order

  1. typename Element

Class Documentation

template<typename Element>
class lbcrypto::CryptoParametersBase : public lbcrypto::Serializable

Inheritence diagram for lbcrypto::CryptoParametersBase:

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

Collaboration diagram for lbcrypto::CryptoParametersBase:

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

main implementation class to capture essential cryptoparameters of any LBC system

Template Parameters

Element – a ring element.

Subclassed by lbcrypto::CryptoParametersRLWE< DCRTPoly >, lbcrypto::CryptoParametersRLWE< Element >

Public Functions

CryptoParametersBase() = default
virtual ~CryptoParametersBase() = default
inline virtual PlaintextModulus GetPlaintextModulus() const

Returns the value of plaintext modulus p

Returns

the plaintext modulus.

inline uint32_t GetBatchSize() const
inline const std::shared_ptr<typename Element::Params> GetElementParams() const

Returns the reference to IL params

Returns

the ring element parameters.

inline uint32_t GetRingDimension() const
virtual const std::shared_ptr<typename Element::Params> GetParamsPK() const = 0
inline const EncodingParams GetEncodingParams() const

Returns the reference to encoding params

Returns

the encoding parameters.

inline void SetPlaintextModulus(PlaintextModulus plaintextModulus)

Sets the value of plaintext modulus p

inline void SetBatchSize(uint32_t batchSize)
inline bool operator==(const CryptoParametersBase<Element> &rhs) const
inline bool operator!=(const CryptoParametersBase<Element> &rhs) const
inline virtual uint32_t GetDigitSize() const
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 virtual void SetElementParams(std::shared_ptr<typename Element::Params> params)

Sets the reference to element params

inline virtual void SetEncodingParams(EncodingParams encodingParams)

Sets the reference to encoding params

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 override

Public Static Functions

static inline uint32_t SerializedVersion()

Protected Functions

inline explicit CryptoParametersBase(const PlaintextModulus &plaintextModulus)
inline CryptoParametersBase(std::shared_ptr<typename Element::Params> params, const PlaintextModulus &plaintextModulus)
inline CryptoParametersBase(std::shared_ptr<typename Element::Params> params, EncodingParams encodingParams)
inline CryptoParametersBase(CryptoParametersBase<Element> *from, std::shared_ptr<typename Element::Params> newElemParms)
inline virtual bool CompareTo(const CryptoParametersBase<Element> &rhs) const

CompareTo() is a method to compare two CryptoParametersBase objects. It is called by operator==()

Parameters

rhs – - the other CryptoParametersBase object to compare to.

Returns

whether the two CryptoParametersBase objects are equivalent.

inline virtual void PrintParameters(std::ostream &out) const

Protected Attributes

std::shared_ptr<typename Element::Params> m_params
EncodingParams m_encodingParams

Friends

inline friend std::ostream &operator<<(std::ostream &out, const CryptoParametersBase &item)

Overload to allow printing of parameters to an iostream NOTE that the implementation relies on calling the virtual PrintParameters method

Parameters
  • out – - the stream to print to

  • item – - reference to the item to print

Returns

the stream