summaryrefslogtreecommitdiff
path: root/chacha.cpp
diff options
context:
space:
mode:
authorJeffrey Walton <noloader@gmail.com>2019-01-25 19:04:34 -0500
committerJeffrey Walton <noloader@gmail.com>2019-01-25 19:04:34 -0500
commit779e28a9b0ced5eb7a16c79a318501d5f04e6a13 (patch)
treee9a03775599a8bf204b0ab2f3cdf0c6970c9b35f /chacha.cpp
parentc1f9b484b76e85c4435694f18d198d65a44b878a (diff)
downloadcryptopp-git-779e28a9b0ced5eb7a16c79a318501d5f04e6a13.tar.gz
Update comments
Diffstat (limited to 'chacha.cpp')
-rw-r--r--chacha.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/chacha.cpp b/chacha.cpp
index 3676eaf7..2514aeb1 100644
--- a/chacha.cpp
+++ b/chacha.cpp
@@ -79,10 +79,11 @@ typedef word32 WordType;
enum {BYTES_PER_ITERATION=64};
// MultiBlockSafe detects a condition that can arise in the SIMD
-// implementations where we overflow one of the 32-bit state words
-// during addition in an intermediate result. Conditions to trigger
-// issue include a user seeks to around 2^32 blocks (256 GB of data).
-// https://github.com/weidai11/cryptopp/issues/732
+// implementations where we overflow one of the 32-bit state words during
+// addition in an intermediate result. Preconditions for the issue include
+// a user seeks to around 2^32 blocks (256 GB of data) for ChaCha; or a
+// user specifies an arbitrarily large initial counter block for ChaChaTLS.
+// Also see https://github.com/weidai11/cryptopp/issues/732.
inline bool MultiBlockSafe(unsigned int ctrLow, unsigned int blocks)
{
return 0xffffffff - ctrLow > blocks;