mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-04-28 11:47:48 +02:00
moved Identity to separate file
This commit is contained in:
parent
d714d7fe6c
commit
d03adfd193
4 changed files with 74 additions and 44 deletions
|
@ -1,4 +1,3 @@
|
|||
#include <cryptopp/sha.h>
|
||||
#include "Log.h"
|
||||
#include "LeaseSet.h"
|
||||
|
||||
|
@ -6,6 +5,7 @@ namespace i2p
|
|||
{
|
||||
namespace data
|
||||
{
|
||||
|
||||
LeaseSet::LeaseSet (const uint8_t * buf, int len)
|
||||
{
|
||||
#pragma pack(1)
|
||||
|
@ -19,7 +19,8 @@ namespace data
|
|||
#pragma pack ()
|
||||
|
||||
const H * header = (const H *)buf;
|
||||
CryptoPP::SHA256().CalculateDigest(m_IdentHash, (uint8_t *)&header->destination, sizeof (Identity));
|
||||
m_Identity = header->destination;
|
||||
m_IdentHash = CalculateIdentHash (m_Identity);
|
||||
memcpy (m_EncryptionKey, header->encryptionKey, 256);
|
||||
LogPrint ("LeaseSet num=", (int)header->num);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue