mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-04-28 11:47:48 +02:00
Keys added
This commit is contained in:
parent
d03adfd193
commit
6341b10556
5 changed files with 65 additions and 38 deletions
19
Identity.h
19
Identity.h
|
@ -3,13 +3,20 @@
|
|||
|
||||
#include <inttypes.h>
|
||||
#include <string.h>
|
||||
#include <cryptopp/sha.h>
|
||||
|
||||
namespace i2p
|
||||
{
|
||||
namespace data
|
||||
{
|
||||
#pragma pack(1)
|
||||
|
||||
struct Keys
|
||||
{
|
||||
uint8_t privateKey[256];
|
||||
uint8_t signingPrivateKey[20];
|
||||
uint8_t publicKey[256];
|
||||
uint8_t signingKey[128];
|
||||
};
|
||||
|
||||
struct Identity
|
||||
{
|
||||
|
@ -46,13 +53,9 @@ namespace data
|
|||
uint8_t m_Hash[32];
|
||||
};
|
||||
|
||||
inline IdentHash CalculateIdentHash (const Identity& identity)
|
||||
{
|
||||
IdentHash hash;
|
||||
CryptoPP::SHA256().CalculateDigest((uint8_t *)hash, (uint8_t *)&identity, sizeof (Identity));
|
||||
return hash;
|
||||
};
|
||||
|
||||
IdentHash CalculateIdentHash (const Identity& identity);
|
||||
Keys CreateRandomKeys ();
|
||||
|
||||
class RoutingDestination
|
||||
{
|
||||
public:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue