(** Poly1305 message authentication code. *) (** The signature of a Poly1305 MAC. *) module type S = sig type 'a iter = 'a Uncommon.iter (** An iterator. *) type t (** MAC computation state. *) val mac_size : int (** The MAC output size in bytes. *) val empty : key:string -> t (** [empty ~key] is a fresh MAC state keyed with [key]. @raise Invalid_argument if [key] is not 32 bytes. *) val feed : t -> string -> t (** [feed t data] feeds [data] into [t]. *) val feedi : t -> string iter -> t (** [feedi t iter] feeds an iterator of strings into [t]. *) val get : t -> string (** [get t] finalises and returns the MAC. *) val mac : key:string -> string -> string (** [mac ~key data] is the MAC of [data] under [key]. *) val maci : key:string -> string iter -> string (** [maci ~key iter] is the MAC of the concatenation of strings from [iter]. *) val mac_into : key:string -> (string * int * int) list -> bytes -> dst_off:int -> unit (** [mac_into ~key datas dst ~dst_off] computes the MAC of [datas] into [dst] at [dst_off] with bounds checking. *) val unsafe_mac_into : key:string -> (string * int * int) list -> bytes -> dst_off:int -> unit (** Like {!mac_into} without bounds checking. *) end module It : S (** Poly1305 MAC using the C implementation. *)