Class RingGSWEvalKeyImpl

Inheritance Relationships

Base Type

Class Documentation

class lbcrypto::RingGSWEvalKeyImpl : public lbcrypto::Serializable

Inheritence diagram for lbcrypto::RingGSWEvalKeyImpl:

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

Collaboration diagram for lbcrypto::RingGSWEvalKeyImpl:

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

Class that stores a RingGSW ciphertext; a two-dimensional vector of ring elements.

Public Functions

RingGSWEvalKeyImpl() = default
inline RingGSWEvalKeyImpl(uint32_t rowSize, uint32_t colSize) noexcept

Allocates a rowSize x colSize matrix of default-constructed ring elements

Every row of a RingGSW ciphertext is an RLWE pair (a, b) stored as columns 0 and 1, so colSize is 2. An RGSW encryption of a monomial has 2 * (digitsG - 1) rows: row 2t adds the gadget power baseG^(t + 1) times the monomial to “a” and row 2t + 1 adds it to “b” (the first gadget digit is dropped by the approximate gadget decomposition). An LMKCDEY automorphism key has digitsG - 1 rows.

Parameters
  • rowSize – the number of rows (RLWE pairs)

  • colSize – the number of ring elements per row

inline explicit RingGSWEvalKeyImpl(const std::vector<std::vector<NativePoly>> &elements)

Constructs a RingGSW ciphertext from its matrix of ring elements

Parameters

elements – the ring elements indexed [row][column]; each row is an RLWE pair (a, b) in columns 0 and 1

inline explicit RingGSWEvalKeyImpl(std::vector<std::vector<NativePoly>> &&elements) noexcept

Constructs a RingGSW ciphertext from its matrix of ring elements, moving it

Parameters

elements – the ring elements indexed [row][column]; each row is an RLWE pair (a, b) in columns 0 and 1

inline RingGSWEvalKeyImpl(const RingGSWEvalKeyImpl &rhs)
inline RingGSWEvalKeyImpl(RingGSWEvalKeyImpl &&rhs) noexcept
inline RingGSWEvalKeyImpl &operator=(const RingGSWEvalKeyImpl &rhs)
inline RingGSWEvalKeyImpl &operator=(RingGSWEvalKeyImpl &&rhs) noexcept
inline const std::vector<std::vector<NativePoly>> &GetElements() const
inline void SetElements(const std::vector<std::vector<NativePoly>> &elements)
inline void SetElements(std::vector<std::vector<NativePoly>> &&elements) noexcept
inline void SetFormat(const Format format)

Switches between COEFFICIENT and Format::EVALUATION polynomial representations using NTT

Parameters

format – the representation to switch all ring elements to

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

i – the row index

Returns

the row i (an RLWE pair)

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

i – the row index

Returns

the row i (an RLWE pair)

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

Compares the two matrices element by element

Parameters

other – the RingGSW ciphertext to compare with

Returns

true if both have the same dimensions and equal ring elements

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

other – the RingGSW ciphertext to compare with

Returns

true if the dimensions or any ring element 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()