Closed palant closed 7 years ago
Here the loop implementing Salsa20 algorithm looks like this:
for (let i = 0; i < 8; i += 2) {
Given that the loop index isn't used, there are really only four loop iterations and the following code is equivalent:
for (let i = 0; i < 4; i++) {
Unless I'm somehow mistaken, that should be simplified to avoid confusion (it definitely confused me).
It's like this just to show that the number of Salsa20 rounds is 8. Pretty typical of Salsa20 implementations, e.g. see https://cr.yp.to/salsa20.html (20 rounds, each iteration is 2 rounds).
Here the loop implementing Salsa20 algorithm looks like this:
Given that the loop index isn't used, there are really only four loop iterations and the following code is equivalent:
Unless I'm somehow mistaken, that should be simplified to avoid confusion (it definitely confused me).