This commit was generated by cvs2svn to track changes on a CVS vendor
[openssl.git] / doc / md2.doc
1 The MD2 library.
2 MD2 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 MD2_CTX which is used to hold the MD2 context during multiple MD2_Update()
5 function calls.  The normal method of use for this library is as follows
6
7 MD2_Init(...);
8 MD2_Update(...);
9 ...
10 MD2_Update(...);
11 MD2_Final(...);
12
13 This library requires the inclusion of 'md2.h'.
14
15 The main negative about MD2 is that it is slow, especially when compared
16 to MD5.
17
18 The functions are as follows:
19
20 void MD2_Init(
21 MD2_CTX *c);
22         This function needs to be called to initiate a MD2_CTX structure for
23         use.
24         
25 void MD2_Update(
26 MD2_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 MD2_Final(
34 unsigned char *md;
35 MD2_CTX *c;
36         This function is called when a message digest of the data digested
37         with MD2_Update() is wanted.  The message digest is put in the 'md'
38         array and is MD2_DIGEST_LENGTH (16) bytes long.
39
40 unsigned char *MD2(
41 unsigned long n;
42 unsigned char *d;
43 unsigned char *md;
44         This function performs a MD2_Init(), followed by a MD2_Update()
45         followed by a MD2_Final() (using a local MD2_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.