*** empty log message ***
[openssl.git] / doc / md5.doc
1 The MD5 library.
2 MD5 is a message digest algorithm that can be used to condense an arbitrary
3 length message down to a 16 byte hash.  The functions all need to be passed
4 a MD5_CTX which is used to hold the MD5 context during multiple MD5_Update()
5 function calls.  This library also contains random number routines that are
6 based on MD5
7
8 The normal method of use for this library is as follows
9
10 MD5_Init(...);
11 MD5_Update(...);
12 ...
13 MD5_Update(...);
14 MD5_Final(...);
15
16 This library requires the inclusion of 'md5.h'.
17
18 The functions are as follows:
19
20 void MD5_Init(
21 MD5_CTX *c);
22         This function needs to be called to initiate a MD5_CTX structure for
23         use.
24         
25 void MD5_Update(
26 MD5_CTX *c;
27 unsigned char *data;
28 unsigned long len);
29         This updates the message digest context being generated with 'len'
30         bytes from the 'data' pointer.  The number of bytes can be any
31         length.
32
33 void MD5_Final(
34 unsigned char *md;
35 MD5_CTX *c;
36         This function is called when a message digest of the data digested
37         with MD5_Update() is wanted.  The message digest is put in the 'md'
38         array and is MD5_DIGEST_LENGTH (16) bytes long.
39
40 unsigned char *MD5(
41 unsigned char *d;
42 unsigned long n;
43 unsigned char *md;
44         This function performs a MD5_Init(), followed by a MD5_Update()
45         followed by a MD5_Final() (using a local MD5_CTX).
46         The resulting digest is put into 'md' if it is not NULL.
47         Regardless of the value of 'md', the message
48         digest is returned from the function.  If 'md' was NULL, the message
49         digest returned is being stored in a static structure.
50