pub unsafe extern "C" fn esp_aes_gcm_finish(
    ctx: *mut esp_gcm_context,
    output: *mut c_uchar,
    output_size: usize,
    output_length: *mut usize,
    tag: *mut c_uchar,
    tag_len: usize
) -> c_int
Expand description

\brief This function finishes the GCM operation and generates the authentication tag.

             It wraps up the GCM stream, and generates the
             tag. The tag can have a maximum length of 16 Bytes.

\param ctx The GCM context. This must be initialized. \param tag The buffer for holding the tag. This must be a writable buffer of at least \p tag_len Bytes. \param tag_len The length of the tag to generate. This must be at least four. \param output The buffer for the final output. If \p output_size is nonzero, this must be a writable buffer of at least \p output_size bytes. \param output_size The size of the \p output buffer in bytes. This must be large enough for the output that mbedtls_gcm_update() has not produced. In particular: - If mbedtls_gcm_update() produces immediate output, or if the total input size is a multiple of \c 16, then mbedtls_gcm_finish() never produces any output, so \p output_size can be \c 0. - \p output_size never needs to be more than \c 15. \param output_length On success, \p *output_length contains the actual length of the output written in \p output. On failure, the content of \p *output_length is unspecified.

\return \c 0 on success. \return #MBEDTLS_ERR_GCM_BAD_INPUT on failure: invalid value of \p tag_len, or \p output_size too small.