From 778b1802827798c94ba3df19193a0a7c8ec7570a Mon Sep 17 00:00:00 2001 From: subtly Date: Sat, 7 Mar 2015 18:36:27 +0100 Subject: [PATCH] aes256, as per the spec. --- libp2p/RLPxFrameIO.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/libp2p/RLPxFrameIO.cpp b/libp2p/RLPxFrameIO.cpp index b5185cd43..a3b3b5613 100644 --- a/libp2p/RLPxFrameIO.cpp +++ b/libp2p/RLPxFrameIO.cpp @@ -57,19 +57,19 @@ RLPXFrameIO::RLPXFrameIO(RLPXHandshake const& _init): m_socket(_init.m_socket) // aes-secret = sha3(ecdhe-shared-secret || shared-secret) sha3(keyMaterial, outRef); // output aes-secret - m_frameEncKey.resize(h128::size); - memcpy(m_frameEncKey.data(), outRef.data(), h128::size); - m_frameDecKey.resize(h128::size); - memcpy(m_frameDecKey.data(), outRef.data(), h128::size); + m_frameEncKey.resize(h256::size); + memcpy(m_frameEncKey.data(), outRef.data(), h256::size); + m_frameDecKey.resize(h256::size); + memcpy(m_frameDecKey.data(), outRef.data(), h256::size); h128 iv; - m_frameEnc.SetKeyWithIV(m_frameEncKey, h128::size, iv.data()); - m_frameDec.SetKeyWithIV(m_frameDecKey, h128::size, iv.data()); + m_frameEnc.SetKeyWithIV(m_frameEncKey, h256::size, iv.data()); + m_frameDec.SetKeyWithIV(m_frameDecKey, h256::size, iv.data()); // mac-secret = sha3(ecdhe-shared-secret || aes-secret) sha3(keyMaterial, outRef); // output mac-secret - m_macEncKey.resize(h128::size); - memcpy(m_macEncKey.data(), outRef.data(), h128::size); - m_macEnc.SetKey(m_macEncKey, h128::size); + m_macEncKey.resize(h256::size); + memcpy(m_macEncKey.data(), outRef.data(), h256::size); + m_macEnc.SetKey(m_macEncKey, h256::size); // Initiator egress-mac: sha3(mac-secret^recipient-nonce || auth-sent-init) // ingress-mac: sha3(mac-secret^initiator-nonce || auth-recvd-ack)