mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-04-28 11:47:48 +02:00
MixHash for SSU2 long header
This commit is contained in:
parent
d4ede6ff01
commit
a152f36894
3 changed files with 48 additions and 14 deletions
|
@ -1305,6 +1305,16 @@ namespace crypto
|
|||
SHA256_Final (m_H, &ctx);
|
||||
}
|
||||
|
||||
void NoiseSymmetricState::MixHash (const std::vector<std::pair<uint8_t *, size_t> >& bufs)
|
||||
{
|
||||
SHA256_CTX ctx;
|
||||
SHA256_Init (&ctx);
|
||||
SHA256_Update (&ctx, m_H, 32);
|
||||
for (const auto& it: bufs)
|
||||
SHA256_Update (&ctx, it.first, it.second);
|
||||
SHA256_Final (m_H, &ctx);
|
||||
}
|
||||
|
||||
void NoiseSymmetricState::MixKey (const uint8_t * sharedSecret)
|
||||
{
|
||||
HKDF (m_CK, sharedSecret, 32, "", m_CK);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue