Although 8 rounds most likely provide enough security [1], ChaCha20
brings us in alignment with Linux, and allows us to implement tests
using the vectors defined in RFC8439.
[1] https://eprint.iacr.org/2019/1492.pdf
Signed-off-by: Michalis Pappas <michalis@unikraft.io>
Reviewed-by: Maria Pana <maria.pana4@gmail.com>
Reviewed-by: Alex Apostolescu <alexx.apostolescu@gmail.com>
Reviewed-by: Simon Kuenzer <simon@unikraft.io>
Approved-by: Simon Kuenzer <simon@unikraft.io>
GitHub-Closes: #1496
for (i = 0; i < 16; i++)
output[i] = input[i];
- for (i = 8; i > 0; i -= 2) {
+ for (i = 20; i > 0; i -= 2) {
uk_quarterround(output, 0, 4, 8, 12);
uk_quarterround(output, 1, 5, 9, 13);
uk_quarterround(output, 2, 6, 10, 14);