Class LWEPublicKeyImpl

Inheritance Relationships

Base Type

Class Documentation

class lbcrypto::LWEPublicKeyImpl : public lbcrypto::Serializable

Inheritence diagram for lbcrypto::LWEPublicKeyImpl:

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

Collaboration diagram for lbcrypto::LWEPublicKeyImpl:

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

Class that stores the LWE scheme public key; contains a vector.

Public Functions

LWEPublicKeyImpl() = default
inline LWEPublicKeyImpl(const std::vector<NativeVector> &A, const NativeVector &v)

Constructs an LWE public key (A, v) from its components

Parameters
  • A – the uniformly random matrix, stored by rows: N vectors of dimension N with modulus Q

  • v – the vector v = A s + e, i.e. v[j] = <A[j], s> + e_j mod Q, for the secret key s

inline LWEPublicKeyImpl(std::vector<NativeVector> &&A, NativeVector &&v) noexcept

Constructs an LWE public key (A, v) from its components, moving them

Parameters
  • A – the uniformly random matrix, stored by rows: N vectors of dimension N with modulus Q

  • v – the vector v = A s + e, i.e. v[j] = <A[j], s> + e_j mod Q, for the secret key s

inline LWEPublicKeyImpl(const LWEPublicKeyImpl &rhs)
inline LWEPublicKeyImpl(LWEPublicKeyImpl &&rhs) noexcept
inline LWEPublicKeyImpl &operator=(const LWEPublicKeyImpl &rhs)
inline LWEPublicKeyImpl &operator=(LWEPublicKeyImpl &&rhs) noexcept
inline const std::vector<NativeVector> &GetA() const
inline const NativeVector &Getv() const
inline void SetA(const std::vector<NativeVector> &A)
inline void SetA(std::vector<NativeVector> &&A) noexcept
inline void Setv(const NativeVector &v)
inline void Setv(NativeVector &&v) noexcept
inline uint32_t GetLength() const
Returns

the dimension of the key (the length of v)

inline NativeInteger GetModulus() const
Returns

the modulus of the key (the modulus of v)

inline bool operator==(const LWEPublicKeyImpl &other) const
Parameters

other – the public key to compare with

Returns

true if both keys have the same A and v

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

other – the public key to compare with

Returns

true if the keys differ in A or v

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