|
GNU libmicrohttpd 1.0.5
|
Calculation of SHA-1 digest. More...


Go to the source code of this file.
Data Structures | |
| struct | sha1_ctx |
Macros | |
| #define | _SHA1_DIGEST_LENGTH 5 |
| #define | SHA1_WORD_SIZE_BITS 32 |
| #define | SHA1_BYTES_IN_WORD (SHA1_WORD_SIZE_BITS / 8) |
| #define | SHA1_DIGEST_SIZE (_SHA1_DIGEST_LENGTH * SHA1_BYTES_IN_WORD) |
| #define | SHA1_DIGEST_STRING_SIZE ((SHA1_DIGEST_SIZE) * 2 + 1) |
| #define | SHA1_BLOCK_SIZE_BITS 512 |
| #define | SHA1_BLOCK_SIZE (SHA1_BLOCK_SIZE_BITS / 8) |
Functions | |
| void | MHD_SHA1_init (void *ctx_) |
| void | MHD_SHA1_update (void *ctx_, const uint8_t *data, size_t length) |
| void | MHD_SHA1_finish (void *ctx_, uint8_t digest[SHA1_DIGEST_SIZE]) |
Calculation of SHA-1 digest.
Definition in file sha1.h.
| #define _SHA1_DIGEST_LENGTH 5 |
SHA-1 digest is kept internally as 5 32-bit words.
Definition at line 38 of file sha1.h.
Referenced by MHD_SHA1_finish(), and sha1_transform().
| #define SHA1_BLOCK_SIZE (SHA1_BLOCK_SIZE_BITS / 8) |
Size of single processing block in bytes
Definition at line 68 of file sha1.h.
Referenced by MHD_SHA1_finish(), MHD_SHA1_update(), and sha1_transform().
| #define SHA1_BLOCK_SIZE_BITS 512 |
| #define SHA1_BYTES_IN_WORD (SHA1_WORD_SIZE_BITS / 8) |
Number of bytes in single SHA-1 word
Definition at line 48 of file sha1.h.
Referenced by MHD_SHA1_finish().
| #define SHA1_DIGEST_SIZE (_SHA1_DIGEST_LENGTH * SHA1_BYTES_IN_WORD) |
Size of SHA-1 digest in bytes
Definition at line 53 of file sha1.h.
Referenced by MHD_SHA1_finish().
| #define SHA1_DIGEST_STRING_SIZE ((SHA1_DIGEST_SIZE) * 2 + 1) |
| #define SHA1_WORD_SIZE_BITS 32 |
| void MHD_SHA1_finish | ( | void * | ctx_, |
| uint8_t | digest[SHA1_DIGEST_SIZE] ) |
Finalise SHA-1 calculation, return digest.
| ctx_ | must be a struct sha1_ctx * | |
| [out] | digest | set to the hash, must be SHA1_DIGEST_SIZE bytes |
< Number of processed bits
< Number of bytes in buffer
Definition at line 314 of file sha1.c.
References _MHD_PUT_32BIT_BE, _MHD_PUT_64BIT_BE_SAFE(), _MHD_UINT32_ALIGN, _SHA1_DIGEST_LENGTH, sha1_ctx::buffer, sha1_ctx::count, sha1_ctx::H, SHA1_BLOCK_SIZE, SHA1_BYTES_IN_WORD, SHA1_DIGEST_SIZE, SHA1_SIZE_OF_LEN_ADD, and sha1_transform().

| void MHD_SHA1_init | ( | void * | ctx_ | ) |
Initialise structure for SHA-1 calculation.
| ctx_ | must be a struct sha1_ctx * |
Definition at line 41 of file sha1.c.
References sha1_ctx::count, and sha1_ctx::H.
| void MHD_SHA1_update | ( | void * | ctx_, |
| const uint8_t * | data, | ||
| size_t | length ) |
Process portion of bytes.
| ctx_ | must be a struct sha1_ctx * |
| data | bytes to add to hash |
| length | number of bytes in data |
< Number of bytes in buffer
Definition at line 252 of file sha1.c.
References sha1_ctx::buffer, sha1_ctx::count, data, sha1_ctx::H, mhd_assert, NULL, SHA1_BLOCK_SIZE, and sha1_transform().
