|
| void | mbedtls_sha1_init (mbedtls_sha1_context *ctx) |
| | This function initializes a SHA-1 context. More...
|
| |
| void | mbedtls_sha1_free (mbedtls_sha1_context *ctx) |
| | This function clears a SHA-1 context. More...
|
| |
| void | mbedtls_sha1_clone (mbedtls_sha1_context *dst, const mbedtls_sha1_context *src) |
| | This function clones the state of a SHA-1 context. More...
|
| |
| int | mbedtls_sha1_starts (mbedtls_sha1_context *ctx) |
| | This function starts a SHA-1 checksum calculation. More...
|
| |
| int | mbedtls_sha1_update (mbedtls_sha1_context *ctx, const unsigned char *input, size_t ilen) |
| | This function feeds an input buffer into an ongoing SHA-1 checksum calculation. More...
|
| |
| int | mbedtls_sha1_finish (mbedtls_sha1_context *ctx, unsigned char output[20]) |
| | This function finishes the SHA-1 operation, and writes the result to the output buffer. More...
|
| |
| int | mbedtls_internal_sha1_process (mbedtls_sha1_context *ctx, const unsigned char data[64]) |
| | SHA-1 process data block (internal use only). More...
|
| |
| int | mbedtls_sha1 (const unsigned char *input, size_t ilen, unsigned char output[20]) |
| | This function calculates the SHA-1 checksum of a buffer. More...
|
| |
| int | mbedtls_sha1_self_test (int verbose) |
| | The SHA-1 checkup routine. More...
|
| |
This file contains SHA-1 definitions and functions.
The Secure Hash Algorithm 1 (SHA-1) cryptographic hash function is defined in FIPS 180-4: Secure Hash Standard (SHS).
- Warning
- SHA-1 is considered a weak message digest and its use constitutes a security risk. We recommend considering stronger message digests instead.
Definition in file sha1.h.
| int mbedtls_sha1 |
( |
const unsigned char * |
input, |
|
|
size_t |
ilen, |
|
|
unsigned char |
output[20] |
|
) |
| |
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.
- Parameters
-
| input | The buffer holding the input data. This must be a readable buffer of length ilen Bytes. |
| ilen | The length of the input data input in Bytes. |
| output | The SHA-1 checksum result. This must be a writable buffer of length 20 Bytes. |
- Returns
0 on success.
-
A negative error code on failure.