5 /* Try to avoid clashes with OpenSSL */
9 #if defined(HAVE_BSD_MD5_H)
10 /* Try to avoid clashes with BSD MD5 implementation (on linux) */
13 #elif defined(HAVE_SYS_MD5_H)
14 /* Try to avoid clashes with BSD MD5 implementation (on BSD) */
17 /* Try to use CommonCrypto on Mac as otherwise we can get MD5Final twice */
18 #elif defined(HAVE_COMMONCRYPTO_COMMONDIGEST_H)
19 #include <CommonCrypto/CommonDigest.h>
21 #define MD5_CTX CC_MD5_CTX
22 #define MD5Init(c) CC_MD5_Init(c)
23 #define MD5Update(c,d,l) CC_MD5_Update(c,d,l)
24 #define MD5Final(m, c) CC_MD5_Final((unsigned char *)m,c)
25 #define MD5Context CC_MD5state_st
28 typedef struct MD5Context
{
34 #define MD5_DIGEST_LENGTH 16
36 void MD5Init(MD5_CTX
*context
);
37 void MD5Update(MD5_CTX
*context
, const uint8_t *buf
,
39 void MD5Final(uint8_t digest
[MD5_DIGEST_LENGTH
], MD5_CTX
*context
);
40 #endif /* HAVE_*MD5_H */