mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-04-28 11:47:48 +02:00
generate DH keys pair per NTCP session
This commit is contained in:
parent
15299aa42d
commit
7bdf52a774
6 changed files with 37 additions and 5 deletions
|
@ -53,6 +53,14 @@ namespace data
|
|||
return keys;
|
||||
}
|
||||
|
||||
void CreateRandomDHKeysPair (DHKeysPair * keys)
|
||||
{
|
||||
if (!keys) return;
|
||||
CryptoPP::AutoSeededRandomPool rnd;
|
||||
CryptoPP::DH dh (i2p::crypto::elgp, i2p::crypto::elgg);
|
||||
dh.GenerateKeyPair(rnd, keys->privateKey, keys->publicKey);
|
||||
}
|
||||
|
||||
RoutingKey CreateRoutingKey (const IdentHash& ident)
|
||||
{
|
||||
uint8_t buf[41]; // ident + yyyymmdd
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue