Use word64 for ChaChaTLS InitialBlock (GH #265)

pull/795/head
Jeffrey Walton 2019-01-25 02:34:07 -05:00
parent 7923a97d24
commit acde2f8e5e
No known key found for this signature in database
GPG Key ID: B36AB348921B1838
1 changed files with 3 additions and 3 deletions

View File

@ -380,7 +380,7 @@ void ChaChaTLS_Policy::CipherSetKey(const NameValuePairs &params, const byte *ke
// RFC 7539 test vectors use an initial block counter. However, some of them
// don't start at 0. If Resynchronize() is called we set to 0. Hence, stash
// the initial block counter in m_state[16]. Then use it in Resynchronize().
int block;
word64 block;
if (params.GetValue("InitialBlock", block))
m_state[16] = static_cast<word32>(block);
else
@ -605,8 +605,8 @@ void ChaChaTLS_Policy::OperateKeystream(KeystreamOperation operation,
{
// m_state[13]++;
// RFC 7539 does not say what to do here. ChaCha-TLS uses state[13]
// for part of the nonce. We can't carry into it. Shit or go blind...
// RFC 7539 does not say what to do here. ChaCha-TLS uses state[13] for
// part of the nonce, and we can't carry into it. Shit or go blind...
// https://mailarchive.ietf.org/arch/msg/saag/S0_YjVkzEx2s2bHd8KIzjK1CwZ4
CRYPTOPP_ASSERT(0);
}