Function esp_idf_svc::sys::mbedtls_cipher_finish
source ยท pub unsafe extern "C" fn mbedtls_cipher_finish(
ctx: *mut mbedtls_cipher_context_t,
output: *mut u8,
olen: *mut usize,
) -> i32
Expand description
\brief The generic cipher finalization function. If data still needs to be flushed from an incomplete block, the data contained in it is padded to the size of the last block, and written to the \p output buffer.
\param ctx The generic cipher context. This must be initialized and bound to a key. \param output The buffer to write data to. This needs to be a writable buffer of at least block_size Bytes. \param olen The length of the data written to the \p output buffer. This may not be \c NULL.
\return \c 0 on success. \return #MBEDTLS_ERR_CIPHER_BAD_INPUT_DATA on parameter-verification failure. \return #MBEDTLS_ERR_CIPHER_FULL_BLOCK_EXPECTED on decryption expecting a full block but not receiving one. \return #MBEDTLS_ERR_CIPHER_INVALID_PADDING on invalid padding while decrypting. \return A cipher-specific error code on failure.