All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions
md4.c File Reference

md4 digest functions. More...

#include <freeradius-devel/md4.h>
+ Include dependency graph for md4.c:

Go to the source code of this file.

Macros

#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 htole32_14(buf)   /* Nothing */
 
#define htole32_16(buf)   /* Nothing */
 
#define htole32_4(buf)   /* Nothing */
 
#define MD4STEP(f, w, x, y, z, data, s)   (w += f(x, y, z) + data, w = w << s | w >> (32 - s))
 

Functions

void fr_md4_calc (uint8_t out[MD4_DIGEST_LENGTH], uint8_t const *in, size_t inlen)
 Calculate the MD4 hash of the contents of a buffer. More...
 
void fr_md4_final (uint8_t out[MD4_DIGEST_LENGTH], FR_MD4_CTX *ctx)
 Finalise the MD4 context and write out the hash. More...
 
void fr_md4_init (FR_MD4_CTX *ctx)
 Initialise a new MD4 context. More...
 
void fr_md4_transform (uint32_t state[4], uint8_t const block[MD4_BLOCK_LENGTH])
 The core of the MD4 algorithm. More...
 
void fr_md4_update (FR_MD4_CTX *ctx, uint8_t const *in, size_t inlen)
 Feed additional data into the MD4 hashing function. More...
 

Detailed Description

md4 digest functions.

Id:
2ff492e5b5a6635b6b44b6d38437b7cba0164d3d
Note
license is LGPL, but largely derived from a public domain source.

Definition in file md4.c.

Macro Definition Documentation

#define F1 (   x,
  y,
 
)    (z ^ (x & (y ^ z)))

Definition at line 227 of file md4.c.

#define F2 (   x,
  y,
 
)    ((x & y) | (x & z) | (y & z))

Definition at line 228 of file md4.c.

#define F3 (   x,
  y,
 
)    (x ^ y ^ z)

Definition at line 229 of file md4.c.

#define htole32_14 (   buf)    /* Nothing */

Definition at line 54 of file md4.c.

#define htole32_16 (   buf)    /* Nothing */

Definition at line 55 of file md4.c.

#define htole32_4 (   buf)    /* Nothing */

Definition at line 53 of file md4.c.

#define MD4STEP (   f,
  w,
  x,
  y,
  z,
  data,
 
)    (w += f(x, y, z) + data, w = w << s | w >> (32 - s))

Definition at line 232 of file md4.c.

Function Documentation

void fr_md4_calc ( uint8_t  out[MD4_DIGEST_LENGTH],
uint8_t const *  in,
size_t  inlen 
)

Calculate the MD4 hash of the contents of a buffer.

Parameters
[out]outWhere to write the MD4 digest. Must be a minimum of MD4_DIGEST_LENGTH.
[in]inData to hash.
[in]inlenLength of the data.

Definition at line 24 of file md4.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void fr_md4_final ( uint8_t  out[MD4_DIGEST_LENGTH],
FR_MD4_CTX ctx 
)

Finalise the MD4 context and write out the hash.

Final wrapup - pad to 64-byte boundary with the bit pattern 1 0* (64-bit count of bits processed, MSB-first).

Parameters
[out]outWhere to write the MD4 digest. Minimum length of MD4_DIGEST_LENGTH.
[in,out]ctxto finalise.

Definition at line 183 of file md4.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void fr_md4_init ( FR_MD4_CTX ctx)

Initialise a new MD4 context.

Set bit count to 0 and buffer to mysterious initialization constants.

Parameters
[out]ctxto initialise.

Definition at line 115 of file md4.c.

+ Here is the caller graph for this function:

void fr_md4_transform ( uint32_t  state[4],
uint8_t const  block[MD4_BLOCK_LENGTH] 
)

The core of the MD4 algorithm.

This alters an existing MD4 hash to reflect the addition of 16 longwords of new data. fr_md4_update blocks the data and converts bytes into longwords for this routine.

Parameters
[in]state16 bytes of data to feed into the hashing function.
[in,out]blockMD4 digest block to update.

Definition at line 243 of file md4.c.

+ Here is the caller graph for this function:

void fr_md4_update ( FR_MD4_CTX ctx,
uint8_t const *  in,
size_t  inlen 
)

Feed additional data into the MD4 hashing function.

Parameters
[in,out]ctxto update.
[in]inData to hash.
[in]inlenLength of the data.

Definition at line 131 of file md4.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function: