| 
 | 
#include "global.h" : Y* {0 h, S0 U0 [% ]; b
#include "md5.h" 
2 ~# N' G9 k% y 
) m1 H/ a, }* |8 V' }( C* U/* Constants for MD5Transform routine. */ 
$ ?9 ?3 t3 y" b) B" |; Y# d   e" q7 n( O! K' ?
 ( [6 D0 w3 q* G5 a4 x  ~
#define S11 7 / w" X; s5 ?) _3 g
#define S12 12 
7 D: `  o( O: A. K; m: ?#define S13 17 
9 j+ C4 Z1 F& R3 q#define S14 22 
; ~" a) @$ A6 }( }8 P#define S21 5 
* ^/ N5 Y$ i8 y/ r" i4 {( Q0 R#define S22 9 2 h  O3 O6 y4 c0 I
#define S23 14 ! \2 Z, V* P8 U9 |
#define S24 20 
1 m" \, \, c0 w/ n8 r7 p#define S31 4 0 I7 i0 V* A2 y8 i
#define S32 11 9 X. ~. Z/ O. R6 L' M  H! j2 D: x5 @
#define S33 16 3 `! n* W; x, f& _( u* m+ H
#define S34 23 0 K. t3 }  X9 V$ E) a' K
#define S41 6 # c7 @( c: A6 Q: Q2 h3 X
#define S42 10 1 ]( A- v( _+ r7 m1 @) B
#define S43 15 9 x( d* r( m, h" g, Y: x$ Q. y, y
#define S44 21 3 Z9 B& Q' S% i* W
 # p( P3 a  ~# x  f
static void MD5Transform PROTO_LIST ((UINT4 [4], unsigned char [64])); 
2 ?) {& T/ E+ k  y! fstatic void Encode PROTO_LIST ((unsigned char *, UINT4 *, unsigned int)); 
, V; G( D# }/ B1 q- rstatic void Decode PROTO_LIST ((UINT4 *, unsigned char *, unsigned int)); 
  D( s8 g9 Y9 P3 D( gstatic void MD5_memcpy PROTO_LIST ((POINTER, POINTER, unsigned int)); ) G# g. w3 y+ n+ r5 Q" s( g) q8 o
static void MD5_memset PROTO_LIST ((POINTER, int, unsigned int)); 
( K8 q* b+ }+ Z$ _3 [9 P - k8 k2 i3 g+ d8 ~) P
static unsigned char PADDING[64] = { 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 6 J1 U* i' M1 l+ S
}; ) ?" [* D+ q& a5 @0 P. z) I! O
 
* l' `% h, U# t/* F, G, H and I are basic MD5 functions. */ & ^$ y7 C8 K' N; Q3 u) J  o& D+ k
#define F(x, y, z) (((x) & (y)) | ((~x) & (z))) 
7 i, Q0 L. O8 e7 e8 P% E# u#define G(x, y, z) (((x) & (z)) | ((y) & (~z))) 
4 @, L$ n4 G: B/ G6 K1 |. s9 T#define H(x, y, z) ((x) ^ (y) ^ (z)) 7 |! J1 n- `0 s6 W5 v* d6 T6 t
#define I(x, y, z) ((y) ^ ((x) | (~z))) 
) a/ U9 Y0 V/ ^6 A% M 
/ y/ |# h9 y. d- h/* ROTATE_LEFT rotates x left n bits. */ ( @/ W  ^$ j$ A  i* I
#define ROTATE_LEFT(x, n) (((x) << (n)) | ((x) >> (32-(n)))) # [4 O8 h  M+ w5 Y( m
 % \( S& m- S8 q" a5 j
/* FF, GG, HH, and II transformations for rounds 1, 2, 3, and 4. 7 k+ [: g7 X. R& d
Rotation is separate from addition to prevent recomputation. */ 9 q( C7 W8 m  l; M' D' [
#define FF(a, b, c, d, x, s, ac) { \ (a) += F ((b), (c), (d)) + (x) + (UINT4)(ac); \ (a) = ROTATE_LEFT ((a), (s)); \ (a) += (b); \ } 4 }9 F* f; w3 _9 B) l) P! n+ t% ^( i  \
#define GG(a, b, c, d, x, s, ac) { \ (a) += G ((b), (c), (d)) + (x) + (UINT4)(ac); \ (a) = ROTATE_LEFT ((a), (s)); \ (a) += (b); \ } 
: I% p/ V$ d  F( X0 O( R7 [5 U' A0 x#define HH(a, b, c, d, x, s, ac) { \ (a) += H ((b), (c), (d)) + (x) + (UINT4)(ac); \ (a) = ROTATE_LEFT ((a), (s)); \ (a) += (b); \ } 
9 S) K# F/ p9 {#define II(a, b, c, d, x, s, ac) { \ (a) += I ((b), (c), (d)) + (x) + (UINT4)(ac); \ (a) = ROTATE_LEFT ((a), (s)); \ (a) += (b); \ } , z3 X0 ~+ Y. B4 n
 . [) z, t2 a* ]+ v) f
/* MD5 initialization. Begins an MD5 operation, writing a new context. */ 
& `5 S+ I5 j& S% d' e5 }- X5 {5 Tvoid MD5Init (context) 
, ?; k$ y2 @9 W4 BMD5_CTX *context; /* context */ 
2 Y; x; O5 X+ f/ W- t" L{ context->count[0] = context->count[1] = 0; /* Load magic initialization constants. 9 \* p! r: v3 l  v. n" _  G
*/ context->state[0] = 0x67452301; context->state[1] = 0xefcdab89; context->state[2] = 0x98badcfe; context->state[3] = 0x10325476; 
6 T! X0 I+ @, B/ K: N2 S} - H- A5 T5 [1 ~. l9 ^
 ! ?% ]. W' f2 n9 J
/* MD5 block update operation. Continues an MD5 message-digest operation, processing another message block, and updating the context. */ # s# Z8 Q+ `" d" [. D# G
void MD5Update (context, input, inputLen) 
1 Q& C0 a) J+ n  u- Y% d8 tMD5_CTX *context; /* context */ 
3 K  x; a7 m2 C6 I" ]$ x' o( e$ hunsigned char *input; /* input block */ 
* H* Q" O* Y5 Q8 A( r4 [unsigned int inputLen; /* length of input block */ 
( N6 O) a( ]4 O5 l) f+ m{ unsigned int i, index, partLen; ) G& J( x; ]0 w% A
 /* Compute number of bytes mod 64 */ index = (unsigned int)((context->count[0] >> 3) & 0x3F); ! C: p, \% A3 u# @2 z) u
 /* Update number of bits */ if ((context->count[0] += ((UINT4)inputLen << 3)) & |   
 
 
 
 |