Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source
Page
Library
Module
Module type
Parameter
Class
Class type
Source
AES.CCM16include AEADval of_secret : string -> keyof_secret secret constructs the encryption key corresponding to secret.
val authenticate_encrypt :
key:key ->
nonce:string ->
?adata:string ->
string ->
stringauthenticate_encrypt ~key ~nonce ~adata msg encrypts msg with key and nonce, and appends an authentication tag computed over the encrypted msg, using key, nonce, and adata.
val authenticate_decrypt :
key:key ->
nonce:string ->
?adata:string ->
string ->
string optionauthenticate_decrypt ~key ~nonce ~adata msg splits msg into encrypted data and authentication tag, computes the authentication tag using key, nonce, and adata, and decrypts the encrypted data. If the authentication tags match, the decrypted data is returned.
val authenticate_encrypt_tag :
key:key ->
nonce:string ->
?adata:string ->
string ->
string * stringauthenticate_encrypt_tag ~key ~nonce ~adata msg encrypts msg with key and nonce. The computed authentication tag is returned separately as second part of the tuple.
val authenticate_decrypt_tag :
key:key ->
nonce:string ->
?adata:string ->
tag:string ->
string ->
string optionauthenticate_decrypt ~key ~nonce ~adata ~tag msg computes the authentication tag using key, nonce, and adata, and decrypts the encrypted data. If the authentication tags match, the decrypted data is returned.
val authenticate_encrypt_into :
key:key ->
nonce:string ->
?adata:string ->
string ->
src_off:int ->
bytes ->
dst_off:int ->
tag_off:int ->
int ->
unitauthenticate_encrypt_into ~key ~nonce ~adata msg ~src_off dst ~dst_off ~tag_off len encrypts len bytes of msg starting at src_off with key and nonce. The output is put into dst at dst_off, the tag into dst at tag_off.
val authenticate_decrypt_into :
key:key ->
nonce:string ->
?adata:string ->
string ->
src_off:int ->
tag_off:int ->
bytes ->
dst_off:int ->
int ->
boolauthenticate_decrypt_into ~key ~nonce ~adata msg ~src_off ~tag_off dst ~dst_off len computes the authentication tag using key, nonce, and adata, and decrypts the len bytes encrypted data from msg starting at src_off into dst starting at dst_off. If the authentication tags match, true is returned, and the decrypted data is in dst.