Browse Source

use HKDF for NTCP2 key derivation data phase

pull/1491/head
orignal 5 years ago
parent
commit
db84be2488
  1. 2
      libi2pd/NTCP2.cpp

2
libi2pd/NTCP2.cpp

@ -450,7 +450,7 @@ namespace transport
memcpy (h, m_Establisher->GetH (), 32); memcpy (h, m_Establisher->GetH (), 32);
memcpy (h + 32, "siphash", 7); memcpy (h + 32, "siphash", 7);
i2p::crypto::HKDF (master, h, 39, "", master, 32); // sip_master = HKDF(ask_master, h || "siphash") i2p::crypto::HKDF (master, h, 39, "", master, 32); // sip_master = HKDF(ask_master, h || "siphash")
i2p::crypto::HKDF (master, nullptr, 0, "", k, 64); // sipkeys_ab, sipkeys_ba = HKDF(sip_master, zerolen) i2p::crypto::HKDF (master, nullptr, 0, "", k); // sipkeys_ab, sipkeys_ba = HKDF(sip_master, zerolen)
memcpy (m_Sipkeysab, k, 32); memcpy (m_Sipkeysba, k + 32, 32); memcpy (m_Sipkeysab, k, 32); memcpy (m_Sipkeysba, k + 32, 32);
} }

Loading…
Cancel
Save