From cc1c5fae0f5008840b2c0b12cfca0b88bae065a9 Mon Sep 17 00:00:00 2001 From: Jeffrey Walton Date: Tue, 5 Feb 2019 13:41:36 -0500 Subject: [PATCH] Disable random access for XChaCha20 --- chacha.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/chacha.cpp b/chacha.cpp index c493e78a..45a706a1 100644 --- a/chacha.cpp +++ b/chacha.cpp @@ -546,12 +546,9 @@ void XChaCha20_Policy::CipherResynchronize(byte *keystreamBuffer, const byte *iv void XChaCha20_Policy::SeekToIteration(lword iterationCount) { - // Should we throw here??? If the initial block counter is - // large then we can wrap and process more data as long as - // data processed in the security context does not exceed - // 2^32 blocks or approximately 256 GB of data. - CRYPTOPP_ASSERT(iterationCount <= std::numeric_limits::max()); - m_state[12] = (word32)iterationCount; // low word + // Should we throw here??? XChaCha does not have a block + // counter, so I'm not sure how to seek on it. + CRYPTOPP_ASSERT(0); } unsigned int XChaCha20_Policy::GetAlignment() const