Correct logic for keystream_bytes_used

Co-authored-by: minosgalanakis <[email protected]>
Signed-off-by: Ben Taylor <[email protected]>
(cherry picked from commit 8de9f6aa776d5e92d77b10dfca6666f83f542ab2)
This commit is contained in:
Ben Taylor
2026-06-11 14:11:24 +01:00
committed by Ben Taylor
parent bac83ee5de
commit 4ee90fe0e6
+1 -1
View File
@@ -210,7 +210,7 @@ int mbedtls_chacha20_check_counter_wrap(const mbedtls_chacha20_context *ctx,
size_t available_keystream = 0;
uint64_t needed_blocks = 0;
if (ctx->keystream_bytes_used == CHACHA20_COUNTER_EXHAUSTED) {
if (ctx->keystream_bytes_used >= CHACHA20_COUNTER_EXHAUSTED) {
return size == 0U ? 0 : MBEDTLS_ERR_CHACHA20_BAD_INPUT_DATA;
}