#include <string.h>
#include "md5.h"

Go to the source code of this file.
Defines | |
| #define | F(x, y, z) (((x) & (y)) | ((~x) & (z))) |
| #define | FF(a, b, c, d, x, s, ac) |
| #define | G(x, y, z) (((x) & (z)) | ((y) & (~z))) |
| #define | GG(a, b, c, d, x, s, ac) |
| #define | H(x, y, z) ((x) ^ (y) ^ (z)) |
| #define | HH(a, b, c, d, x, s, ac) |
| #define | I(x, y, z) ((y) ^ ((x) | (~z))) |
| #define | II(a, b, c, d, x, s, ac) |
| #define | ROTATE_LEFT(x, n) (((x) << (n)) | ((x) >> (32-(n)))) |
| #define | S11 7 |
| #define | S12 12 |
| #define | S13 17 |
| #define | S14 22 |
| #define | S21 5 |
| #define | S22 9 |
| #define | S23 14 |
| #define | S24 20 |
| #define | S31 4 |
| #define | S32 11 |
| #define | S33 16 |
| #define | S34 23 |
| #define | S41 6 |
| #define | S42 10 |
| #define | S43 15 |
| #define | S44 21 |
Functions | |
| static void | Decode (unsigned int *output, unsigned char *input, unsigned int len) |
| Decodes input (unsigned char) into output (unsigned int). | |
| static void | Encode (unsigned char *output, unsigned int *input, unsigned int len) |
| Encodes input (unsigned int) into output (unsigned char). | |
| void | MD5Init (MD5_CTX *context) |
| MD5 initialization. Begins an MD5 operation, writing a new context. | |
| static void | MD5Transform (unsigned int state[4], unsigned char block[64]) |
| MD5 basic transformation. Transforms state based on block. | |
| void | U_MD5Final (unsigned char digest[16], MD5_CTX *context) |
| MD5 finalization. | |
| void | U_MD5Update (MD5_CTX *context, unsigned char *input, unsigned int inputLen) |
| MD5 block update operation. | |
Variables | |
| static unsigned char | PADDING [64] |
Definition in file md5.c.
| #define FF | ( | a, | |||
| b, | |||||
| c, | |||||
| d, | |||||
| x, | |||||
| s, | |||||
| ac | ) |
Value:
{ \
(a) += F ((b), (c), (d)) + (x) + (unsigned int)(ac); \
(a) = ROTATE_LEFT ((a), (s)); \
(a) += (b); \
}
Definition at line 84 of file md5.c.
Referenced by MD5Transform().
| #define GG | ( | a, | |||
| b, | |||||
| c, | |||||
| d, | |||||
| x, | |||||
| s, | |||||
| ac | ) |
Value:
{ \
(a) += G ((b), (c), (d)) + (x) + (unsigned int)(ac); \
(a) = ROTATE_LEFT ((a), (s)); \
(a) += (b); \
}
Definition at line 89 of file md5.c.
Referenced by MD5Transform().
| #define H | ( | x, | |||
| y, | |||||
| z | ) | ((x) ^ (y) ^ (z)) |
| #define HH | ( | a, | |||
| b, | |||||
| c, | |||||
| d, | |||||
| x, | |||||
| s, | |||||
| ac | ) |
Value:
{ \
(a) += H ((b), (c), (d)) + (x) + (unsigned int)(ac); \
(a) = ROTATE_LEFT ((a), (s)); \
(a) += (b); \
}
Definition at line 94 of file md5.c.
Referenced by MD5Transform().
| #define II | ( | a, | |||
| b, | |||||
| c, | |||||
| d, | |||||
| x, | |||||
| s, | |||||
| ac | ) |
Value:
{ \
(a) += I ((b), (c), (d)) + (x) + (unsigned int)(ac); \
(a) = ROTATE_LEFT ((a), (s)); \
(a) += (b); \
}
Definition at line 99 of file md5.c.
Referenced by MD5Transform().
| #define ROTATE_LEFT | ( | x, | |||
| n | ) | (((x) << (n)) | ((x) >> (32-(n)))) |
| #define S11 7 |
| #define S12 12 |
| #define S13 17 |
| #define S14 22 |
| #define S21 5 |
| #define S22 9 |
| #define S23 14 |
| #define S24 20 |
| #define S31 4 |
| #define S32 11 |
| #define S33 16 |
| #define S34 23 |
| #define S41 6 |
| #define S42 10 |
| #define S43 15 |
| #define S44 21 |
| static void Decode | ( | unsigned int * | output, | |
| unsigned char * | input, | |||
| unsigned int | len | |||
| ) | [static] |
Decodes input (unsigned char) into output (unsigned int).
| output | output character | |
| input | input | |
| len | length |
Definition at line 315 of file md5.c.
Referenced by MD5Transform().
| static void Encode | ( | unsigned char * | output, | |
| unsigned int * | input, | |||
| unsigned int | len | |||
| ) | [static] |
Encodes input (unsigned int) into output (unsigned char).
| output | output character | |
| input | input | |
| len | length |
Definition at line 295 of file md5.c.
Referenced by U_MD5Final().
| void MD5Init | ( | MD5_CTX * | context | ) |
MD5 initialization. Begins an MD5 operation, writing a new context.
| context | MD5 context |
Definition at line 110 of file md5.c.
References MD5_CTX::count, and MD5_CTX::state.
Referenced by calc_HA1(), calc_nonce(), calc_response(), compute_md5(), hash(), MD5File(), MD5StringArray(), uac_calc_HA1(), uac_calc_HA2(), and uac_calc_response().
| static void MD5Transform | ( | unsigned int | state[4], | |
| unsigned char | block[64] | |||
| ) | [static] |
MD5 basic transformation. Transforms state based on block.
| state | transformed state | |
| block | input block |
Definition at line 200 of file md5.c.
References Decode(), FF, GG, HH, II, S11, S12, S13, S14, S21, S22, S23, S24, S31, S32, S33, S34, S41, S42, S43, and S44.
Referenced by U_MD5Update().
| void U_MD5Final | ( | unsigned char | digest[16], | |
| MD5_CTX * | context | |||
| ) |
MD5 finalization.
MD5 finalization. Ends an MD5 message-digest operation, writing the the message digest and zeroizing the context.
| digest | message digest | |
| context | MD5 context |
Definition at line 171 of file md5.c.
References MD5_CTX::count, Encode(), PADDING, MD5_CTX::state, and U_MD5Update().
Referenced by calc_nonce(), compute_md5(), MD5File(), MD5Final(), and MD5StringArray().
| void U_MD5Update | ( | MD5_CTX * | context, | |
| unsigned char * | input, | |||
| unsigned int | inputLen | |||
| ) |
MD5 block update operation.
MD5 block update operation. Continues an MD5 message-digest operation, processing another message block, and updating the context.
| context | MD5 context | |
| input | input block | |
| inputLen | length of input block |
Definition at line 131 of file md5.c.
References MD5_CTX::buffer, MD5_CTX::count, MD5Transform(), and MD5_CTX::state.
Referenced by MD5File(), MD5Update(), and U_MD5Final().
unsigned char PADDING[64] [static] |
Initial value:
{
0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
}
Definition at line 62 of file md5.c.
Referenced by U_MD5Final().
1.5.6