xref: /lighttpd1.4/src/algo_md5.h (revision f2e4e83a)
1 #ifndef LI_MD5_H
2 #define LI_MD5_H
3 #include "first.h"
4 
5 #include "sys-crypto-md.h"
6 #ifndef USE_LIB_CRYPTO_MD5
7 
8 /* MD5.H - header file for MD5C.C
9  */
10 
11 /* Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All
12 rights reserved.
13 
14 License to copy and use this software is granted provided that it
15 is identified as the "RSA Data Security, Inc. MD5 Message-Digest
16 Algorithm" in all material mentioning or referencing this software
17 or this function.
18 
19 License is also granted to make and use derivative works provided
20 that such works are identified as "derived from the RSA Data
21 Security, Inc. MD5 Message-Digest Algorithm" in all material
22 mentioning or referencing the derived work.
23 
24 RSA Data Security, Inc. makes no representations concerning either
25 the merchantability of this software or the suitability of this
26 software for any particular purpose. It is provided "as is"
27 without express or implied warranty of any kind.
28 
29 These notices must be retained in any copies of any part of this
30 documentation and/or software.
31  */
32 
33 /* MD5 context. */
34 typedef struct {
35   uint32_t state[4];                                /* state (ABCD) */
36   uint32_t count[2];     /* number of bits, modulo 2^64 (lsb first) */
37   unsigned char buffer[64];                         /* input buffer */
38 } li_MD5_CTX;
39 
40 #ifndef MD5_DIGEST_LENGTH
41 #define MD5_DIGEST_LENGTH 16
42 #endif
43 
44 void li_MD5_Init (li_MD5_CTX *);
45 void li_MD5_Update (li_MD5_CTX *, const void *, unsigned int);
46 void li_MD5_Final (unsigned char [MD5_DIGEST_LENGTH], li_MD5_CTX *);
47 
48 #else  /* USE_LIB_CRYPTO_MD5 */
49 
50 #define li_MD5_CTX    MD5_CTX
51 #define li_MD5_Init   MD5_Init
52 #define li_MD5_Update MD5_Update
53 #define li_MD5_Final  MD5_Final
54 
55 #endif /* USE_LIB_CRYPTO_MD5 */
56 
57 #endif
58