mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-03-13 04:46:38 +01:00
use make_shared
This commit is contained in:
parent
9150240a0d
commit
3b90aa2fe1
1 changed files with 2 additions and 2 deletions
|
@ -18,7 +18,7 @@ namespace garlic
|
||||||
{
|
{
|
||||||
if (key)
|
if (key)
|
||||||
{
|
{
|
||||||
std::shared_ptr<i2p::crypto::CBCDecryption> decryption (new i2p::crypto::CBCDecryption);
|
auto decryption = std::make_shared<i2p::crypto::CBCDecryption>();
|
||||||
decryption->SetKey (key);
|
decryption->SetKey (key);
|
||||||
m_Tags[SessionTag(tag)] = decryption;
|
m_Tags[SessionTag(tag)] = decryption;
|
||||||
}
|
}
|
||||||
|
@ -46,7 +46,7 @@ namespace garlic
|
||||||
ElGamalBlock elGamal;
|
ElGamalBlock elGamal;
|
||||||
if (i2p::crypto::ElGamalDecrypt (GetEncryptionPrivateKey (), buf, (uint8_t *)&elGamal, true))
|
if (i2p::crypto::ElGamalDecrypt (GetEncryptionPrivateKey (), buf, (uint8_t *)&elGamal, true))
|
||||||
{
|
{
|
||||||
std::shared_ptr<i2p::crypto::CBCDecryption> decryption (new i2p::crypto::CBCDecryption);
|
auto decryption = std::make_shared<i2p::crypto::CBCDecryption>();
|
||||||
decryption->SetKey (elGamal.sessionKey);
|
decryption->SetKey (elGamal.sessionKey);
|
||||||
uint8_t iv[32]; // IV is first 16 bytes
|
uint8_t iv[32]; // IV is first 16 bytes
|
||||||
CryptoPP::SHA256().CalculateDigest(iv, elGamal.preIV, 32);
|
CryptoPP::SHA256().CalculateDigest(iv, elGamal.preIV, 32);
|
||||||
|
|
Loading…
Add table
Reference in a new issue