ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/cvsroot/ermyth/include/md5.h
Revision: 1.1
Committed: Thu Jul 19 08:24:50 2007 UTC (19 years, 4 months ago) by pippijn
Content type: text/plain
Branch: MAIN
Log Message:
initial import. the most important changes since Atheme are:
- fixed many memory leaks
- fixed many bugs
- converted to C++ and use more STL containers
- added a (not very enhanced yet) perl module
- greatly improved XML-RPC speed
- added a JSON-RPC module with code from json-cpp
- added a valgrind memcheck module to operserv
- added a more object oriented base64 implementation
- added a specialised unit test framework
- improved stability
- use gettimeofday() if available
- reworked adding/removing commands
- MemoServ IGNORE DEL can now remove indices

File Contents

# User Rev Content
1 pippijn 1.1 #ifndef MD5_H
2     #define MD5_H
3    
4     /* The following tests optimise behaviour on little-endian
5     machines, where there is no need to reverse the byte order
6     of 32 bit words in the MD5 computation. By default,
7     HIGHFIRST is defined, which indicates we're running on a
8     big-endian (most significant byte first) machine, on which
9     the byteReverse function in md5.c must be invoked. However,
10     byteReverse is coded in such a way that it is an identity
11     function when run on a little-endian machine, so calling it
12     on such a platform causes no harm apart from wasting time.
13     If the platform is known to be little-endian, we speed
14     things up by undefining HIGHFIRST, which defines
15     byteReverse as a null macro. Doing things in this manner
16     insures we work on new platforms regardless of their byte
17     order. */
18    
19     #define HIGHFIRST
20    
21     #ifdef __i386__
22     #undef HIGHFIRST
23     #endif
24    
25     #include <inttypes.h>
26    
27     struct MD5Context
28     {
29     uint32_t buf[4];
30     uint32_t bits[2];
31     unsigned char in[64];
32     };
33    
34     E void MD5Init (MD5Context *ctx);
35     E void MD5Update (MD5Context *ctx, unsigned char const *buf, unsigned len);
36     E void MD5Final (unsigned char digest[16], MD5Context *ctx);
37     E void MD5Transform (uint32_t buf[4], uint32_t in[16]);
38    
39     /*
40     * This is needed to make RSAREF happy on some MS-DOS compilers.
41     */
42     typedef struct MD5Context MD5_CTX;
43    
44     /* Define CHECK_HARDWARE_PROPERTIES to have main,c verify
45     byte order and uint32 settings. */
46     #define CHECK_HARDWARE_PROPERTIES
47    
48     #endif /* !MD5_H */