From 5e30dd8fd378b0dfb24a67aa75aec1d0902c0243 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Tue, 8 May 2018 18:36:27 +0200 Subject: Add comparison function to public key --- include/odhtdb/Signature.hpp | 1 + src/Signature.cpp | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/include/odhtdb/Signature.hpp b/include/odhtdb/Signature.hpp index dac856b..1f5158e 100644 --- a/include/odhtdb/Signature.hpp +++ b/include/odhtdb/Signature.hpp @@ -70,6 +70,7 @@ namespace odhtdb size_t operator()() const; bool operator==(const PublicKey &other) const; + bool operator!=(const PublicKey &other) const; std::string toString() const; private: diff --git a/src/Signature.cpp b/src/Signature.cpp index af04017..c64af01 100644 --- a/src/Signature.cpp +++ b/src/Signature.cpp @@ -59,6 +59,11 @@ namespace odhtdb return memcmp(data, other.data, PUBLIC_KEY_NUM_BYTES) == 0; } + bool PublicKey::operator!=(const PublicKey &other) const + { + return !operator==(other); + } + string PublicKey::toString() const { return bin2hex(data, PUBLIC_KEY_NUM_BYTES); -- cgit v1.2.3