summaryrefslogtreecommitdiff
path: root/chacha.cpp
diff options
context:
space:
mode:
authorJeffrey Walton <noloader@gmail.com>2019-01-25 02:34:07 -0500
committerJeffrey Walton <noloader@gmail.com>2019-01-25 02:34:07 -0500
commitacde2f8e5eacf697fccc746480ecd1615ffbf29b (patch)
tree283469b7338f21ef40d393a46413a9fd704ed87a /chacha.cpp
parent7923a97d2405733e1e9ac707b002d3262d00af88 (diff)
downloadcryptopp-git-acde2f8e5eacf697fccc746480ecd1615ffbf29b.tar.gz
Use word64 for ChaChaTLS InitialBlock (GH #265)
Diffstat (limited to 'chacha.cpp')
-rw-r--r--chacha.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/chacha.cpp b/chacha.cpp
index 1b2e813e..9b8117af 100644
--- a/chacha.cpp
+++ b/chacha.cpp
@@ -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);
}