The SHA-1 cryptographic hash function. More...
#include "config.h"
#include <stddef.h>
#include <stdint.h>
Go to the source code of this file.
Data Structures | |
struct | mbedtls_sha1_context |
The SHA-1 context structure. More... | |
Defines | |
#define | MBEDTLS_ERR_SHA1_HW_ACCEL_FAILED -0x0035 |
#define | MBEDTLS_DEPRECATED |
#define | MBEDTLS_DEPRECATED |
Functions | |
void | mbedtls_sha1_init (mbedtls_sha1_context *ctx) |
This function initializes a SHA-1 context. | |
void | mbedtls_sha1_free (mbedtls_sha1_context *ctx) |
This function clears a SHA-1 context. | |
void | mbedtls_sha1_clone (mbedtls_sha1_context *dst, const mbedtls_sha1_context *src) |
This function clones the state of a SHA-1 context. | |
int | mbedtls_sha1_starts_ret (mbedtls_sha1_context *ctx) |
This function starts a SHA-1 checksum calculation. | |
int | mbedtls_sha1_update_ret (mbedtls_sha1_context *ctx, const unsigned char *input, size_t ilen) |
This function feeds an input buffer into an ongoing SHA-1 checksum calculation. | |
int | mbedtls_sha1_finish_ret (mbedtls_sha1_context *ctx, unsigned char output[20]) |
This function finishes the SHA-1 operation, and writes the result to the output buffer. | |
int | mbedtls_internal_sha1_process (mbedtls_sha1_context *ctx, const unsigned char data[64]) |
SHA-1 process data block (internal use only). | |
static MBEDTLS_DEPRECATED void | mbedtls_sha1_starts (mbedtls_sha1_context *ctx) |
SHA-1 context setup. | |
static MBEDTLS_DEPRECATED void | mbedtls_sha1_update (mbedtls_sha1_context *ctx, const unsigned char *input, size_t ilen) |
SHA-1 process buffer. | |
static MBEDTLS_DEPRECATED void | mbedtls_sha1_finish (mbedtls_sha1_context *ctx, unsigned char output[20]) |
SHA-1 final digest. | |
static MBEDTLS_DEPRECATED void | mbedtls_sha1_process (mbedtls_sha1_context *ctx, const unsigned char data[64]) |
SHA-1 process data block (internal use only). | |
int | mbedtls_sha1_ret (const unsigned char *input, size_t ilen, unsigned char output[20]) |
This function calculates the SHA-1 checksum of a buffer. | |
static MBEDTLS_DEPRECATED void | mbedtls_sha1 (const unsigned char *input, size_t ilen, unsigned char output[20]) |
Output = SHA-1( input buffer ). | |
int | mbedtls_sha1_self_test (int verbose) |
The SHA-1 checkup routine. |
The SHA-1 cryptographic hash function.
Definition in file sha1.h.
#define MBEDTLS_ERR_SHA1_HW_ACCEL_FAILED -0x0035 |
int mbedtls_internal_sha1_process | ( | mbedtls_sha1_context * | ctx, | |
const unsigned char | data[64] | |||
) |
SHA-1 process data block (internal use only).
ctx | SHA-1 context | |
data | The data block being processed. |
0
if successfulReferenced by mbedtls_sha1_process().
static MBEDTLS_DEPRECATED void mbedtls_sha1 | ( | const unsigned char * | input, | |
size_t | ilen, | |||
unsigned char | output[20] | |||
) | [inline, static] |
Output = SHA-1( input buffer ).
input | The buffer holding the input data. | |
ilen | The length of the input data. | |
output | The SHA-1 checksum result. |
Definition at line 320 of file sha1.h.
References mbedtls_sha1_ret().
void mbedtls_sha1_clone | ( | mbedtls_sha1_context * | dst, | |
const mbedtls_sha1_context * | src | |||
) |
This function clones the state of a SHA-1 context.
dst | The destination context. | |
src | The context to clone. |
static MBEDTLS_DEPRECATED void mbedtls_sha1_finish | ( | mbedtls_sha1_context * | ctx, | |
unsigned char | output[20] | |||
) | [inline, static] |
SHA-1 final digest.
ctx | The SHA-1 context. | |
output | The SHA-1 checksum result. |
Definition at line 234 of file sha1.h.
References mbedtls_sha1_finish_ret().
int mbedtls_sha1_finish_ret | ( | mbedtls_sha1_context * | ctx, | |
unsigned char | output[20] | |||
) |
This function finishes the SHA-1 operation, and writes the result to the output buffer.
ctx | The SHA-1 context. | |
output | The SHA-1 checksum result. |
0
if successfulReferenced by mbedtls_sha1_finish().
void mbedtls_sha1_free | ( | mbedtls_sha1_context * | ctx | ) |
This function clears a SHA-1 context.
ctx | The SHA-1 context to clear. |
void mbedtls_sha1_init | ( | mbedtls_sha1_context * | ctx | ) |
This function initializes a SHA-1 context.
ctx | The SHA-1 context to initialize. |
static MBEDTLS_DEPRECATED void mbedtls_sha1_process | ( | mbedtls_sha1_context * | ctx, | |
const unsigned char | data[64] | |||
) | [inline, static] |
SHA-1 process data block (internal use only).
ctx | The SHA-1 context. | |
data | The data block being processed. |
Definition at line 254 of file sha1.h.
References mbedtls_internal_sha1_process().
int mbedtls_sha1_ret | ( | 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).
input | The buffer holding the input data. | |
ilen | The length of the input data. | |
output | The SHA-1 checksum result. |
0
if successfulReferenced by mbedtls_sha1().
int mbedtls_sha1_self_test | ( | int | verbose | ) |
The SHA-1 checkup routine.
0
on success, or 1
on failure.static MBEDTLS_DEPRECATED void mbedtls_sha1_starts | ( | mbedtls_sha1_context * | ctx | ) | [inline, static] |
SHA-1 context setup.
ctx | The SHA-1 context to be initialized. |
Definition at line 193 of file sha1.h.
References mbedtls_sha1_starts_ret().
int mbedtls_sha1_starts_ret | ( | mbedtls_sha1_context * | ctx | ) |
This function starts a SHA-1 checksum calculation.
ctx | The context to initialize. |
0
if successfulReferenced by mbedtls_sha1_starts().
static MBEDTLS_DEPRECATED void mbedtls_sha1_update | ( | mbedtls_sha1_context * | ctx, | |
const unsigned char * | input, | |||
size_t | ilen | |||
) | [inline, static] |
SHA-1 process buffer.
ctx | The SHA-1 context. | |
input | The buffer holding the input data. | |
ilen | The length of the input data. |
Definition at line 213 of file sha1.h.
References mbedtls_sha1_update_ret().
int mbedtls_sha1_update_ret | ( | mbedtls_sha1_context * | ctx, | |
const unsigned char * | input, | |||
size_t | ilen | |||
) |
This function feeds an input buffer into an ongoing SHA-1 checksum calculation.
ctx | The SHA-1 context. | |
input | The buffer holding the input data. | |
ilen | The length of the input data. |
0
if successfulReferenced by mbedtls_sha1_update().