From: Niels Möller Date: Mon, 13 Jul 2020 19:29:02 +0000 (+0200) Subject: Tweak stop condition of _salsa20_crypt_2core X-Git-Tag: nettle_3.7rc1~90 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=097497ec6b93dc9b2b66afa8bd9321fb87dd6439;p=thirdparty%2Fnettle.git Tweak stop condition of _salsa20_crypt_2core Exit when processing exactly two blocks. --- diff --git a/salsa20-crypt-internal.c b/salsa20-crypt-internal.c index 1b9ca42b..da4732bc 100644 --- a/salsa20-crypt-internal.c +++ b/salsa20-crypt-internal.c @@ -64,7 +64,7 @@ _salsa20_crypt_2core(struct salsa20_ctx *ctx, unsigned rounds, _salsa20_2core (x, ctx->input, rounds); ctx->input[8] += 2; ctx->input[9] += (ctx->input[8] < 2); - if (length < 2 * SALSA20_BLOCK_SIZE) + if (length <= 2 * SALSA20_BLOCK_SIZE) { memxor3 (dst, src, x, length); return;