Module Chacha
ChaCha, a variant of Salsa20 specifies a ChaCha20 encryption function as well as a set of reduced Chacha8 and Chacha12 encryption functions.
val create : ?hash:(Cstruct.t -> Cstruct.t) -> Cstruct.t -> Cstruct.t -> tcreate key nonceisstate, the ChaCha20 encryption/decryption function state.hashis Chacha_core.chacha20_core by default (recommended), Chacha_core.chacha12 or Chacha_core.chacha8 could also be used instead.keyis either a 32 (recommended) or 16 bytes.nonceis 8 bytes.- raises Invalid_argument
if
keyornonceis not of the correct size
val encrypt : Cstruct.t -> t -> Cstruct.tencrypt input stateisoutput, the ChaCha encryption function.
val decrypt : Cstruct.t -> t -> Cstruct.tencrypt input stateisoutput, the ChaCha decryption function.