From e4a1bd5b031e418a3c593c25cda5dc7996564ee7 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Sat, 7 Feb 2015 16:37:19 +0000 Subject: Fix cryptobox logic. --- src/libcryptobox/chacha20/chacha.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/libcryptobox/chacha20') diff --git a/src/libcryptobox/chacha20/chacha.c b/src/libcryptobox/chacha20/chacha.c index caeba8edc..a165bea63 100644 --- a/src/libcryptobox/chacha20/chacha.c +++ b/src/libcryptobox/chacha20/chacha.c @@ -170,7 +170,7 @@ chacha_update (chacha_state *S, const unsigned char *in, unsigned char *out, size_t bytes; /* enough for at least one block? */ - if ((state->leftover + inlen) >= CHACHA_BLOCKBYTES) { + while ((state->leftover + inlen) >= CHACHA_BLOCKBYTES) { /* handle the previous data */ if (state->leftover) { bytes = (CHACHA_BLOCKBYTES - state->leftover); -- cgit v1.2.3