DESCRIPTION

These functions implement the MD5 message-digest algorith, which takes as input a message of arbitrary length and produces as output a 128-bit "fingerprint" or "message digest" of the input. It is intended for digital signature applications, where large file must be "compressed" in a secure manner
before being encrypted with a private (secret) key under a public-key cryptosystem such as RSA.

md5_calc()

The md5_calc() function computes an MD5 digest on a single message block. The inlen-byte block is pointed to by input, and the 16-byte MD5 digest is written to output.

MD5Init(), MD5Update(), MD5Final()

The MD5Init(), MD5Update(), and MD5Final() functions allow an MD5 digest to be computed over multiple message blocks; between blocks, the state of the MD5 computation is held in an MD5 context structure, allocated by the caller. A complete
digest computation consists of one call to MD5Init(), one or more calls to MD5Update(), and one call to MD5Final(), in that order.

The MD5Init() function initializes the MD5 context structure pointed to by context.

The MD5Update() function computes a partial MD5 digest on the inlen-byte message block pointed to by input, and updates the MD5 context structure pointed to by context accordingly.

The MD5Final() function generates the final MD5 digest, using the MD5 context structure pointed to by context; the 16-byte MD5 digest is written to output. After calling MD5Final(), the state of the context structure
is undefined; it must be reinitialized with MD5Init() before being used again.

RETURN VALUES

These functions do not return a value.

EXAMPLES

Example 1 Authenticate a message found in multiple buffers

The following is a sample function that must authenticate a message that is found in multiple buffers. The calling function provides an authentication buffer that will contain the result of the MD5 digest.