Module Psa.Aead

Authenticated encryption with associated data (AEAD).

See also Authenticated encryption with associcated data (AEAD) in Alg.

Single-part functions

val encrypt : key:Key_id.t -> Alg.t -> nonce:Bytesrw.Bytes.Slice.t -> ad:Bytesrw.Bytes.Slice.t -> plain:Bytesrw.Bytes.Slice.t -> cipher:Bytesrw.Bytes.Slice.t -> (int, Status.t) Stdlib.result
val decrypt : key:Key_id.t -> Alg.t -> nonce:Bytesrw.Bytes.Slice.t -> ad:Bytesrw.Bytes.Slice.t -> cipher:Bytesrw.Bytes.Slice.t -> plain:Bytesrw.Bytes.Slice.t -> (int, Status.t) Stdlib.result

Multi-part functions

module Operation : sig ... end

Cipher operations.

val encrypt_setup : Operation.t -> key:Key_id.t -> Alg.t -> Status.t
val decrypt_setup : Operation.t -> key:Key_id.t -> Alg.t -> Status.t
val set_lengths : Operation.t -> ad_length:int -> plain_length:int -> Status.t
val generate_nonce : Operation.t -> nonce:Bytesrw.Bytes.Slice.t -> (int, Status.t) Stdlib.result
val set_nonce : Operation.t -> nonce:Bytesrw.Bytes.Slice.t -> Status.t
val update_ad : Operation.t -> ad:Bytesrw.Bytes.Slice.t -> Status.t
val update : Operation.t -> input:Bytesrw.Bytes.Slice.t -> output:Bytesrw.Bytes.Slice.t -> (int, Status.t) Stdlib.result
val finish : Operation.t -> cipher:Bytesrw.Bytes.Slice.t -> tag:Bytesrw.Bytes.Slice.t -> (int * int, Status.t) Stdlib.result
val verify : Operation.t -> plain:Bytesrw.Bytes.Slice.t -> tag:Bytesrw.Bytes.Slice.t -> (int, Status.t) Stdlib.result
val abort : Operation.t -> Status.t

Support functions

val encrypt_output_size : Key_type.t -> Alg.t -> plain_length:int -> int
val encrypt_output_max_size : plain_length:int -> int
val decrypt_output_size : Key_type.t -> Alg.t -> cipher_length:int -> int
val decrypt_output_max_size : cipher_length:int -> int
val nonce_length : Key_type.t -> Alg.t -> int
val nonce_max_size : unit -> int
val update_output_size : Key_type.t -> Alg.t -> input_length:int -> int
val update_output_max_size : input_length:int -> int
val finish_output_size : Key_type.t -> Alg.t -> int
val finish_output_max_size : unit -> int
val tag_length : Key_type.t -> bits:int -> Alg.t -> int
val tag_max_size : unit -> int
val verify_output_size : Key_type.t -> Alg.t -> int
val verify_output_max_size : unit -> int