Function hacl_sys::Hacl_Chacha20Poly1305_256_aead_encrypt
source · pub unsafe extern "C" fn Hacl_Chacha20Poly1305_256_aead_encrypt(
k: *mut u8,
n: *mut u8,
aadlen: u32,
aad: *mut u8,
mlen: u32,
m: *mut u8,
cipher: *mut u8,
mac: *mut u8
)
Expand description
Encrypt a message m
with key k
.
The arguments k
, n
, aadlen
, and aad
are same in encryption/decryption.
Note: Encryption and decryption can be executed in-place, i.e., m
and cipher
can point to the same memory.
@param k Pointer to 32 bytes of memory where the AEAD key is read from.
@param n Pointer to 12 bytes of memory where the AEAD nonce is read from.
@param aadlen Length of the associated data.
@param aad Pointer to aadlen
bytes of memory where the associated data is read from.
@param mlen Length of the message.
@param m Pointer to mlen
bytes of memory where the message is read from.
@param cipher Pointer to mlen
bytes of memory where the ciphertext is written to.
@param mac Pointer to 16 bytes of memory where the mac is written to.