]> git.ipfire.org Git - thirdparty/nettle.git/commitdiff
Tweak stop condition of _salsa20_crypt_2core
authorNiels Möller <nisse@lysator.liu.se>
Mon, 13 Jul 2020 19:29:02 +0000 (21:29 +0200)
committerNiels Möller <nisse@lysator.liu.se>
Mon, 13 Jul 2020 19:29:02 +0000 (21:29 +0200)
Exit when processing exactly two blocks.

salsa20-crypt-internal.c

index 1b9ca42b0af41620c82f009794870311cddf9c63..da4732bcd192cb3a6d29460dead5c1a2b2daa5bc 100644 (file)
@@ -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;