diff options
author | Jeffrey Walton <noloader@gmail.com> | 2019-01-25 02:34:07 -0500 |
---|---|---|
committer | Jeffrey Walton <noloader@gmail.com> | 2019-01-25 02:34:07 -0500 |
commit | acde2f8e5eacf697fccc746480ecd1615ffbf29b (patch) | |
tree | 283469b7338f21ef40d393a46413a9fd704ed87a /chacha.cpp | |
parent | 7923a97d2405733e1e9ac707b002d3262d00af88 (diff) | |
download | cryptopp-git-acde2f8e5eacf697fccc746480ecd1615ffbf29b.tar.gz |
Use word64 for ChaChaTLS InitialBlock (GH #265)
Diffstat (limited to 'chacha.cpp')
-rw-r--r-- | chacha.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -380,7 +380,7 @@ void ChaChaTLS_Policy::CipherSetKey(const NameValuePairs ¶ms, 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);
}
|