mirror of
https://github.com/PurpleI2P/i2pd
synced 2024-11-10 08:00:38 +03:00
copy noise state
This commit is contained in:
parent
f94d03465a
commit
b8064b9b4b
@ -687,8 +687,10 @@ namespace i2p
|
||||
if (IsECIES ())
|
||||
{
|
||||
if (!m_InitialNoiseState) return false;
|
||||
m_CurrentNoiseState.reset (new i2p::crypto::NoiseSymmetricState ());
|
||||
// m_InitialNoiseState is h = SHA256(h || hepk)
|
||||
m_CurrentNoiseState.reset (new i2p::crypto::NoiseSymmetricState (*m_InitialNoiseState));
|
||||
memcpy (m_CurrentNoiseState->m_CK, m_InitialNoiseState->m_CK, 64);
|
||||
memcpy (m_CurrentNoiseState->m_H, m_InitialNoiseState->m_H, 32);
|
||||
m_CurrentNoiseState->MixHash (encrypted, 32); // h = SHA256(h || sepk)
|
||||
uint8_t sharedSecret[32];
|
||||
m_Decryptor->Decrypt (encrypted, sharedSecret, ctx, false);
|
||||
|
Loading…
Reference in New Issue
Block a user