mbedtls_gcm_finish() function
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.
Arguments
ctx
The GCM context. This must be initialized.
tag
The buffer for holding the tag. This must be a readable buffer of at least \p tag_len Bytes.
tag_len
The length of the tag to generate. This must be at least four.
Return value
\c 0 on success. #MBEDTLS_ERR_GCM_BAD_INPUT on failure.