mbedtls_sha1() function
This function calculates the SHA-1 checksum of a buffer. The function allocates the context, performs the calculation, and frees the context. The SHA-1 result is calculated as output = SHA-1(input buffer). \warning SHA-1 is considered a weak message digest and its use constitutes a security risk. We recommend considering stronger message digests instead.
Syntax
int mbedtls_sha1(const unsigned char *input,
size_t ilen,
unsigned char output[20]);
Arguments
input
The buffer holding the input data. This must be a readable buffer of length \p ilen Bytes.
ilen
The length of the input data \p input in Bytes.
output
The SHA-1 checksum result. This must be a writable buffer of length \c 20 Bytes.
Return value
\c 0 on success. A negative error code on failure.
mbedtls_sha1() is called by 1 function and calls 5 functions:
![]()
mbedtls_sha1()
mbedtls_sha1():
![]()
mbedtls_sha1()