I2P: End-to-End encrypted and anonymous Internet https://i2pd.website/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

33 lines
626 B

#include "Log.h"
#include "LeaseSet.h"
namespace i2p
{
namespace data
{
LeaseSet::LeaseSet (const uint8_t * buf, int len)
{
#pragma pack(1)
struct H
{
Identity destination;
uint8_t encryptionKey[256];
uint8_t signingKey[128];
uint8_t num;
};
#pragma pack ()
const H * header = (const H *)buf;
m_Identity = header->destination;
m_IdentHash = CalculateIdentHash (m_Identity);
memcpy (m_EncryptionKey, header->encryptionKey, 256);
LogPrint ("LeaseSet num=", (int)header->num);
for (int i = 0; i < header->num; i++)
{
m_Leases.push_back (*(Lease *)(buf + sizeof (H)));
}
}
}
}