#include <stdio.h>#include <stdlib.h>#include "MD5.h"Go to the source code of this file.
Defines | |
| #define | MD5_F(x, y, z) (((x) & (y)) | ((~x) & (z))) |
| #define | MD5_G(x, y, z) (((x) & (z)) | ((y) & (~z))) |
| #define | MD5_H(x, y, z) ((x) ^ (y) ^ (z)) |
| #define | MD5_I(x, y, z) ((y) ^ ((x) | (~z))) |
| #define | ROTATE_LEFT(x, n) (((x) << (n)) | ((x) >> (32-(n)))) |
| #define | MD5_FF(a, b, c, d, x, s, ac) {(a) += MD5_F ((b), (c), (d)) + (x) + (UINT4)(ac); (a) = ROTATE_LEFT ((a), (s)); (a) += (b); } |
| #define | MD5_GG(a, b, c, d, x, s, ac) {(a) += MD5_G ((b), (c), (d)) + (x) + (UINT4)(ac); (a) = ROTATE_LEFT ((a), (s)); (a) += (b); } |
| #define | MD5_HH(a, b, c, d, x, s, ac) {(a) += MD5_H ((b), (c), (d)) + (x) + (UINT4)(ac); (a) = ROTATE_LEFT ((a), (s)); (a) += (b); } |
| #define | MD5_II(a, b, c, d, x, s, ac) {(a) += MD5_I ((b), (c), (d)) + (x) + (UINT4)(ac); (a) = ROTATE_LEFT ((a), (s)); (a) += (b); } |
| #define | MD5_S11 7 |
| #define | MD5_S12 12 |
| #define | MD5_S13 17 |
| #define | MD5_S14 22 |
| #define | MD5_S21 5 |
| #define | MD5_S22 9 |
| #define | MD5_S23 14 |
| #define | MD5_S24 20 |
| #define | MD5_S31 4 |
| #define | MD5_S32 11 |
| #define | MD5_S33 16 |
| #define | MD5_S34 23 |
| #define | MD5_S41 6 |
| #define | MD5_S42 10 |
| #define | MD5_S43 15 |
| #define | MD5_S44 21 |
Functions | |
| static void | MD5_Transform (UINT4 *buf, UINT4 *in) |
| void | MD5Init (MD5_CTX *mdContext, unsigned long pseudoRandomNumber) |
| void | MD5Update (MD5_CTX *mdContext, unsigned char *inBuf, unsigned int inLen) |
| void | MD5Final (MD5_CTX *mdContext) |
| int | md5file (char *fn, unsigned long seed, MD5_CTX *mdContext) |
Variables | |
| static unsigned char | MD5_PADDING [64] |
| #define MD5_S11 7 |
| #define MD5_S12 12 |
| #define MD5_S13 17 |
| #define MD5_S14 22 |
| #define MD5_S21 5 |
| #define MD5_S22 9 |
| #define MD5_S23 14 |
| #define MD5_S24 20 |
| #define MD5_S31 4 |
| #define MD5_S32 11 |
| #define MD5_S33 16 |
| #define MD5_S34 23 |
| #define MD5_S41 6 |
| #define MD5_S42 10 |
| #define MD5_S43 15 |
| #define MD5_S44 21 |
| int md5file | ( | char * | fn, | |
| unsigned long | seed, | |||
| MD5_CTX * | mdContext | |||
| ) |
Definition at line 214 of file md5.cpp.
References fread(), MD5Final(), MD5Init(), MD5Update(), and NULL.
| void MD5Final | ( | MD5_CTX * | mdContext | ) |
Definition at line 179 of file md5.cpp.
References MD5_CTX::buf, MD5_CTX::digest, MD5_CTX::i, MD5_CTX::in, MD5_PADDING, MD5_Transform(), and MD5Update().
Referenced by vmsHash::Hash_MD5_File(), and md5file().
| void MD5Init | ( | MD5_CTX * | mdContext, | |
| unsigned long | pseudoRandomNumber | |||
| ) |
Definition at line 133 of file md5.cpp.
References MD5_CTX::buf, and MD5_CTX::i.
Referenced by vmsHash::Hash_MD5_File(), and md5file().
| void MD5Update | ( | MD5_CTX * | mdContext, | |
| unsigned char * | inBuf, | |||
| unsigned int | inLen | |||
| ) |
Definition at line 144 of file md5.cpp.
References MD5_CTX::buf, MD5_CTX::i, MD5_CTX::in, and MD5_Transform().
Referenced by vmsHash::Hash_MD5_File(), md5file(), and MD5Final().
unsigned char MD5_PADDING[64] [static] |
Initial value:
{
0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
}
Definition at line 9 of file md5.cpp.
Referenced by MD5Final().
1.5.6