|
| #define | Ch(x, y, z) ( (z) ^ ((x) & ((y) ^ (z))) ) |
| |
| #define | Maj(x, y, z) ( ((x) & (y)) ^ ((z) & ((x) ^ (y))) ) |
| |
| #define | Par(x, y, z) ( (x) ^ (y) ^ (z) ) |
| |
| #define | SHA1STEP32(vA, vB, vC, vD, vE, ft, kt, wt) |
| |
| #define | GET_W_FROM_DATA(buf, t) |
| |
| #define | K00 UINT32_C(0x5a827999) |
| |
| #define | K20 UINT32_C(0x6ed9eba1) |
| |
| #define | K40 UINT32_C(0x8f1bbcdc) |
| |
| #define | K60 UINT32_C(0xca62c1d6) |
| |
| #define | Wgen(w, t) |
| |
| #define | SHA1_SIZE_OF_LEN_ADD (64 / 8) |
| |
Calculation of SHA-1 digest as defined in FIPS PUB 180-4 (2015)
- Author
- Karlson2k (Evgeny Grin)
Definition in file sha1.c.
| void MHD_SHA1_finish |
( |
void * |
ctx_, |
|
|
uint8_t |
digest[SHA1_DIGEST_SIZE] |
|
) |
| |
Finalise SHA-1 calculation, return digest.
- Parameters
-
< 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().
| static void sha1_transform |
( |
uint32_t |
H[_SHA1_DIGEST_LENGTH], |
|
|
const uint8_t |
data[SHA1_BLOCK_SIZE] |
|
) |
| |
|
static |
Base of SHA-1 transformation. Gets full 512 bits / 64 bytes block of data and updates hash values;
- Parameters
-
| H | hash values |
| data | data, must be exactly 64 bytes long |
Definition at line 64 of file sha1.c.
References _MHD_UINT32_ALIGN, Ch, data, GET_W_FROM_DATA, sha1_ctx::H, K00, K20, K40, K60, Maj, Par, SHA1_BLOCK_SIZE, SHA1STEP32, and Wgen.
Referenced by MHD_SHA1_finish(), and MHD_SHA1_update().