plugins/icq/digest.c File Reference

#include "ekg2-config.h"
#include <ekg/win32.h>
#include <ekg/debug.h>
#include <stdint.h>
#include <ekg/stuff.h>
#include <ekg/xmalloc.h>
#include <stdio.h>
#include <string.h>

Data Structures

struct  EKG2_MD5_CTX

Defines

#define MD5Init(ctx)   Init(ctx)
#define MD5Transform(state, buffer)   Transform(state, buffer)
#define MD5Update(ctx, data, len)   Update(ctx, (unsigned char *) data, len)
#define MD5Final(digest, ctx)   Final(digest, ctx)
#define rol(value, bits)   (((value) << (bits)) | ((value) >> (32 - (bits))))
#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 FF(a, b, c, d, x, s, ac)   { (a) += F ((b), (c), (d)) + (x) + (uint32_t)(ac); (a) = rol((a), (s)); (a) += (b); }
#define GG(a, b, c, d, x, s, ac)   { (a) += G ((b), (c), (d)) + (x) + (uint32_t)(ac); (a) = rol((a), (s)); (a) += (b); }
#define HH(a, b, c, d, x, s, ac)   { (a) += H ((b), (c), (d)) + (x) + (uint32_t)(ac); (a) = rol((a), (s)); (a) += (b); }
#define II(a, b, c, d, x, s, ac)   { (a) += I ((b), (c), (d)) + (x) + (uint32_t)(ac); (a) = rol((a), (s)); (a) += (b); }
#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 Init (EKG2_MD5_CTX *context)
static void Transform (uint32_t state[4], unsigned char buffer[64])
static void Update (EKG2_MD5_CTX *context, unsigned char *data, unsigned int len)
static void Final (unsigned char digest[20], EKG2_MD5_CTX *context)
static void Encode (unsigned char *output, uint32_t *input, unsigned int len)
static void Final (unsigned char digest[16], EKG2_MD5_CTX *context)
char * icq_md5_digest (const char *password, const unsigned char *key, int key_len)

Define Documentation

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

#define FF ( a,
b,
c,
d,
x,
s,
ac   )     { (a) += F ((b), (c), (d)) + (x) + (uint32_t)(ac); (a) = rol((a), (s)); (a) += (b); }

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

#define GG ( a,
b,
c,
d,
x,
s,
ac   )     { (a) += G ((b), (c), (d)) + (x) + (uint32_t)(ac); (a) = rol((a), (s)); (a) += (b); }

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

#define HH ( a,
b,
c,
d,
x,
s,
ac   )     { (a) += H ((b), (c), (d)) + (x) + (uint32_t)(ac); (a) = rol((a), (s)); (a) += (b); }

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

#define II ( a,
b,
c,
d,
x,
s,
ac   )     { (a) += I ((b), (c), (d)) + (x) + (uint32_t)(ac); (a) = rol((a), (s)); (a) += (b); }

#define MD5Final ( digest,
ctx   )     Final(digest, ctx)

#define MD5Init ( ctx   )     Init(ctx)

#define MD5Transform ( state,
buffer   )     Transform(state, buffer)

#define MD5Update ( ctx,
data,
len   )     Update(ctx, (unsigned char *) data, len)

#define rol ( value,
bits   )     (((value) << (bits)) | ((value) >> (32 - (bits))))

#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


Function Documentation

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

static void Final ( unsigned char  digest[16],
EKG2_MD5_CTX context 
) [static]

static void Final ( unsigned char  digest[20],
EKG2_MD5_CTX context 
) [static]

char* icq_md5_digest ( const char *  password,
const unsigned char *  key,
int  key_len 
)

static void Init ( EKG2_MD5_CTX context  )  [static]

static void Transform ( uint32_t  state[4],
unsigned char  buffer[64] 
) [static]

static void Update ( EKG2_MD5_CTX context,
unsigned char *  data,
unsigned int  len 
) [static]


Generated on Mon Jan 5 22:30:53 2009 for ekg2 by  doxygen 1.5.1