2 This file is adapted from a program in this page:
4 http://www.fourmilab.ch/md5/
6 The original source code does not work on 64-bit machines due to the
7 wrong typedef "uint32". I also added prototypes.
15 /* The following tests optimise behaviour on little-endian
16 machines, where there is no need to reverse the byte order
17 of 32 bit words in the MD5 computation. By default,
18 HIGHFIRST is defined, which indicates we're running on a
19 big-endian (most significant byte first) machine, on which
20 the byteReverse function in md5.c must be invoked. However,
21 byteReverse is coded in such a way that it is an identity
22 function when run on a little-endian machine, so calling it
23 on such a platform causes no harm apart from wasting time.
24 If the platform is known to be little-endian, we speed
25 things up by undefining HIGHFIRST, which defines
26 byteReverse as a null macro. Doing things in this manner
27 insures we work on new platforms regardless of their byte
32 #if __LITTLE_ENDIAN__ != 0
44 void MD5Init(struct MD5Context *ctx);
45 void MD5Update(struct MD5Context *ctx, unsigned char *buf, unsigned len);
46 void MD5Final(unsigned char digest[16], struct MD5Context *ctx);
49 * This is needed to make RSAREF happy on some MS-DOS compilers.
51 typedef struct MD5Context MD5_CTX;
53 /* Define CHECK_HARDWARE_PROPERTIES to have main,c verify
54 byte order and uint32_t settings. */
55 #define CHECK_HARDWARE_PROPERTIES