# is this implementation real salsa20?

https://raw.githubusercontent.com/andres-erbsen/salsa20/master/salsa20.c

I tried it, and it's working fine. Now question: is it real salsa20?

• There is a codereview.SE for this kind of questions. – kelalaka Jan 13 '20 at 15:06
• @kelalaka: not quite - codereview will tell if it's correctly written and maintainable code; he's asking whether it implements a very specific functionality. The best answer to that might be to give him some test vectors to try out (I don't have any myself) – poncho Jan 13 '20 at 15:21
• @kelaka & poncho Well, you can also ask about security of the written code there, however I do know they accept your own written code, not that of somebody else: "For licensing, moral, and procedural reasons, we cannot review code written by other programmers. We expect you, as the author, to understand why the code is written the way that it is.". – Maarten Bodewes Jan 13 '20 at 15:33
• @poncho I've provided some links then. – kelalaka Jan 13 '20 at 16:10
• Off topic here. However the first step would be to confirm that you get the right output for an extensive set of test vectors. Then check if an implementation corresponds step-by-step with the algorithm's specification. Missing steps could be exploitable bugs. Additional steps could be intentional back doors or unintentional side channel attack vectors. That's quite insufficient in general, but to truly evaluate an implementation requires relatively arcane knowledge of hardware, programming languages, compilers, and a serious understanding of how a cryptographic algorithm is meant to be used. – Future Security Jan 13 '20 at 19:48

• The Salsa20 specification paper contains examples for testing for each function. quarterround 7 example, rowround 2 example, etc..