D:/opendownloadmanager/ODM-1.x/InetFile/cURL_lib/md5.c File Reference

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

Go to the source code of this file.

Classes

struct  md5_ctx

Defines

#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
#define F(x, y, z)   (((x) & (y)) | ((~x) & (z)))
#define G(x, y, z)   (((x) & (z)) | ((y) & (~z)))
#define H(x, y, z)   ((x) ^ (y) ^ (z))
#define I(x, y, z)   ((y) ^ ((x) | (~z)))
#define ROTATE_LEFT(x, n)   (((x) << (n)) | ((x) >> (32-(n))))
#define FF(a, b, c, d, x, s, ac)
#define GG(a, b, c, d, x, s, ac)
#define HH(a, b, c, d, x, s, ac)
#define II(a, b, c, d, x, s, ac)

Typedefs

typedef unsigned int UINT4
typedef struct md5_ctx MD5_CTX

Functions

static void MD5_Init (struct md5_ctx *)
static void MD5_Update (struct md5_ctx *, const unsigned char *, unsigned int)
static void MD5_Final (unsigned char[16], struct md5_ctx *)
static void MD5Transform (UINT4[4], const unsigned char[64])
static void Encode (unsigned char *, UINT4 *, unsigned int)
static void Decode (UINT4 *, const unsigned char *, unsigned int)
void Curl_md5it (unsigned char *outbuffer, const unsigned char *input)

Variables

static const unsigned char PADDING [64]


Define Documentation

#define F ( x,
y,
 )     (((x) & (y)) | ((~x) & (z)))

Definition at line 105 of file md5.c.

#define FF ( a,
b,
c,
d,
x,
s,
ac   ) 

Value:

{ \
 (a) += F ((b), (c), (d)) + (x) + (UINT4)(ac); \
 (a) = ROTATE_LEFT ((a), (s)); \
 (a) += (b); \
  }

Definition at line 117 of file md5.c.

Referenced by MD5Transform().

#define G ( x,
y,
 )     (((x) & (z)) | ((y) & (~z)))

Definition at line 106 of file md5.c.

#define GG ( a,
b,
c,
d,
x,
s,
ac   ) 

Value:

{ \
 (a) += G ((b), (c), (d)) + (x) + (UINT4)(ac); \
 (a) = ROTATE_LEFT ((a), (s)); \
 (a) += (b); \
  }

Definition at line 122 of file md5.c.

Referenced by MD5Transform().

#define H ( x,
y,
 )     ((x) ^ (y) ^ (z))

Definition at line 107 of file md5.c.

#define HH ( a,
b,
c,
d,
x,
s,
ac   ) 

Value:

{ \
 (a) += H ((b), (c), (d)) + (x) + (UINT4)(ac); \
 (a) = ROTATE_LEFT ((a), (s)); \
 (a) += (b); \
  }

Definition at line 127 of file md5.c.

Referenced by MD5Transform().

#define I ( x,
y,
 )     ((y) ^ ((x) | (~z)))

Definition at line 108 of file md5.c.

#define II ( a,
b,
c,
d,
x,
s,
ac   ) 

Value:

{ \
 (a) += I ((b), (c), (d)) + (x) + (UINT4)(ac); \
 (a) = ROTATE_LEFT ((a), (s)); \
 (a) += (b); \
  }

Definition at line 132 of file md5.c.

Referenced by MD5Transform().

#define ROTATE_LEFT ( x,
n   )     (((x) << (n)) | ((x) >> (32-(n))))

Definition at line 112 of file md5.c.

#define S11   7

Definition at line 76 of file md5.c.

Referenced by MD5Transform().

#define S12   12

Definition at line 77 of file md5.c.

Referenced by MD5Transform().

#define S13   17

Definition at line 78 of file md5.c.

Referenced by MD5Transform().

#define S14   22

Definition at line 79 of file md5.c.

Referenced by MD5Transform().

#define S21   5

Definition at line 80 of file md5.c.

Referenced by MD5Transform().

#define S22   9

Definition at line 81 of file md5.c.

Referenced by MD5Transform().

#define S23   14

Definition at line 82 of file md5.c.

Referenced by MD5Transform().

#define S24   20

Definition at line 83 of file md5.c.

Referenced by MD5Transform().

#define S31   4

Definition at line 84 of file md5.c.

Referenced by MD5Transform().

#define S32   11

Definition at line 85 of file md5.c.

Referenced by MD5Transform().

#define S33   16

Definition at line 86 of file md5.c.

Referenced by MD5Transform().

#define S34   23

Definition at line 87 of file md5.c.

Referenced by MD5Transform().

#define S41   6

Definition at line 88 of file md5.c.

Referenced by MD5Transform().

#define S42   10

Definition at line 89 of file md5.c.

Referenced by MD5Transform().

#define S43   15

Definition at line 90 of file md5.c.

Referenced by MD5Transform().

#define S44   21

Definition at line 91 of file md5.c.

Referenced by MD5Transform().


Typedef Documentation

typedef struct md5_ctx MD5_CTX

Definition at line 67 of file md5.c.

typedef unsigned int UINT4

Definition at line 58 of file md5.c.


Function Documentation

void Curl_md5it ( unsigned char *  outbuffer,
const unsigned char *  input 
)

Definition at line 343 of file md5.c.

References MD5_Final(), MD5_Init(), and MD5_Update().

Referenced by Curl_output_digest().

static void Decode ( UINT4 output,
const unsigned char *  input,
unsigned int  len 
) [static]

Definition at line 324 of file md5.c.

Referenced by MD5Transform().

static void Encode ( unsigned char *  output,
UINT4 input,
unsigned int  len 
) [static]

Definition at line 307 of file md5.c.

Referenced by MD5_Final().

static void MD5_Final ( unsigned char  digest[16],
struct md5_ctx context 
) [static]

Definition at line 191 of file md5.c.

References bits, md5_ctx::count, count, Encode(), MD5_Update(), PADDING, and md5_ctx::state.

Referenced by Curl_md5it().

static void MD5_Init ( struct md5_ctx context  )  [static]

Definition at line 140 of file md5.c.

References md5_ctx::count, and md5_ctx::state.

Referenced by Curl_md5it().

static void MD5_Update ( struct md5_ctx context,
const unsigned char *  input,
unsigned int  inputLen 
) [static]

Definition at line 154 of file md5.c.

References md5_ctx::buffer, md5_ctx::count, MD5Transform(), and md5_ctx::state.

Referenced by Curl_md5it(), and MD5_Final().

static void MD5Transform ( UINT4  state[4],
const unsigned char  block[64] 
) [static]

Definition at line 216 of file md5.c.

References a, b, c, Decode(), FF, GG, HH, II, S11, S12, S13, S14, S21, S22, S23, S24, S31, S32, S33, S34, S41, S42, S43, and S44.

Referenced by MD5_Update().


Variable Documentation

const 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 97 of file md5.c.

Referenced by MD5_Final().


Generated on Sun May 25 00:20:07 2008 by  doxygen 1.5.6