I am currently implementing Salsa20 from the specification as an exercise in learning and self-flagellation.
I have Sections 1-7 passing the test examples provided. I am now stuck on Section 8, The Salsa20 hash function (Page 6):
1) What is confusing is the doubleround$^1$$^0$. What does this mean exactly? Perform the doubleround function $10$ times on the $x$ words from earlier? I.e. I perform doubleround($x$) once, then feed the result of that back into the doubleround function again, then repeat that 8 more times?
2) After that it does a littleendian$^-$$^1$($z0 + x0$). I know what the littleendian function is as it was defined previously in Section 7. But what is littleendian$^-$$^1$? The inverse of it? Do I simply pass the result of the $z0$ and $x0$ addition back into the normal littleendian function again (which as a byproduct would reverse the results of the littleendian function)?
3) To produce the final output, do I concatenate the 16 words (4 bytes per word) from the littleendian$^-$$^1$ function together, then convert them to bytes to get the resulting 64-byte sequence?
Perhaps some psuedo code would answer these questions more succinctly.
Gracias amigos.