MD4 hash implementation.
More...
#include "includes.h"
#include "common.h"
#include "crypto.h"
|
#define | MD4_BLOCK_LENGTH 64 |
|
#define | MD4_DIGEST_LENGTH 16 |
|
#define | MD4_DIGEST_STRING_LENGTH (MD4_DIGEST_LENGTH * 2 + 1) |
|
#define | PUT_64BIT_LE(cp, value) |
|
#define | PUT_32BIT_LE(cp, value) |
|
#define | F1(x, y, z) (z ^ (x & (y ^ z))) |
|
#define | F2(x, y, z) ((x & y) | (x & z) | (y & z)) |
|
#define | F3(x, y, z) (x ^ y ^ z) |
|
#define | MD4STEP(f, w, x, y, z, data, s) ( w += f(x, y, z) + data, w = w<<s | w>>(32-s) ) |
|
|
int | md4_vector (size_t num_elem, const u8 *addr[], const size_t *len, u8 *mac) |
| MD4 hash for data vector. More...
|
|
#define PUT_32BIT_LE |
( |
|
cp, |
|
|
|
value |
|
) |
| |
Value:do { \
(cp)[3] = (value) >> 24; \
(cp)[2] = (value) >> 16; \
(cp)[1] = (value) >> 8; \
(cp)[0] = (value); } while (0)
#define PUT_64BIT_LE |
( |
|
cp, |
|
|
|
value |
|
) |
| |
Value:do { \
(cp)[7] = (value) >> 56; \
(cp)[6] = (value) >> 48; \
(cp)[5] = (value) >> 40; \
(cp)[4] = (value) >> 32; \
(cp)[3] = (value) >> 24; \
(cp)[2] = (value) >> 16; \
(cp)[1] = (value) >> 8; \
(cp)[0] = (value); } while (0)
int md4_vector |
( |
size_t |
num_elem, |
|
|
const u8 * |
addr[], |
|
|
const size_t * |
len, |
|
|
u8 * |
mac |
|
) |
| |
MD4 hash for data vector.
- Parameters
-
num_elem | Number of elements in the data vector |
addr | Pointers to the data areas |
len | Lengths of the data blocks |
mac | Buffer for the hash |
- Returns
- 0 on success, -1 on failure