Module Chacha20_Poly1305.Noalloc

Versions of these functions which write their output in a buffer passed in as an argument

val encrypt : key:bytes -> iv:bytes -> ad:bytes -> pt:bytes -> ct:bytes -> tag:bytes -> unit

encrypt key iv ad pt ct tag takes a key, an initial value iv, additional data ad, and plaintext pt, as well as output buffers ct, which will contain the encrypted pt, and tag, which will contain the authentication tag for the plaintext and the associated data.

val decrypt : key:bytes -> iv:bytes -> ad:bytes -> ct:bytes -> tag:bytes -> pt:bytes -> bool

decrypt key iv ad ct tag pt takes a key, the initial value iv, additional data ad, ciphertext ct, and authentication tag tag, as well as output buffer pt, which, if successful, will contain the decrypted ct.