pub unsafe extern "C" fn mbedtls_chachapoly_auth_decrypt(
    ctx: *mut mbedtls_chachapoly_context,
    length: usize,
    nonce: *const c_uchar,
    aad: *const c_uchar,
    aad_len: usize,
    tag: *const c_uchar,
    input: *const c_uchar,
    output: *mut c_uchar
) -> c_int
Expand description

\brief This function performs a complete ChaCha20-Poly1305 authenticated decryption with the previously-set key.

\note Before using this function, you must set the key with \c mbedtls_chachapoly_setkey().

\param ctx The ChaCha20-Poly1305 context to use (holds the key). \param length The length (in Bytes) of the data to decrypt. \param nonce The \c 96 Bit (\c 12 bytes) nonce/IV to use. \param aad The buffer containing the additional authenticated data (AAD). This pointer can be \c NULL if aad_len == 0. \param aad_len The length (in bytes) of the AAD data to process. \param tag The buffer holding the authentication tag. This must be a readable buffer of length \c 16 Bytes. \param input The buffer containing the data to decrypt. This pointer can be \c NULL if ilen == 0. \param output The buffer to where the decrypted data is written. This pointer can be \c NULL if ilen == 0.

\return \c 0 on success. \return #MBEDTLS_ERR_CHACHAPOLY_AUTH_FAILED if the data was not authentic. \return Another negative error code on other kinds of failure.