package hacl-star

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

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 a key, an initial value iv, additional data ad, and plaintext pt and returns a tuple containing the encrypted pt 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 a key, the initial value iv, additional data ad, ciphertext ct, and authentication tag tag, and, if successful, returns the decrypted ct.

module Noalloc : sig ... end

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

OCaml

Innovation. Community. Security.