generate DH keys pair per NTCP session

This commit is contained in:
orignal 2014-04-04 13:30:13 -04:00
parent 15299aa42d
commit 7bdf52a774
6 changed files with 37 additions and 5 deletions

View file

@ -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