]> git.evergreen-ils.org Git - OpenSRF.git/blob - include/opensrf/md5.h
Prepare for #inclusion in C++
[OpenSRF.git] / include / opensrf / md5.h
1 /* --- The MD5 routines --- */
2
3 /* MD5 routines, after Ron Rivest */
4 /* Written by David Madore <david.madore@ens.fr>, with code taken in
5  * part from Colin Plumb. */
6 /* Public domain (1999/11/24) */
7
8 /* Note: these routines do not depend on endianness. */
9
10 /* === The header === */
11
12 /* Put this in md5.h if you don't like having everything in one big
13  * file. */
14
15 #ifndef DMADORE_MD5_H
16 #define DMADORE_MD5_H
17
18 #ifdef __cplusplus
19 extern "C" {
20 #endif
21
22 struct md5_ctx {
23   /* The four chaining variables */
24   unsigned long buf[4];
25   /* Count number of message bits */
26   unsigned long bits[2];
27   /* Data being fed in */
28   unsigned long in[16];
29   /* Our position within the 512 bits (always between 0 and 63) */
30   int b;
31 };
32
33 void MD5_transform (unsigned long buf[4], const unsigned long in[16]);
34 void MD5_start (struct md5_ctx *context);
35 void MD5_feed (struct md5_ctx *context, unsigned char inb);
36 void MD5_stop (struct md5_ctx *context, unsigned char digest[16]);
37
38 #ifdef __cplusplus
39 }
40 #endif
41
42 #endif /* not defined DMADORE_MD5_H */
43