Template Class ILDCRTParams

Inheritance Relationships

Base Type

Template Parameter Order

  1. typename IntType

Class Documentation

template<typename IntType>
class lbcrypto::ILDCRTParams : public lbcrypto::ElemParams<IntType>

Inheritence diagram for lbcrypto::ILDCRTParams:

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"] "2" [label="lbcrypto::ElemParams< IntType >" tooltip="lbcrypto::ElemParams< IntType >"] "1" [label="lbcrypto::ILDCRTParams< IntType >" tooltip="lbcrypto::ILDCRTParams< IntType >" fillcolor="#BFBFBF"] "2" -> "3" [dir=forward tooltip="public-inheritance"] "1" -> "2" [dir=forward tooltip="public-inheritance"] }

Collaboration diagram for lbcrypto::ILDCRTParams:

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"] "2" [label="lbcrypto::ElemParams< IntType >" tooltip="lbcrypto::ElemParams< IntType >"] "1" [label="lbcrypto::ILDCRTParams< IntType >" tooltip="lbcrypto::ILDCRTParams< IntType >" fillcolor="#BFBFBF"] "2" -> "3" [dir=forward tooltip="public-inheritance"] "1" -> "2" [dir=forward tooltip="public-inheritance"] }

Parameters for array of ideal lattices (used for Double-CRT).

The double-CRT representation of polynomials is a common optimization for lattice encryption operations. Basically, it allows large-modulus polynamials to be represented as multiple smaller-modulus polynomials. The double-CRT representations are discussed theoretically here:

  • Gentry C., Halevi S., Smart N.P. (2012) Homomorphic Evaluation of the AES Circuit. In: Safavi-Naini R., Canetti R. (eds) Advances in Cryptology - CRYPTO 2012. Lecture Notes in Computer Science, vol 7417. Springer, Berlin, Heidelberg

Public Types

using Integer = IntType
using ILNativeParams = ILParamsImpl<NativeInteger>

Public Functions

inline ILDCRTParams(uint32_t corder, const IntType &modulus, const IntType &rootOfUnity = IntType(0))
inline explicit ILDCRTParams(uint32_t corder = 0, uint32_t depth = 1, uint32_t bits = MAX_MODULUS_SIZE)

Constructor with basic parameter set. q is selected as LastPrime(bits, order)

Parameters
  • corder – the order of the ciphertext.

  • depth – is the size of the tower.

  • bits – is the number of bits of each tower’s moduli.

inline ILDCRTParams(uint32_t corder, const std::vector<NativeInteger> &moduli, const std::vector<NativeInteger> &rootsOfUnity)

Constructor with some pre-computed parameters provided as input.

Parameters
  • corder – the order of the ciphertext

  • moduli – the list of the smaller moduli of the component polynomials.

  • rootsOfUnity – the list of the smaller roots of unity of the component polynomials.

  • moduliBig – the list of the big moduli of the component polynomials (arbitrary cyclotomics).

  • rootsOfUnityBig – the list of the roots of unity of the component polynomials for big moduli (arbitrary cyclotomics).

Returns

inline ILDCRTParams(uint32_t corder, const std::vector<NativeInteger> &moduli, const std::vector<NativeInteger> &rootsOfUnity, const std::vector<NativeInteger> &moduliBig, const std::vector<NativeInteger> &rootsOfUnityBig, const IntType &inputOriginalModulus = IntType(0))
inline ILDCRTParams(uint32_t corder, const std::vector<NativeInteger> &moduli, const IntType &inputOriginalModulus = IntType(0))

Constructor with only cylotomic order and chain of moduli. Multiplied values of the chain of moduli is automatically calculated. Root of unity of the modulus is also calculated.

Parameters
  • corder – the order of the ciphertext

  • &moduli – is the tower of moduli

inline ILDCRTParams(uint32_t corder, const std::vector<std::shared_ptr<ILNativeParams>> &params, const IntType &inputOriginalModulus = IntType(0))

Constructor that takes in the cyclotomic order and the component parameters of the component moduli.

Parameters
  • corder – the primary cyclotomic order. This is not checked against the component moduli.

  • params – the componet parameters.

Returns

inline ILDCRTParams(const ILDCRTParams &rhs)
inline ILDCRTParams(ILDCRTParams &&rhs) noexcept
inline ILDCRTParams &operator=(const ILDCRTParams &rhs)

Assignment Operator.

Parameters

&rhs – the copied ILDCRTParams.

Returns

the resulting ILDCRTParams.

inline ILDCRTParams &operator=(ILDCRTParams &&rhs) noexcept
inline const std::vector<std::shared_ptr<ILNativeParams>> &GetParams() const

Getter method for the component parameters.

Returns

A vector of the component polynomial parameters.

inline std::vector<std::shared_ptr<ILNativeParams>> GetParamPartition(uint32_t start, uint32_t end) const

Getter method that returns a subset of the component parameters.

Parameters
  • start – The index of the first tower to include in the result.

  • end – The index of the last tower to include.

Returns

A vector of the component polynomial parameters.

inline const IntType &GetOriginalModulus() const

Simple getter method for the original modulus, not the ciphertex modulus.

Returns

The original modulus, not the big ciphertext modulus.

inline void SetOriginalModulus(const IntType &inputOriginalModulus)

Simple setter method for the original modulus, not the ciphertex modulus.

Returns

void

inline std::shared_ptr<ILNativeParams> &operator[](size_t i)

Getter method for the component parameters of a specific index.

Parameters

i – the index of the parameters to return. Note this this call is unguarded if the index is out of bounds.

Returns

the parameters at index i.

inline const std::shared_ptr<ILNativeParams> &operator[](size_t i) const
inline void PopLastParam()

Removes the last parameter set and adjust the multiplied moduli.

inline void PopFirstParam()

Removes the first parameter set and adjust the multiplied moduli.

~ILDCRTParams() override = default

Destructor.

inline virtual bool operator==(const ElemParams<IntType> &other) const override

Equality operator checks if the ElemParams are the same.

Parameters

&otherElemParams to compare against.

Returns

the equality check results.

inline void RecalculateModulus()

Method to recalculate the composite modulus from the component moduli.

inline void RecalculateBigModulus()

Method to recalculate the big composite modulus from the component moduli.

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()