Nut/OS  4.10.3
API Reference
Hashes

MD5 Digest Functions. More...

Collaboration diagram for Hashes:

Data Structures

struct  _MD5CONTEXT
struct  MD5CONTEXT
 MD5 context structure. More...

Defines

#define byteReverse(buf, len)
#define F1(x, y, z)   (z ^ (x & (y ^ z)))
#define F2(x, y, z)   F1(z, x, y)
#define F3(x, y, z)   (x ^ y ^ z)
#define F4(x, y, z)   (y ^ (x | ~z))
#define MD5STEP(f, w, x, y, z, data, s)   ( w += f(x, y, z) + data, w = w<<s | w>>(32-s), w += x )

Typedefs

typedef struct _MD5CONTEXT MD5CONTEXT

Functions

void NutMD5Init (MD5CONTEXT *context)
 Start MD5 accumulation.
void NutMD5Update (MD5CONTEXT *context, uint8_t CONST *buf, uint32_t len)
 Update MD5 context.
void NutMD5Final (MD5CONTEXT *context, uint8_t digest[16])
 Final wrapup, calculate MD5 digest.

Detailed Description

MD5 Digest Functions.


Define Documentation

#define byteReverse (   buf,
  len 
)

Definition at line 66 of file md5.c.

Referenced by NutMD5Final(), and NutMD5Update().

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

Definition at line 85 of file md5.c.

#define F2 (   x,
  y,
 
)    F1(z, x, y)

Definition at line 86 of file md5.c.

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

Definition at line 87 of file md5.c.

#define F4 (   x,
  y,
 
)    (y ^ (x | ~z))

Definition at line 88 of file md5.c.

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

Definition at line 91 of file md5.c.


Typedef Documentation

typedef struct _MD5CONTEXT MD5CONTEXT

Function Documentation

void NutMD5Init ( MD5CONTEXT context)

Start MD5 accumulation.

Start MD5 accumulation, set bit count to 0 and buffer to mysterious initialization constants. Call this function to initialize every new MD5 calculation.

Parameters:
contextPoints to the md5 context buffer.

Definition at line 192 of file md5.c.

void NutMD5Update ( MD5CONTEXT context,
uint8_t CONST *  buf,
uint32_t  len 
)

Update MD5 context.

Update context to reflect the concatenation of another data buffer.

Parameters:
contextPoints to the md5 context buffer.
bufPoints to the data buffer
lenLength of the data buffer

Definition at line 213 of file md5.c.

References byteReverse, and memcpy().

Here is the call graph for this function:

void NutMD5Final ( MD5CONTEXT context,
uint8_t  digest[16] 
)

Final wrapup, calculate MD5 digest.

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

Parameters:
contextPoints to the md5 context buffer.
digestPoints to the digest buffer, which must be 16 bytes long

Definition at line 275 of file md5.c.

References byteReverse, memcpy(), and memset().

Here is the call graph for this function: