diff options
| author | Adam Ierymenko <adam.ierymenko@gmail.com> | 2013-10-05 06:00:47 -0400 |
|---|---|---|
| committer | Adam Ierymenko <adam.ierymenko@gmail.com> | 2013-10-05 06:00:47 -0400 |
| commit | b0187f44720fb675b99e6b6e57b660c6dfe8e464 (patch) | |
| tree | e809178143d5b554f97ed6bf1df9254a3cab17e9 /node/Identity.hpp | |
| parent | 588a47be893cf8b3b720bb41fac3bc0b75573e26 (diff) | |
| download | infinitytier-b0187f44720fb675b99e6b6e57b660c6dfe8e464.tar.gz infinitytier-b0187f44720fb675b99e6b6e57b660c6dfe8e464.zip | |
Hashcash-based identity, work in progress... committing to test speed on other boxes.
Diffstat (limited to 'node/Identity.hpp')
| -rw-r--r-- | node/Identity.hpp | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/node/Identity.hpp b/node/Identity.hpp index b2a57941..2c02a5f1 100644 --- a/node/Identity.hpp +++ b/node/Identity.hpp @@ -61,8 +61,7 @@ public: */ enum Type { - IDENTITY_TYPE_NIST_P_521 = 1, // OBSOLETE -- only present in some early alpha versions - IDENTITY_TYPE_C25519 = 2 + IDENTITY_TYPE_C25519 = 0 }; Identity() : @@ -73,7 +72,6 @@ public: Identity(const Identity &id) : _address(id._address), _publicKey(id._publicKey), - _signature(id._signature), _privateKey((id._privateKey) ? new C25519::Private(*(id._privateKey)) : (C25519::Private *)0) { } @@ -111,7 +109,6 @@ public: { _address = id._address; _publicKey = id._publicKey; - _signature = id._signature; if (id._privateKey) { if (!_privateKey) _privateKey = new C25519::Private(); @@ -236,7 +233,6 @@ public: _address.appendTo(b); b.append((unsigned char)IDENTITY_TYPE_C25519); b.append(_publicKey.data,_publicKey.size()); - b.append(_signature.data,_signature.size()); if ((_privateKey)&&(includePrivate)) { b.append((unsigned char)_privateKey->size()); b.append(_privateKey->data,_privateKey->size()); @@ -252,7 +248,7 @@ public: * @param b Buffer containing serialized data * @param startAt Index within buffer of serialized data (default: 0) * @return Length of serialized data read from buffer - * @throws std::out_of_range Buffer too small + * @throws std::out_of_range Serialized data invalid * @throws std::invalid_argument Serialized data invalid */ template<unsigned int C> @@ -272,8 +268,6 @@ public: memcpy(_publicKey.data,b.field(p,_publicKey.size()),_publicKey.size()); p += _publicKey.size(); - memcpy(_signature.data,b.field(p,_signature.size()),_signature.size()); - p += _signature.size(); unsigned int privateKeyLength = b[p++]; if ((privateKeyLength)&&(privateKeyLength == ZT_C25519_PRIVATE_KEY_LEN)) { @@ -318,12 +312,8 @@ public: inline bool operator>=(const Identity &id) const throw() { return !(*this < id); } private: - // Compute an address from public key bytes - static Address deriveAddress(const void *keyBytes,unsigned int keyLen); - Address _address; C25519::Public _publicKey; - C25519::Signature _signature; C25519::Private *_privateKey; }; |
