GNU libmicrohttpd 1.0.1
|
Calculation of SHA-512/256 digest as defined in FIPS PUB 180-4 (2015) More...
Go to the source code of this file.
Macros | |
#define | Ch(x, y, z) ( (z) ^ ((x) & ((y) ^ (z))) ) |
#define | Maj(x, y, z) ( ((x) & (y)) ^ ((z) & ((x) ^ (y))) ) |
#define | SIG0(x) ( _MHD_ROTR64 ((x), 28) ^ _MHD_ROTR64 ((x), 34) ^ _MHD_ROTR64 ((x), 39) ) |
#define | SIG1(x) ( _MHD_ROTR64 ((x), 14) ^ _MHD_ROTR64 ((x), 18) ^ _MHD_ROTR64 ((x), 41) ) |
#define | sig0(x) ( _MHD_ROTR64 ((x), 1) ^ _MHD_ROTR64 ((x), 8) ^ ((x) >> 7) ) |
#define | sig1(x) ( _MHD_ROTR64 ((x), 19) ^ _MHD_ROTR64 ((x), 61) ^ ((x) >> 6) ) |
#define | SHA2STEP64(vA, vB, vC, vD, vE, vF, vG, vH, kt, wt) |
#define | GET_W_FROM_DATA(buf, t) _MHD_GET_64BIT_BE (((const uint64_t*) (buf)) + (t)) |
#define | Wgen(w, t) |
#define | SHA512_256_SIZE_OF_LEN_ADD_BITS 128 |
#define | SHA512_256_SIZE_OF_LEN_ADD (SHA512_256_SIZE_OF_LEN_ADD_BITS / 8) |
Calculation of SHA-512/256 digest as defined in FIPS PUB 180-4 (2015)
Definition in file sha512_256.c.
#define SHA512_256_SIZE_OF_LEN_ADD (SHA512_256_SIZE_OF_LEN_ADD_BITS / 8) |
Size of "length" insertion in bytes.
Definition at line 530 of file sha512_256.c.
Referenced by MHD_SHA512_256_finish().
#define SHA512_256_SIZE_OF_LEN_ADD_BITS 128 |
Size of "length" insertion in bits. See FIPS PUB 180-4 clause 5.1.2.
Definition at line 525 of file sha512_256.c.
#define SIG0 | ( | x | ) | ( _MHD_ROTR64 ((x), 28) ^ _MHD_ROTR64 ((x), 34) ^ _MHD_ROTR64 ((x), 39) ) |
#define sig0 | ( | x | ) | ( _MHD_ROTR64 ((x), 1) ^ _MHD_ROTR64 ((x), 8) ^ ((x) >> 7) ) |
#define SIG1 | ( | x | ) | ( _MHD_ROTR64 ((x), 14) ^ _MHD_ROTR64 ((x), 18) ^ _MHD_ROTR64 ((x), 41) ) |
#define sig1 | ( | x | ) | ( _MHD_ROTR64 ((x), 19) ^ _MHD_ROTR64 ((x), 61) ^ ((x) >> 6) ) |
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 539 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().
|
static |
Base of SHA-512/256 transformation. Gets full 128 bytes block of data and updates hash values;
H | hash values |
data | the data buffer with SHA512_256_BLOCK_SIZE bytes block |
Definition at line 70 of file sha512_256.c.
References _MHD_UINT64_ALIGN, data, GET_W_FROM_DATA, MHD_HTTP_OK, SHA2STEP64, and Wgen.
Referenced by MHD_SHA512_256_finish(), and MHD_SHA512_256_update().