Mirage_crypto.Poly1305
The poly1305 message authentication code
type mac = Cstruct.t
type 'a iter = ('a -> unit) -> unit
type t
Represents a running mac computation, suitable for appending inputs.
val mac_size : int
mac_size is the size of the output.
mac_size
val empty : key:Cstruct.t -> t
empty is the empty context with the given key.
empty
key
Invalid_argument
if key is not 32 bytes.
val feed : t -> Cstruct.t -> t
feed t msg adds the information in msg to t.
feed t msg
msg
t
val feedi : t -> Cstruct.t iter -> t
feedi t iter feeds iter into t.
feedi t iter
val get : t -> mac
get t is the mac corresponding to t.
get t
val mac : key:Cstruct.t -> Cstruct.t -> mac
mac ~key msg is the all-in-one mac computation: get (feed (empty ~key) msg).
mac ~key msg
get (feed (empty ~key) msg)
val maci : key:Cstruct.t -> Cstruct.t iter -> mac
maci ~key iter is the all-in-one mac computation: get (feedi (empty ~key) iter).
maci ~key iter
get (feedi (empty ~key) iter)