mbedtls_cipher_finish() is only used within mbedTLS.
 
Symbols
loading...
Files
loading...

mbedtls_cipher_finish() function

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.

Syntax

int mbedtls_cipher_finish( mbedtls_cipher_context_t *ctx,     unsigned char *output,     size_t *olen );
Implemented in cipher.c:762

Arguments

ctx

The generic cipher context. This must be initialized and bound to a key.

output

The buffer to write data to. This needs to be a writable buffer of at least \p block_size Bytes.

olen

The length of the data written to the \p output buffer. This may not be \c NULL.

Return value

\c 0 on success. #MBEDTLS_ERR_CIPHER_BAD_INPUT_DATA on parameter-verification failure. #MBEDTLS_ERR_CIPHER_FULL_BLOCK_EXPECTED on decryption expecting a full block but not receiving one. #MBEDTLS_ERR_CIPHER_INVALID_PADDING on invalid padding while decrypting. A cipher-specific error code on failure.