Template Class EvalKeyImpl

Inheritance Relationships

Base Type

Derived Type

Template Parameter Order

  1. class Element

Class Documentation

template<class Element>
class lbcrypto::EvalKeyImpl : public lbcrypto::Key<Element>

Inheritence diagram for lbcrypto::EvalKeyImpl:

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

Collaboration diagram for lbcrypto::EvalKeyImpl:

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

Abstract interface for evaluation/proxy keys.

Template Parameters

Element – a ring element.

Subclassed by lbcrypto::EvalKeyRelinImpl< Element >

Public Functions

EvalKeyImpl() = default

Default constructor

inline explicit EvalKeyImpl(const CryptoContext<Element> &cc)

Constructs an evaluation key in the given crypto context with an empty key tag.

Parameters

cc – the crypto context the key belongs to

EvalKeyImpl(const EvalKeyImpl&) = default
EvalKeyImpl(EvalKeyImpl&&) noexcept = default
virtual ~EvalKeyImpl() = default
EvalKeyImpl &operator=(const EvalKeyImpl&) = default
EvalKeyImpl &operator=(EvalKeyImpl&&) noexcept = default
inline virtual void SetAVector(const std::vector<Element> &a)

Setter function to store Relinearization Element Vector A. Throws exception, to be overridden by derived class.

Parameters

a – is the Element vector to be copied.

inline virtual void SetAVector(std::vector<Element> &&a)

Setter function to store Relinearization Element Vector A. Throws exception, to be overridden by derived class.

Parameters

a – is the Element vector to be moved.

inline virtual const std::vector<Element> &GetAVector() const

Getter function to access Relinearization Element Vector A. Throws exception, to be overridden by derived class.

Returns

Element vector A.

inline virtual void SetBVector(const std::vector<Element> &b)

Setter function to store Relinearization Element Vector B. Throws exception, to be overridden by derived class.

Parameters

b – is the Element vector to be copied.

inline virtual void SetBVector(std::vector<Element> &&b)

Setter function to store Relinearization Element Vector B. Throws exception, to be overridden by derived class.

Parameters

b – is the Element vector to be moved.

inline virtual const std::vector<Element> &GetBVector() const

Getter function to access Relinearization Element Vector B. Throws exception, to be overridden by derived class.

Returns

Element vector B.

inline virtual void ClearKeys()

Releases the key material held by the evaluation key. Throws exception, to be overridden by derived class.

inline virtual bool key_compare(const EvalKeyImpl &other) const

Compares this key with another evaluation key. The base implementation always reports inequality; derived classes override it.

Parameters

other – the evaluation key to compare with

Returns

true if the keys are equal

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

Friends

inline friend bool operator==(const EvalKeyImpl &a, const EvalKeyImpl &b)

Equality of evaluation keys, delegated to the virtual key_compare() of the left operand.

Parameters
  • a – left operand

  • b – right operand

Returns

true if a.key_compare(b) reports equality

inline friend bool operator!=(const EvalKeyImpl &a, EvalKeyImpl &b)

Inequality of evaluation keys: negation of operator==.

Parameters
  • a – left operand

  • b – right operand

Returns

true if the keys differ