package mirage-crypto

  1. Overview
  2. Docs
type key
val of_secret : string -> key

Construct the encryption key corresponding to secret.

val key_sizes : int array

Key sizes allowed with this cipher.

val block_size : int

The size of a single block.

val encrypt : key:key -> string -> string

encrypt ~key src encrypts src into a freshly allocated buffer of the same size using key.

val decrypt : key:key -> string -> string

decrypt ~key src decrypts src into a freshly allocated buffer of the same size using key.

val encrypt_into : key:key -> string -> src_off:int -> bytes -> dst_off:int -> int -> unit

encrypt_into ~key src ~src_off dst dst_off len encrypts len octets from src starting at src_off into dst starting at dst_off.

val decrypt_into : key:key -> string -> src_off:int -> bytes -> dst_off:int -> int -> unit

decrypt_into ~key src ~src_off dst dst_off len decrypts len octets from src starting at src_off into dst starting at dst_off.

OCaml

Innovation. Community. Security.