2018-09-07 09:52:05 +00:00
|
|
|
type state =
|
|
|
|
{
|
|
|
|
mutable prev_v: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
val init : string -> state
|
2018-10-04 07:40:32 +00:00
|
|
|
(** [init iv] is the initial state using [iv] a the initialization vector. *)
|
2018-09-07 09:52:05 +00:00
|
|
|
val encrypt : state -> (string -> string) -> string -> string
|
2018-10-04 07:40:32 +00:00
|
|
|
(** Encrypt a single block in CBC mode. *)
|
2018-09-07 09:52:05 +00:00
|
|
|
val decrypt : state -> (string -> string) -> string -> string
|
2018-10-04 07:40:32 +00:00
|
|
|
(** Decrypt a single block in CBC mode. *)
|