libcrux_hacl

Function Hacl_AEAD_Chacha20Poly1305_encrypt

Source
pub unsafe extern "C" fn Hacl_AEAD_Chacha20Poly1305_encrypt(
    output: *mut u8,
    tag: *mut u8,
    input: *mut u8,
    input_len: u32,
    data: *mut u8,
    data_len: u32,
    key: *mut u8,
    nonce: *mut u8,
)
Expand description

Encrypt a message input with key key.

The arguments key, nonce, data, and data_len are same in encryption/decryption. Note: Encryption and decryption can be executed in-place, i.e., input and output can point to the same memory.

@param output Pointer to input_len bytes of memory where the ciphertext is written to. @param tag Pointer to 16 bytes of memory where the mac is written to. @param input Pointer to input_len bytes of memory where the message is read from. @param input_len Length of the message. @param data Pointer to data_len bytes of memory where the associated data is read from. @param data_len Length of the associated data. @param key Pointer to 32 bytes of memory where the AEAD key is read from. @param nonce Pointer to 12 bytes of memory where the AEAD nonce is read from.