Module EverCrypt.Chacha20_Poly1305
Multiplexing interface for Chacha20-Poly1305
type bytes
= SharedDefs.CBytes.t
val encrypt : key:bytes -> iv:bytes -> ad:bytes -> pt:bytes -> bytes * bytes
encrypt key iv ad pt
takes akey
, an initial valueiv
, additional dataad
, and plaintextpt
and returns a tuple containing the encryptedpt
and the authentication tag for the plaintext and the associated data.
val decrypt : key:bytes -> iv:bytes -> ad:bytes -> ct:bytes -> tag:bytes -> bytes option
decrypt key iv ad ct tag
takes akey
, the initial valueiv
, additional dataad
, ciphertextct
, and authentication tagtag
, and, if successful, returns the decryptedct
.
module Noalloc : sig ... end
Versions of these functions which write their output in a buffer passed in as an argument