File src/plumb_md5.c

* This code implements the MD5 message-digest algorithm. * The algorithm is due to Ron Rivest. This code was * written by Colin Plumb in 1993, no copyright is claimed. * This code is in the public domain; do with it what you wish. * * Equivalent code is available from RSA Data Security, Inc. * This code has been tested against that, and is equivalent, * except that you don't need to include two pages of legalese * with every copy. * * To compute the message digest of a chunk of bytes, declare an * MD5Context structure, pass it to MD5Init, call MD5Update as * needed on buffers full of bytes, and then call MD5Final, which * will fill a supplied 16-byte array with the digest. * * Changed so as no longer to depend on Colin Plumb's `usual.h' header * definitions; now uses stuff from dpkg's config.h. * - Ian Jackson <>. * Still in the public domain. * * @(#) iroffer_md5.c 1.6@(#) *|src/iroffer_md5.c|20040403025021|16351 *

Included Files

for memcpy()

for stupid systems

for ntohl()

Preprocessor definitions

#define _LONGLONG 1

#define byteSwap( buf, words )

#define F1(x, y, z) (x & y | ~x & z)

#define F1( x, y, z )

#define F2( x, y, z )

#define F3( x, y, z )

#define F4( x, y, z )

This is the central step in the MD5 algorithm.

#define MD5STEP( f, w, x, y, z, in, s )

Global Function MD5Final()

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

void MD5Final ( MD5Digest digest, struct MD5Context* ctx )

Prototyped in: src/plumb_md5.h
Calls: MD5Transform() src/plumb_md5.c
  memcpy(), memset()
Called by: complete_md5_hash() src/dinoex_jobs.c
  ir_moutput_get_md5sum() src/iroffer_statefile.c
  read_statefile() src/iroffer_statefile.c

Global Function MD5Init()

* Start MD5 accumulation. Set bit count to 0 and buffer to mysterious * initialization constants.

void MD5Init ( struct MD5Context* ctx )

Prototyped in: src/plumb_md5.h
Called by: ir_moutput_init() src/iroffer_statefile.c
  read_statefile() src/iroffer_statefile.c
  start_md5_hash() src/dinoex_jobs.c

Global Function MD5Update()

* Update context to reflect the concatenation of another buffer full * of bytes.

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

Prototyped in: src/plumb_md5.h
Calls: MD5Transform() src/plumb_md5.c
Called by: mainloop() src/iroffer_main.c
  read_statefile() src/iroffer_statefile.c
  write_statefile_md5() src/iroffer_statefile.c

Local Function MD5Transform()

* The core of the MD5 algorithm, this alters an existing MD5 hash to * reflect the addition of 16 longwords of new data. MD5Update blocks * the data and converts bytes into longwords for this routine.

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

Prototyped in: src/plumb_md5.c
Called by: MD5Final() src/plumb_md5.c
  MD5Update() src/plumb_md5.c