md5 digest routines. More...
Go to the source code of this file.
Macros | |
#define | SELF_TEST 1 |
#define | _CRT_SECURE_NO_DEPRECATE 1 |
#define | GET_UINT32_LE(n, b, i) |
#define | PUT_UINT32_LE(n, b, i) |
#define | S(x, n) ((x << n) | ((x & 0xFFFFFFFF) >> (32 - n))) |
#define | P(a, b, c, d, k, s, t) |
#define | F(x, y, z) (z ^ (x & (y ^ z))) |
#define | F(x, y, z) (y ^ (z & (x ^ y))) |
#define | F(x, y, z) (x ^ y ^ z) |
#define | F(x, y, z) (y ^ (x | ~z)) |
Functions | |
void | md5_starts (md5_context *ctx) |
Initialize and setup a MD5 context structure. More... | |
static void | md5_process (md5_context *ctx, const unsigned char data[64]) |
void | md5_update (md5_context *ctx, const unsigned char *input, int ilen) |
Adds data to the MD5 process buffer. More... | |
void | md5_finish (md5_context *ctx, unsigned char output[16]) |
Retrieve the final MD5 digest. More... | |
int | md5_file (char *path, unsigned char output[16]) |
void | md5_csum (const unsigned char *input, int ilen, unsigned char output[16]) |
Convenience function to calculate the MD5 sum of an input buffer. More... | |
void | md5_hmac (unsigned char *key, int keylen, const unsigned char *input, int ilen, unsigned char output[16]) |
Calculates a "Hashed MAC" of an input buffer combined with a secret key. More... | |
void | md5_hex (const void *input, size_t len, char output[33]) |
Convenience function to calculate the MD5 sum of an input buffer; returns string with the MD5 encoded in hexadecimal. More... | |
void | md5_string (const char *input, char output[33]) |
Calculates the hex string of MD5 of null terminated input. More... | |
int64_t | md5_hash (const char *input) |
Returns a 64-bit hash checksum of a null terminated input buffer. More... | |
void | digest_to_trunc_modified_base64 (const char digest[16], char output[17]) |
Get the modified base64 encoded string of a 16 byte message digest see http://en.wikipedia.org/wiki/Base64#URL_applications for more information. More... | |
void | md5_trunc_modified_base64 (const char *input, char output[17]) |
Get the modified base64 encoded string of the first 12 Bytes of the 16 Byte MD5 code of a null terminated output; see http://en.wikipedia.org/wiki/Base64#URL_applications for more information. More... | |
int | md5_self_test (void) |
Runs a self test. More... | |
Variables | |
static const char | mb64_charset [] ="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_" |
static const unsigned char | md5_padding [64] |
static const char | _md5_src [] = "_md5_src" |
static const char | hex_digits [] = "0123456789ABCDEF" |
static const char | md5_test_str [7][81] |
static const unsigned char | md5_test_sum [7][16] |
md5 digest routines.
This file implements the md5 digest algorithm and also has several helper functions like calculating the md5 of a file or a string. The MD5 algorithm was designed by Ron Rivest in 1991 (http://www.ietf.org/rfc/rfc1321.txt).
Definition in file md5.cc.
#define F | ( | x, | |
y, | |||
z | |||
) | (z ^ (x & (y ^ z))) |
#define F | ( | x, | |
y, | |||
z | |||
) | (y ^ (z & (x ^ y))) |
#define F | ( | x, | |
y, | |||
z | |||
) | (x ^ y ^ z) |
#define F | ( | x, | |
y, | |||
z | |||
) | (y ^ (x | ~z)) |
#define GET_UINT32_LE | ( | n, | |
b, | |||
i | |||
) |
#define P | ( | a, | |
b, | |||
c, | |||
d, | |||
k, | |||
s, | |||
t | |||
) |
#define PUT_UINT32_LE | ( | n, | |
b, | |||
i | |||
) |
#define S | ( | x, | |
n | |||
) | ((x << n) | ((x & 0xFFFFFFFF) >> (32 - n))) |
|
static |
|
static |
|
static |
|
static |
|
static |