package salsa20-core

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Source file salsa20_core.ml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
module Salsa_Core = struct
  external salsa_core : int -> string -> bytes -> unit = "caml_salsa_core" [@@noalloc]
end

let salsa20_core count i =
  let l = 64 in
  if String.length i <> l then invalid_arg "input must be 16 blocks of 32 bits"
  else
    let o = Bytes.create l in
    Salsa_Core.salsa_core count i o;
    Bytes.unsafe_to_string o

let salsa20_8_core i =
  salsa20_core 4 i

let salsa20_12_core i =
  salsa20_core 6 i

let salsa20_20_core i =
  salsa20_core 10 i
OCaml

Innovation. Community. Security.