Function esp_idf_svc::hal::sys::esp_aes_gcm_crypt_and_tag
source ยท pub unsafe extern "C" fn esp_aes_gcm_crypt_and_tag(
ctx: *mut esp_gcm_context,
mode: i32,
length: usize,
iv: *const u8,
iv_len: usize,
aad: *const u8,
aad_len: usize,
input: *const u8,
output: *mut u8,
tag_len: usize,
tag: *mut u8,
) -> i32
Expand description
\brief This function performs GCM encryption or decryption of a buffer.
\note For encryption, the output buffer can be the same as the input buffer. For decryption, the output buffer cannot be the same as input buffer. If the buffers overlap, the output buffer must trail at least 8 Bytes behind the input buffer.
\param ctx The GCM context to use for encryption or decryption. \param mode The operation to perform: #MBEDTLS_GCM_ENCRYPT or #MBEDTLS_GCM_DECRYPT. \param length The length of the input data. This must be a multiple of 16 except in the last call before mbedtls_gcm_finish(). \param iv The initialization vector. \param iv_len The length of the IV. \param aad The buffer holding the additional data. \param aad_len The length of the additional data. \param input The buffer holding the input data. \param output The buffer for holding the output data. \param tag_len The length of the tag to generate. \param tag The buffer for holding the tag.
\return \c 0 on success.