Main Page | Data Structures | File List | Data Fields | Globals

md5.c File Reference

#include <sys/types.h>
#include <fcntl.h>
#include <unistd.h>
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "md5.h"

Go to the source code of this file.

Defines

#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

void MD5Init (MD5_CTX *context)
void MD5Update (MD5_CTX *context, unsigned char const *buf, unsigned len)
void MD5Final (unsigned char digest[MD5_HASHBYTES], MD5_CTX *context)
void MD5Transform (u_int32_t buf[4], u_int32_t const in[16])
char * MD5End (MD5_CTX *, char *)
void byteReverse (unsigned char *buf, unsigned longs)
char * lutil_md5_file (const char *filename, char *buf)
 Compute an md5sum of the given file.

char * lutil_md5_data (const unsigned char *data, unsigned int len, char *buf)
 Compute an md5sum of the given data.

void MD5Final (unsigned char digest[16], MD5_CTX *ctx)


Define Documentation

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

Definition at line 261 of file md5.c.

Referenced by MD5Transform().

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

Definition at line 262 of file md5.c.

Referenced by MD5Transform().

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

Definition at line 263 of file md5.c.

Referenced by MD5Transform().

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

Definition at line 264 of file md5.c.

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 267 of file md5.c.

Referenced by MD5Transform().


Function Documentation

void byteReverse unsigned char *  buf,
unsigned  longs
 

Definition at line 80 of file md5.c.

Referenced by MD5Final(), and MD5Update().

char* lutil_md5_data const unsigned char *  data,
unsigned int  len,
char *  buf
 

Compute an md5sum of the given data.

Definition at line 116 of file md5.c.

References MD5End(), MD5Init(), and MD5Update().

char* lutil_md5_file const char *  filename,
char *  buf
 

Compute an md5sum of the given file.

Definition at line 96 of file md5.c.

References MD5End(), MD5Init(), and MD5Update().

Referenced by luau_net_downloadUpdate().

char * MD5End MD5_CTX ,
char * 
[static]
 

Definition at line 131 of file md5.c.

References MD5_HASHBYTES, and MD5Final().

Referenced by lutil_md5_data(), and lutil_md5_file().

void MD5Final unsigned char  digest[16],
MD5_CTX ctx
 

Definition at line 217 of file md5.c.

References MD5Context::bits, MD5Context::buf, byteReverse(), MD5Context::in, and MD5Transform().

Referenced by MD5End().

void MD5Final unsigned char  digest[MD5_HASHBYTES],
MD5_CTX context
[static]
 

void MD5Init MD5_CTX context  )  [static]
 

Definition at line 154 of file md5.c.

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

Referenced by lutil_md5_data(), and lutil_md5_file().

void MD5Transform u_int32_t  buf[4],
u_int32_t const  in[16]
[static]
 

Definition at line 275 of file md5.c.

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

Referenced by MD5Final(), and MD5Update().

void MD5Update MD5_CTX context,
unsigned char const *  buf,
unsigned  len
[static]
 

Definition at line 169 of file md5.c.

References MD5Context::bits, MD5Context::buf, byteReverse(), MD5Context::in, and MD5Transform().

Referenced by lutil_md5_data(), and lutil_md5_file().


Generated on Mon Apr 12 22:17:11 2004 for luau by doxygen 1.3.2