class type cipher_ctx =object..end
method padding : paddingThe padding scheme of the cipher
method block_constraint : intThe buffers used with encrypt/decrypt must have a length that is a multiple of this number. (In ECB mode this is the block size.)
This value doesn't take padding into account.
method supports_aead : boolWhether this cipher integrates authentication
method set_iv : string -> unitSets the initialization vector (this must be done before starting the encryption or decryption).
method set_header : string -> unitSets the header to authenticate for AEAD (this must be done before starting the encryption or decryption).
method encrypt : last:bool -> Netsys_types.memory -> Netsys_types.memory -> int * intlet n_in, n_out = encrypt ~last inbuf outbuf:
Encrypts the text in inbuf and
writes the result to outbuf. The returned numbers indicate how
much data was processed: the first n_in bytes of inbuf are
encrypted, and the first n_out bytes of outbuf are filled with
ciphertext.
This function can be called several
times to encrypt a larger text. last should be set for the last
call.
The sizes of inbuf and outbuf must be at least one block
in order to produce non-zero (n_in,n_out). (For `CTS only:
two blocks.)
method decrypt : last:bool -> Netsys_types.memory -> Netsys_types.memory -> int * intlet n_in, n_out = decrypt ~last inbuf outbuf:
Decrypts the text in inbuf and
writes the result to outbuf. The returned numbers indicate how
much data was processed: the first n_in bytes of inbuf are
decrypted, and the first n_out bytes of outbuf are filled with
plaintext.
This function can be called several
times to decrypt a larger text. last should be set for the last
call.
The sizes of inbuf and outbuf must be at least one block
in order to produce non-zero (n_in,n_out). (For `CTS only:
two blocks.)
On error, the method fails.
method encrypt_bytes : Stdlib.Bytes.t -> Stdlib.Bytes.tEncrypts this string as a whole
method encrypt_string : string -> stringEncrypts this string as a whole
method decrypt_bytes : Stdlib.Bytes.t -> Stdlib.Bytes.tDecrypts this string as a whole
method decrypt_string : string -> stringDecrypts this string as a whole
method mac : unit -> stringReturns the MAC for AEAD ciphers. Can first be called after the encryption/decryption is complete. This function fails for non-AEAD ciphers.