mbedtls_md_finish() function
This function finishes the digest operation, and writes the result to the output buffer. Call this function after a call to mbedtls_md_starts(), followed by any number of calls to mbedtls_md_update(). Afterwards, you may either clear the context with mbedtls_md_free(), or call mbedtls_md_starts() to reuse the context for another digest operation with the same algorithm.
Arguments
ctx
The generic message-digest context.
output
The buffer for the generic message-digest checksum result.
Return value
\c 0 on success. #MBEDTLS_ERR_MD_BAD_INPUT_DATA on parameter-verification failure.