mbedtls_sha256_ret() function
This function calculates the SHA-224 or SHA-256 checksum of a buffer. The function allocates the context, performs the calculation, and frees the context. The SHA-256 result is calculated as output = SHA-256(input buffer).
Syntax
int mbedtls_sha256_ret( const unsigned char *input,
size_t ilen,
unsigned char output[32],
int is224 );
Arguments
input
The buffer holding the data. This must be a readable buffer of length \p ilen Bytes.
ilen
The length of the input data in Bytes.
output
The SHA-224 or SHA-256 checksum result. This must be a writable buffer of length \c 32 Bytes.
is224
Determines which function to use. This must be either \c 0 for SHA-256, or \c 1 for SHA-224.