wpa_supplicant / hostapd  2.5
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Data Structures | Macros | Typedefs | Functions
md4-internal.c File Reference

MD4 hash implementation. More...

#include "includes.h"
#include "common.h"
#include "crypto.h"

Data Structures

struct  MD4Context
 

Macros

#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) )
 

Typedefs

typedef struct MD4Context MD4_CTX
 

Functions

int md4_vector (size_t num_elem, const u8 *addr[], const size_t *len, u8 *mac)
 MD4 hash for data vector. More...
 

Detailed Description

MD4 hash implementation.

Macro Definition Documentation

#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)

Function Documentation

int md4_vector ( size_t  num_elem,
const u8 *  addr[],
const size_t *  len,
u8 *  mac 
)

MD4 hash for data vector.

Parameters
num_elemNumber of elements in the data vector
addrPointers to the data areas
lenLengths of the data blocks
macBuffer for the hash
Returns
0 on success, -1 on failure