From 95f683eae7a004860eae2bca43f56f98b769cf80 Mon Sep 17 00:00:00 2001 From: dec05eba <0xdec05eba@gmail.com> 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