mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-04-28 11:47:48 +02:00
64-bits alignment for RoutingKey
This commit is contained in:
parent
a728d9db5b
commit
eb44fdf7a8
2 changed files with 12 additions and 8 deletions
11
Identity.h
11
Identity.h
|
@ -78,7 +78,7 @@ namespace data
|
|||
bool operator== (const IdentHash& other) const { return !memcmp (m_Hash, other.m_Hash, 32); };
|
||||
bool operator< (const IdentHash& other) const { return memcmp (m_Hash, other.m_Hash, 32) < 0; };
|
||||
|
||||
bool FromBase32(const std::string&);
|
||||
bool FromBase32(const std::string&);
|
||||
|
||||
private:
|
||||
|
||||
|
@ -89,14 +89,19 @@ namespace data
|
|||
void CreateRandomDHKeysPair (DHKeysPair * keys); // for transport sessions
|
||||
|
||||
// kademlia
|
||||
struct RoutingKey
|
||||
union RoutingKey
|
||||
{
|
||||
uint8_t hash[32];
|
||||
uint64_t hash_ll[4];
|
||||
};
|
||||
|
||||
struct XORMetric
|
||||
{
|
||||
uint8_t metric[32];
|
||||
union
|
||||
{
|
||||
uint8_t metric[32];
|
||||
uint64_t metric_ll[4];
|
||||
};
|
||||
|
||||
void SetMin () { memset (metric, 0, 32); };
|
||||
void SetMax () { memset (metric, 0xFF, 32); };
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue