GNU libmicrohttpd 1.0.0
|
Calculation of SHA-512/256 digest. More...
Go to the source code of this file.
Data Structures | |
struct | Sha512_256Ctx |
Functions | |
void | MHD_SHA512_256_init (struct Sha512_256Ctx *ctx) |
void | MHD_SHA512_256_update (struct Sha512_256Ctx *ctx, const uint8_t *data, size_t length) |
void | MHD_SHA512_256_finish (struct Sha512_256Ctx *ctx, uint8_t digest[SHA512_256_DIGEST_SIZE]) |
Calculation of SHA-512/256 digest.
Definition in file sha512_256.h.
#define SHA512_256_BLOCK_SIZE (SHA512_256_BLOCK_SIZE_BITS / 8) |
Size of SHA-512/256 single processing block in bytes.
Definition at line 78 of file sha512_256.h.
Referenced by MHD_SHA512_256_finish(), and MHD_SHA512_256_update().
#define SHA512_256_BLOCK_SIZE_BITS 1024 |
Size of SHA-512/256 single processing block in bits.
Definition at line 73 of file sha512_256.h.
#define SHA512_256_BLOCK_SIZE_WORDS (SHA512_256_BLOCK_SIZE_BITS / SHA512_256_WORD_SIZE_BITS) |
Size of SHA-512/256 single processing block in words.
Definition at line 83 of file sha512_256.h.
Referenced by MHD_SHA512_256_finish().
#define SHA512_256_BYTES_IN_WORD (SHA512_256_WORD_SIZE_BITS / 8) |
Number of bytes in single SHA-512/256 word.
Definition at line 44 of file sha512_256.h.
Referenced by MHD_SHA512_256_finish().
#define SHA512_256_DIGEST_SIZE (SHA512_256_DIGEST_SIZE_WORDS * SHA512_256_BYTES_IN_WORD) |
Size of SHA-512/256 resulting digest in bytes This is the final digest size, not intermediate hash.
Definition at line 62 of file sha512_256.h.
Referenced by digest_get_hash_size(), digest_get_size(), and MHD_SHA512_256_finish().
#define SHA512_256_DIGEST_SIZE_WORDS (SHA512_256_HASH_SIZE_WORDS / 2) |
Size of SHA-512/256 resulting digest in bytes. This is the final digest size, not intermediate hash.
Definition at line 56 of file sha512_256.h.
Referenced by MHD_SHA512_256_finish().
#define SHA512_256_DIGEST_STRING_SIZE ((SHA512_256_DIGEST_SIZE) * 2 + 1) |
Size of SHA-512/256 digest string in chars including termination NUL.
Definition at line 68 of file sha512_256.h.
#define SHA512_256_HASH_SIZE_WORDS 8 |
Hash is kept internally as 8 64-bit words. This is intermediate hash size, used during computing the final digest.
Definition at line 50 of file sha512_256.h.
#define SHA512_256_WORD_SIZE_BITS 64 |
Number of bits in single SHA-512/256 word.
Definition at line 39 of file sha512_256.h.
void MHD_SHA512_256_finish | ( | struct Sha512_256Ctx * | ctx, |
uint8_t | digest[SHA512_256_DIGEST_SIZE] ) |
Finalise SHA-512/256 calculation, return digest.
ctx | the calculation context | |
[out] | digest | set to the hash, must be SHA512_256_DIGEST_SIZE bytes |
< Number of processed bits
< Number of bytes in the context buffer
Definition at line 535 of file sha512_256.c.
References _MHD_PUT_64BIT_BE, _MHD_UINT64_ALIGN, Sha512_256Ctx::buffer, Sha512_256Ctx::count, Sha512_256Ctx::count_bits_hi, Sha512_256Ctx::H, MHD_HTTP_OK, SHA512_256_BLOCK_SIZE, SHA512_256_BLOCK_SIZE_WORDS, SHA512_256_BYTES_IN_WORD, SHA512_256_DIGEST_SIZE, SHA512_256_DIGEST_SIZE_WORDS, SHA512_256_SIZE_OF_LEN_ADD, and sha512_256_transform().
Referenced by digest_calc_hash().
void MHD_SHA512_256_init | ( | struct Sha512_256Ctx * | ctx | ) |
Initialise structure for SHA-512/256 calculation.
ctx | the calculation context |
Definition at line 41 of file sha512_256.c.
References Sha512_256Ctx::count, Sha512_256Ctx::count_bits_hi, Sha512_256Ctx::H, and MHD_HTTP_OK.
Referenced by digest_init_one_time(), and digest_reset().
Process portion of bytes.
ctx | the calculation context |
data | bytes to add to hash |
length | number of bytes in data |
< Number of bytes in the context buffer
< The high part to be moved to another variable
Definition at line 460 of file sha512_256.c.
References Sha512_256Ctx::buffer, Sha512_256Ctx::count, Sha512_256Ctx::count_bits_hi, data, Sha512_256Ctx::H, mhd_assert, MHD_HTTP_OK, NULL, SHA512_256_BLOCK_SIZE, and sha512_256_transform().
Referenced by digest_update().