From 6a83cd05ec46a81d16ac67806a6eea321c7bd47a Mon Sep 17 00:00:00 2001 From: Frank Denis Date: Thu, 21 Mar 2019 09:27:55 +0100 Subject: [PATCH] Be positive --- test/default/stream.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/default/stream.c b/test/default/stream.c index 4c828819..df8dd86c 100644 --- a/test/default/stream.c +++ b/test/default/stream.c @@ -53,10 +53,10 @@ main(void) sodium_bin2hex(hex, 192 * 2 + 1, output, 192); printf("%s\n", hex); - for (i = -16; i < 0; i++) { + for (i = 16; i > 0; i--) { memset(output, 0, 17 * 64); crypto_stream_xsalsa20_xor_ic(output, output, 17 * 64, nonce, - (1ULL << 32) + (unsigned long long) i, + (1ULL << 32) - (unsigned long long) i, firstkey); sodium_bin2hex(hex, 2 * 17 * 64 + 1, output, 17 * 64); printf("%s\n", hex);