ICP  1
Macros | Functions
md5.cpp File Reference
#include "stdafx.h"
#include "md5.h"

Go to the source code of this file.

Macros

#define byteSwap(a, b)
 
#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 )
 

Functions

static void byteReverse (unsigned char *buf, unsigned longs)
 
void MD5Init (struct MD5Context *ctx, int brokenEndian)
 
void MD5Update (struct MD5Context *ctx, unsigned char const *buf, unsigned len)
 
void MD5Final (unsigned char digest[16], struct MD5Context *ctx)
 
void MD5Transform (uint32 buf[4], uint32 const in[16])
 

Macro Definition Documentation

#define byteSwap (   a,
 
)
Value:
do { \
a ^= b; \
b ^= a; \
a ^= b; \
} while(0)

Definition at line 29 of file md5.cpp.

Referenced by byteReverse().

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

Definition at line 176 of file md5.cpp.

Referenced by MD5Transform().

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

Definition at line 177 of file md5.cpp.

Referenced by MD5Transform().

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

Definition at line 178 of file md5.cpp.

Referenced by MD5Transform().

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

Definition at line 179 of file md5.cpp.

Referenced by MD5Transform().

#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 182 of file md5.cpp.

Referenced by MD5Transform().

Function Documentation

static void byteReverse ( unsigned char *  buf,
unsigned  longs 
)
static

Definition at line 34 of file md5.cpp.

References byteSwap.

Referenced by MD5Final(), and MD5Update().

void MD5Final ( unsigned char  digest[16],
struct MD5Context ctx 
)
void MD5Init ( struct MD5Context ctx,
int  brokenEndian 
)

Definition at line 53 of file md5.cpp.

References MD5Context::bits, MD5Context::buf, and MD5Context::doByteReverse.

Referenced by md5sumString().

void MD5Transform ( uint32  buf[4],
uint32 const  in[16] 
)

Definition at line 190 of file md5.cpp.

References F1, F2, F3, F4, and MD5STEP.

Referenced by MD5Final(), and MD5Update().

void MD5Update ( struct MD5Context ctx,
unsigned char const *  buf,
unsigned  len 
)