mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2026-08-13 14:47:50 +00:00
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:
+1
-1
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user