Mbed OS Reference
|
Data Structures | |
struct | mbedtls_sha1_context |
The SHA-1 context structure. More... | |
Macros | |
#define | MBEDTLS_ERR_SHA1_HW_ACCEL_FAILED -0x0035 |
SHA-1 hardware accelerator failed. More... | |
#define | MBEDTLS_ERR_SHA1_BAD_INPUT_DATA -0x0073 |
SHA-1 input data was malformed. More... | |
Typedefs | |
typedef struct mbedtls_sha1_context | mbedtls_sha1_context |
The SHA-1 context structure. More... | |
Functions | |
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_ret (mbedtls_sha1_context *ctx) |
This function starts a SHA-1 checksum calculation. More... | |
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. More... | |
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. More... | |
int | mbedtls_internal_sha1_process (mbedtls_sha1_context *ctx, const unsigned char data[64]) |
SHA-1 process data block (internal use only). More... | |
void | mbedtls_sha1_starts (mbedtls_sha1_context *ctx) |
This function starts a SHA-1 checksum calculation. More... | |
void | 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... | |
void | 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... | |
void | mbedtls_sha1_process (mbedtls_sha1_context *ctx, const unsigned char data[64]) |
SHA-1 process data block (internal use only). More... | |
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. More... | |
void | mbedtls_sha1 (const unsigned char *input, size_t ilen, unsigned char output[20]) |
This function calculates the SHA-1 checksum of a buffer. More... | |
#define MBEDTLS_ERR_SHA1_HW_ACCEL_FAILED -0x0035 |
SHA-1 hardware accelerator failed.
Definition at line 49 of file mbedtls/include/mbedtls/sha1.h.
#define MBEDTLS_ERR_SHA1_BAD_INPUT_DATA -0x0073 |
SHA-1 input data was malformed.
Definition at line 50 of file mbedtls/include/mbedtls/sha1.h.
typedef struct mbedtls_sha1_context mbedtls_sha1_context |
The SHA-1 context structure.
void mbedtls_sha1_init | ( | mbedtls_sha1_context * | ctx | ) |
This function initializes a SHA-1 context.
ctx | The SHA-1 context to initialize. This must not be NULL . |
void mbedtls_sha1_free | ( | mbedtls_sha1_context * | ctx | ) |
This function clears a SHA-1 context.
ctx | The SHA-1 context to clear. This may be NULL , in which case this function does nothing. If it is not NULL , it must point to an initialized 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.
dst | The SHA-1 context to clone to. This must be initialized. |
src | The SHA-1 context to clone from. This must be initialized. |
int mbedtls_sha1_starts_ret | ( | mbedtls_sha1_context * | ctx | ) |
This function starts a SHA-1 checksum calculation.
ctx | The SHA-1 context to initialize. This must be initialized. |
0
on success. 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. This must be initialized and have a hash operation started. |
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. |
0
on success. 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 to use. This must be initialized and have a hash operation started. |
output | The SHA-1 checksum result. This must be a writable buffer of length 20 Bytes. |
0
on success. int mbedtls_internal_sha1_process | ( | mbedtls_sha1_context * | ctx, |
const unsigned char | data[64] | ||
) |
SHA-1 process data block (internal use only).
ctx | The SHA-1 context to use. This must be initialized. |
data | The data block being processed. This must be a readable buffer of length 64 Bytes. |
0
on success. void mbedtls_sha1_starts | ( | mbedtls_sha1_context * | ctx | ) |
This function starts a SHA-1 checksum calculation.
ctx | The SHA-1 context to initialize. This must be initialized. |
void 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.
ctx | The SHA-1 context. This must be initialized and have a hash operation started. |
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. |
void 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.
ctx | The SHA-1 context. This must be initialized and have a hash operation started. |
output | The SHA-1 checksum result. This must be a writable buffer of length 20 Bytes. |
void mbedtls_sha1_process | ( | mbedtls_sha1_context * | ctx, |
const unsigned char | data[64] | ||
) |
SHA-1 process data block (internal use only).
ctx | The SHA-1 context. This must be initialized. |
data | The data block being processed. This must be a readable buffer of length 64 bytes. |
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. 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. |
0
on success. void 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).
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 size 20 Bytes. |