ELinks 0.16.1.1
|
MD5 implementation (RFC 1321) More...
Macros | |
#define | F1(x, y, z) |
#define | F2(x, y, z) |
#define | F3(x, y, z) |
#define | F4(x, y, z) |
#define | MD5STEP(f, w, x, y, z, data, s) |
This is the central step in the MD5 algorithm. |
Functions | |
static void | transform_md5 (uint32_t buf[4], uint32_t const in[16]) |
The core of the MD5 algorithm, this alters an existing MD5 hash to reflect the addition of 16 longwords of new data. | |
static void | reverse_md5_bytes (unsigned char *buf, unsigned int longs) |
Swap the bytes of each uint32_t, if necessary. | |
unsigned char * | digest_md5 (const char *data, unsigned long length, md5_digest_bin_T digest) |
Digest the passed data with the given length and stores the MD5 digest in the digest parameter. |
MD5 implementation (RFC 1321)
This code implements the MD5 message-digest algorithm. The algorithm is due to Ron Rivest.
This code was written by Colin Plumb in 1993, no copyright is claimed. This code is in the public domain; do with it what you wish.
This code was slightly modified to fit into Samba by abart.nosp@m.let@.nosp@m.samba.nosp@m..org Jun 2001 and to fit the cifs vfs by Steve French sfren.nosp@m.ch@u.nosp@m.s.ibm.nosp@m..com. Grabbed from linux-2.6.9 one November afternoon 2004 and ELinksified' by jonas.
Equivalent code is available from RSA Data Security, Inc. This code has been tested against that, and is equivalent, except that you don't need to include two pages of legalese with every copy.
#define F1 | ( | x, | |
y, | |||
z ) |
#define F3 | ( | x, | |
y, | |||
z ) |
#define F4 | ( | x, | |
y, | |||
z ) |
#define MD5STEP | ( | f, | |
w, | |||
x, | |||
y, | |||
z, | |||
data, | |||
s ) |
unsigned char * digest_md5 | ( | const char * | data, |
unsigned long | length, | ||
md5_digest_bin_T | digest ) |
Digest the passed data with the given length and stores the MD5 digest in the digest parameter.
|
static |
Swap the bytes of each uint32_t, if necessary.
This code is harmless on little-endian machines.
|
static |
The core of the MD5 algorithm, this alters an existing MD5 hash to reflect the addition of 16 longwords of new data.
md5_update() blocks the data and converts bytes into longwords for this routine.