encrypt ~key ~iv msg is
msg encrypted under
iv as the CBC initialization vector.
decrypt ~key ~iv msg is the inverse of
next_iv ~iv ciphertext is the first
iv following the encryption that used
iv to produce
For protocols which perform inter-message chaining, this is the
iv for the next message.
It is either
len ciphertext = 0, or the last block of
ciphertext. Note that
encrypt ~iv msg1 || encrypt ~iv:(next_iv ~iv (encrypt ~iv msg1)) msg2 == encrypt ~iv (msg1 || msg2)