ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/ermyth/include/md5.h
Revision: 1.2
Committed: Tue Aug 28 17:08:06 2007 UTC (16 years, 9 months ago) by pippijn
Content type: text/plain
Branch: MAIN
Changes since 1.1: +9 -0 lines
Log Message:
- changed name
- updated the example config to the new system
- added more documentation
- enhanced documentation generators
- added a link to the pdf to the website
- added an RSS feed generator
- transitioned hooks to c++ callbacks
- did various merges with upstream along the way
- added const where appropriate
- removed the old block allocator
- fixed most memory leaks
- transitioned some dictionaries to std::map
- transitioned some lists to std::vector
- made some free functions members where appropriate
- renamed string to dynstr and added a static string ststr
- use NOW instead of time (NULL) if possible
- completely reworked database backends, crypto handlers and protocol handlers
  to use an object factory
- removed the old module system. ermyth does not do any dynamic loading anymore
- fixed most of the build system
- reworked how protocol commands work

File Contents

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