An OCaml implementation of Salsa20 Core functions, both Salsa20/20 Core and the reduced Salsa20/8 Core and Salsa20/12 Core functions. The hot loop is implemented in C for efficiency reasons.
Salsa 20 Core are functions from 64-byte strings to 64-byte strings.
opam install salsa20-core
utop[0]> #require "salsa20-core";;
utop[1]> 0
|> Char.chr
|> String.make 64
|> Salsa20_core.salsa20_20_core (* or salsa20_12_core / salsa20_8_core *);;
- : string =
"\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"