Function esp_idf_hal::sys::esp_aes_gcm_auth_decrypt
source ยท pub unsafe extern "C" fn esp_aes_gcm_auth_decrypt(
ctx: *mut esp_gcm_context,
length: usize,
iv: *const u8,
iv_len: usize,
aad: *const u8,
aad_len: usize,
tag: *const u8,
tag_len: usize,
input: *const u8,
output: *mut u8,
) -> i32
Expand description
\brief This function performs a GCM authenticated decryption of a buffer.
\note 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. \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 tag The buffer holding the tag. \param tag_len The length of the tag. \param input The buffer holding the input data. \param output The buffer for holding the output data.
\return 0 if successful and authenticated. \return #MBEDTLS_ERR_GCM_AUTH_FAILED if the tag does not match.