The buffers tested for equality were too short. Now we test the whole
of them.
Note: this may not be the only instance of this error.
RANDOM_INPUT(nonce, 8);
crypto_chacha20(output, input, INPUT_SIZE, key, nonce);
crypto_chacha20(input , input, INPUT_SIZE, key, nonce);
- status |= memcmp(output, input, CHACHA_BLOCK_SIZE);
+ status |= memcmp(output, input, INPUT_SIZE);
printf("%s: Chacha20 (output == input)\n", status != 0 ? "FAILED" : "OK");
return status;
}