annotate src/md5/md5.h @ 162:52c82d755215

replaced the MD5 implementation with the one of Solar Designer Until now, the sample code of RFC 1321 was used. It had an ugly license. Now we use the implementation of Solar Designer, which is in the Public Domain. http://openwall.info/wiki/people/solar/software/public-domain-source-code/md5
author meillo@marmaro.de
date Sun, 18 Jul 2010 22:01:04 +0200
parents 26e34ae9a3e3
children 06525982a56c
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
162
52c82d755215 replaced the MD5 implementation with the one of Solar Designer
meillo@marmaro.de
parents: 10
diff changeset
1 /*
52c82d755215 replaced the MD5 implementation with the one of Solar Designer
meillo@marmaro.de
parents: 10
diff changeset
2 * This is an OpenSSL-compatible implementation of the RSA Data Security,
52c82d755215 replaced the MD5 implementation with the one of Solar Designer
meillo@marmaro.de
parents: 10
diff changeset
3 * Inc. MD5 Message-Digest Algorithm (RFC 1321).
52c82d755215 replaced the MD5 implementation with the one of Solar Designer
meillo@marmaro.de
parents: 10
diff changeset
4 *
52c82d755215 replaced the MD5 implementation with the one of Solar Designer
meillo@marmaro.de
parents: 10
diff changeset
5 * Written by Solar Designer <solar at openwall.com> in 2001, and placed
52c82d755215 replaced the MD5 implementation with the one of Solar Designer
meillo@marmaro.de
parents: 10
diff changeset
6 * in the public domain. There's absolutely no warranty.
52c82d755215 replaced the MD5 implementation with the one of Solar Designer
meillo@marmaro.de
parents: 10
diff changeset
7 *
52c82d755215 replaced the MD5 implementation with the one of Solar Designer
meillo@marmaro.de
parents: 10
diff changeset
8 * See md5.c for more information.
0
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
9 */
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
10
162
52c82d755215 replaced the MD5 implementation with the one of Solar Designer
meillo@marmaro.de
parents: 10
diff changeset
11 #ifdef HAVE_OPENSSL
52c82d755215 replaced the MD5 implementation with the one of Solar Designer
meillo@marmaro.de
parents: 10
diff changeset
12 #include <openssl/md5.h>
52c82d755215 replaced the MD5 implementation with the one of Solar Designer
meillo@marmaro.de
parents: 10
diff changeset
13 #elif !defined(_MD5_H)
52c82d755215 replaced the MD5 implementation with the one of Solar Designer
meillo@marmaro.de
parents: 10
diff changeset
14 #define _MD5_H
0
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
15
162
52c82d755215 replaced the MD5 implementation with the one of Solar Designer
meillo@marmaro.de
parents: 10
diff changeset
16 /* Any 32-bit or wider unsigned integer data type will do */
52c82d755215 replaced the MD5 implementation with the one of Solar Designer
meillo@marmaro.de
parents: 10
diff changeset
17 typedef unsigned int MD5_u32plus;
0
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
18
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
19 typedef struct {
162
52c82d755215 replaced the MD5 implementation with the one of Solar Designer
meillo@marmaro.de
parents: 10
diff changeset
20 MD5_u32plus lo, hi;
52c82d755215 replaced the MD5 implementation with the one of Solar Designer
meillo@marmaro.de
parents: 10
diff changeset
21 MD5_u32plus a, b, c, d;
52c82d755215 replaced the MD5 implementation with the one of Solar Designer
meillo@marmaro.de
parents: 10
diff changeset
22 unsigned char buffer[64];
52c82d755215 replaced the MD5 implementation with the one of Solar Designer
meillo@marmaro.de
parents: 10
diff changeset
23 MD5_u32plus block[16];
0
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
24 } MD5_CTX;
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
25
162
52c82d755215 replaced the MD5 implementation with the one of Solar Designer
meillo@marmaro.de
parents: 10
diff changeset
26 extern void MD5_Init(MD5_CTX *ctx);
52c82d755215 replaced the MD5 implementation with the one of Solar Designer
meillo@marmaro.de
parents: 10
diff changeset
27 extern void MD5_Update(MD5_CTX *ctx, void *data, unsigned long size);
52c82d755215 replaced the MD5 implementation with the one of Solar Designer
meillo@marmaro.de
parents: 10
diff changeset
28 extern void MD5_Final(unsigned char *result, MD5_CTX *ctx);
52c82d755215 replaced the MD5 implementation with the one of Solar Designer
meillo@marmaro.de
parents: 10
diff changeset
29
52c82d755215 replaced the MD5 implementation with the one of Solar Designer
meillo@marmaro.de
parents: 10
diff changeset
30 #endif