Class RingGSWACCKeyImpl

Inheritance Relationships

Base Type

Class Documentation

class lbcrypto::RingGSWACCKeyImpl : public lbcrypto::Serializable

Inheritence diagram for lbcrypto::RingGSWACCKeyImpl:

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

Collaboration diagram for lbcrypto::RingGSWACCKeyImpl:

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

Class that stores the refresh key (used in bootstrapping) A three-dimensional vector of RingGSW ciphertexts.

Public Functions

RingGSWACCKeyImpl() = default
inline RingGSWACCKeyImpl(uint32_t dim1, uint32_t dim2, uint32_t dim3)

Allocates a dim1 x dim2 x dim3 array of (null) RingGSW evaluation keys

The meaning of the three dimensions depends on the bootstrapping method; see the KeyGenAcc methods of the RingGSWAccumulator classes. With s the LWE secret key of dimension n:

  • DM (AP): [n][baseR][digitsR], indexed [i][j][k] with i the position in s, j in [1, baseR) the value of a base-baseR digit and k the digit position; the entry is RGSW(X^(s_i * j * baseR^k)). The entries with j = 0, and with j at or above the extent of the top digit position, stay null.

  • CGGI (GINX): [1][2][n]; [0][0][i] encrypts 1 if s_i = 1 and 0 otherwise, [0][1][i] encrypts 1 if s_i = -1 and 0 otherwise.

  • LMKCDEY: [1][2][n]; [0][0][i] = RGSW(X^(s_i)), [0][1][0] is the automorphism key for the exponent 2N - 5 and [0][1][t] for t = 1..numAutoKeys is the automorphism key for 5^t mod 2N; the remaining [0][1] entries stay null.

Parameters
  • dim1 – the size of the first dimension

  • dim2 – the size of the second dimension

  • dim3 – the size of the third dimension

inline explicit RingGSWACCKeyImpl(const std::vector<std::vector<std::vector<RingGSWEvalKey>>> &key)

Constructs a refresh key from a three-dimensional array of RingGSW evaluation keys

Parameters

key – the RingGSW evaluation keys, laid out per bootstrapping method as described for the constructor taking the three dimensions

inline explicit RingGSWACCKeyImpl(std::vector<std::vector<std::vector<RingGSWEvalKey>>> &&key) noexcept

Constructs a refresh key from a three-dimensional array of RingGSW evaluation keys, moving it

Parameters

key – the RingGSW evaluation keys, laid out per bootstrapping method as described for the constructor taking the three dimensions

inline RingGSWACCKeyImpl(const RingGSWACCKeyImpl &rhs)
inline RingGSWACCKeyImpl(RingGSWACCKeyImpl &&rhs) noexcept
inline RingGSWACCKeyImpl &operator=(const RingGSWACCKeyImpl &rhs)
inline RingGSWACCKeyImpl &operator=(RingGSWACCKeyImpl &&rhs) noexcept
inline const std::vector<std::vector<std::vector<RingGSWEvalKey>>> &GetElements() const
inline void SetElements(const std::vector<std::vector<std::vector<RingGSWEvalKey>>> &key)
inline void SetElements(std::vector<std::vector<std::vector<RingGSWEvalKey>>> &&key) noexcept
inline std::vector<std::vector<RingGSWEvalKey>> &operator[](uint32_t i)
Parameters

i – the index in the first dimension

Returns

the two-dimensional slice of RingGSW evaluation keys at index i

inline const std::vector<std::vector<RingGSWEvalKey>> &operator[](uint32_t i) const
Parameters

i – the index in the first dimension

Returns

the two-dimensional slice of RingGSW evaluation keys at index i

inline bool operator==(const RingGSWACCKeyImpl &other) const

Compares the two keys entry by entry through the shared pointers; two null entries compare equal

Parameters

other – the refresh key to compare with

Returns

true if both keys have the same dimensions and equal RingGSW evaluation keys in every position

inline bool operator!=(const RingGSWACCKeyImpl &other) const
Parameters

other – the refresh key to compare with

Returns

true if the dimensions or any RingGSW evaluation key differ

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

Returns the name identifying the derived class in serialized form; every serializable class provides it.

Returns

the serialized object name

Public Static Functions

static inline uint32_t SerializedVersion()