Switch to unified view

a/src/utils/md5.h b/src/utils/md5.h
...
...
24
24
25
These notices must be retained in any copies of any part of this
25
These notices must be retained in any copies of any part of this
26
documentation and/or software.
26
documentation and/or software.
27
 */
27
 */
28
28
29
extern "C" {
29
/* Base functions from original file */
30
31
/* MD5 context. */
30
/* MD5 context. */
32
typedef struct MD5Context {
31
typedef struct MD5Context {
33
  unsigned int state[4];    /* state (ABCD) */
32
  unsigned int state[4];    /* state (ABCD) */
34
  unsigned int count[2];    /* number of bits, modulo 2^64 (lsb first) */
33
  unsigned int count[2];    /* number of bits, modulo 2^64 (lsb first) */
35
  unsigned char buffer[64]; /* input buffer */
34
  unsigned char buffer[64]; /* input buffer */
36
} MD5_CTX;
35
} MD5_CTX;
37
36
38
void   MD5Init (MD5_CTX *);
37
extern void   MD5Init (MD5_CTX *);
39
void   MD5Update (MD5_CTX *, const unsigned char *, unsigned int);
38
extern void   MD5Update (MD5_CTX *, const unsigned char *, unsigned int);
40
void   MD5Final (unsigned char [16], MD5_CTX *);
39
extern void   MD5Final (unsigned char [16], MD5_CTX *);
41
}
42
40
41
/* Convenience / utilities */
42
#include <string>
43
using std::string;
44
extern void MD5Final(string& digest, MD5_CTX *);
45
extern bool MD5File(const string& filename, string& digest, string *reason);
46
extern string& MD5String(const string& data, string& digest);
47
extern string& MD5HexPrint(const string& digest, string& xdigest);
48
extern string& MD5HexScan(const string& xdigest, string& digest);
43
#endif /* _MD5_H_ */
49
#endif /* _MD5_H_ */