AEAD.Noalloc
Versions of these functions which write their output in a buffer passed in as an argument
val encrypt :
st:t ->
iv:bytes ->
ad:bytes ->
pt:bytes ->
ct:bytes ->
tag:bytes ->
unit Error.result
encrypt st iv ad pt ct tag
takes a state st
, an initial value iv
, additional data ad
, and plaintext pt
, as well as output buffers ct
, which, if successful, will contain the encrypted pt
, and tag
, which will contain the authentication tag for the plaintext and the associated data.
val decrypt :
st:t ->
iv:bytes ->
ad:bytes ->
ct:bytes ->
tag:bytes ->
pt:bytes ->
unit Error.result
decrypt st iv ad ct tag pt
takes a state st
, the initial value iv
, additional data ad
, ciphertext ct
, and authentication tag tag
, as well as output buffer pt
, which, if successful, will contain the decrypted ct
.