forked from metajack/libstrophe
/
md5.h
41 lines (34 loc) · 916 Bytes
/
md5.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/* md5.h
** interface to MD5 hash function
**
** This code is in the Public Domain.
*/
/** @file
* MD5 hash API.
*/
#ifndef MD5_H
#define MD5_H
/* we use the uint32_t type from stdint.h
* if it is not available, add a typedef here:
*/
/* make sure the stdint.h types are available */
#if defined(_MSC_VER) /* Microsoft Visual C++ */
typedef unsigned int uint32_t;
#else
#include <stdint.h>
#endif
struct MD5Context {
uint32_t buf[4];
uint32_t bits[2];
unsigned char in[64];
};
void xmpp_MD5Init(struct MD5Context *context);
void xmpp_MD5Update(struct MD5Context *context, unsigned char const *buf,
uint32_t len);
void xmpp_MD5Final(unsigned char digest[16], struct MD5Context *context);
void xmpp_MD5Transform(uint32_t buf[4], const unsigned char in[64],
struct MD5Context *ctx);
#ifdef DEBUG_MD5
void xmpp_MD5DumpBytes(unsigned char *b, int len);
#endif
#endif /* !MD5_H */