aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordec05eba <0xdec05eba@gmail.com>2018-05-08 18:36:27 +0200
committerdec05eba <0xdec05eba@gmail.com>2018-05-08 18:36:30 +0200
commit95f683eae7a004860eae2bca43f56f98b769cf80 (patch)
treec140d625b5f6b3a002b1fe69e0f0b69d9eb6f43e
parente3b6538c17884b5985a78e3d7c507d02b7af2e78 (diff)
Add comparison function to public key
-rw-r--r--include/odhtdb/Signature.hpp1
-rw-r--r--src/Signature.cpp5
2 files changed, 6 insertions, 0 deletions
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);