Function esp_idf_svc::sys::mbedtls_chachapoly_finish

source ยท
pub unsafe extern "C" fn mbedtls_chachapoly_finish(
    ctx: *mut mbedtls_chachapoly_context,
    mac: *mut u8,
) -> i32
Expand description

\brief This function finished the ChaCha20-Poly1305 operation and generates the MAC (authentication tag).

\param ctx The ChaCha20-Poly1305 context to use. This must be initialized. \param mac The buffer to where the 128-bit (16 bytes) MAC is written.

\warning Decryption with the piecewise API is discouraged, see the warning on \c mbedtls_chachapoly_init().

\return \c 0 on success. \return #MBEDTLS_ERR_CHACHAPOLY_BAD_STATE if the operation has not been started or has been finished. \return Another negative error code on other kinds of failure.