diff options
author | Aleksi Lindeman <0xdec05eba@gmail.com> | 2018-03-09 10:26:55 +0100 |
---|---|---|
committer | Aleksi Lindeman <0xdec05eba@gmail.com> | 2018-03-09 10:27:06 +0100 |
commit | 230e61091b401b8b2bb9496d557a15660fb5072b (patch) | |
tree | 13b937d93105c069d6478480c8a9ada45ccc2434 /include/Signature.hpp | |
parent | 2ffb47d0043e57707474e5ae811f97c2e5e93f25 (diff) |
Partially implement 'add' operation
Diffstat (limited to 'include/Signature.hpp')
-rw-r--r-- | include/Signature.hpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/include/Signature.hpp b/include/Signature.hpp index aace383..62c41c3 100644 --- a/include/Signature.hpp +++ b/include/Signature.hpp @@ -2,6 +2,7 @@ #include "DataView.hpp" #include <stdexcept> +#include <unordered_map> namespace odhtdb { @@ -67,6 +68,9 @@ namespace odhtdb // Both exceptions are derived from UnsignException std::string unsign(const DataView &signedMessage) const; + size_t operator()() const; + bool operator==(const PublicKey &other) const; + std::string toString() const; private: PublicKey(){} @@ -74,6 +78,17 @@ namespace odhtdb char data[PUBLIC_KEY_NUM_BYTES]; }; + struct PublicKeyHasher + { + size_t operator()(const PublicKey &publicKey) const + { + return publicKey(); + } + }; + + template <typename ValueType> + using MapPublicKey = std::unordered_map<PublicKey, ValueType, PublicKeyHasher>; + class PrivateKey { friend class KeyPair; |