enc_old.c File Reference

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

Go to the source code of this file.

Data Structures

struct  MD5_CTX

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 II(a, b, c, d, x, s, ac)
#define MD5_I(x, y, z)   ((y) ^ ((x) | (~z)))
#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
#define XTOI(c)   ((c)>9 ? (c)-'A'+10 : (c)-'0')

Typedefs

typedef void * POINTER
typedef unsigned int UINT4

Functions

void AnopeFini (void)
int AnopeInit (int argc, char **argv)
void binary_to_hex (unsigned char *bin, char *hex, int length)
int old_check_password (const char *plaintext, const char *password)
int old_decrypt (const char *src, char *dest, int size)
int old_encrypt (const char *src, int len, char *dest, int size)
int old_encrypt_check_len (int passlen, int bufsize)
int old_encrypt_in_place (char *buf, int size)


Define Documentation

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

Definition at line 106 of file enc_old.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 118 of file enc_old.c.

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

Definition at line 107 of file enc_old.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 123 of file enc_old.c.

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

Definition at line 108 of file enc_old.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 128 of file enc_old.c.

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

Value:

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

Definition at line 133 of file enc_old.c.

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

Definition at line 109 of file enc_old.c.

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

Definition at line 113 of file enc_old.c.

#define S11   7

Definition at line 77 of file enc_old.c.

#define S12   12

Definition at line 78 of file enc_old.c.

#define S13   17

Definition at line 79 of file enc_old.c.

#define S14   22

Definition at line 80 of file enc_old.c.

#define S21   5

Definition at line 81 of file enc_old.c.

#define S22   9

Definition at line 82 of file enc_old.c.

#define S23   14

Definition at line 83 of file enc_old.c.

#define S24   20

Definition at line 84 of file enc_old.c.

#define S31   4

Definition at line 85 of file enc_old.c.

#define S32   11

Definition at line 86 of file enc_old.c.

#define S33   16

Definition at line 87 of file enc_old.c.

#define S34   23

Definition at line 88 of file enc_old.c.

#define S41   6

Definition at line 89 of file enc_old.c.

#define S42   10

Definition at line 90 of file enc_old.c.

#define S43   15

Definition at line 91 of file enc_old.c.

#define S44   21

Definition at line 92 of file enc_old.c.

#define XTOI (  )     ((c)>9 ? (c)-'A'+10 : (c)-'0')

Definition at line 355 of file enc_old.c.


Typedef Documentation

typedef void* POINTER

Definition at line 73 of file enc_old.c.

typedef unsigned int UINT4

Definition at line 61 of file enc_old.c.


Function Documentation

void AnopeFini ( void   ) 

Definition at line 442 of file enc_old.c.

References encmodule_check_password(), encmodule_decrypt(), encmodule_encrypt(), encmodule_encrypt_check_len(), and encmodule_encrypt_in_place().

int AnopeInit ( int  argc,
char **  argv 
)

Definition at line 427 of file enc_old.c.

References encmodule_check_password(), encmodule_decrypt(), encmodule_encrypt(), encmodule_encrypt_check_len(), encmodule_encrypt_in_place(), ENCRYPTION, MOD_CONT, moduleAddAuthor(), moduleAddVersion(), moduleSetType(), old_check_password(), old_decrypt(), old_encrypt(), old_encrypt_check_len(), and old_encrypt_in_place().

void binary_to_hex ( unsigned char *  bin,
char *  hex,
int  length 
)

Definition at line 17 of file enc_old.c.

int old_check_password ( const char *  plaintext,
const char *  password 
)

Definition at line 410 of file enc_old.c.

References BUFSIZE, and old_encrypt().

Referenced by AnopeInit().

int old_decrypt ( const char *  src,
char *  dest,
int  size 
)

Definition at line 422 of file enc_old.c.

Referenced by AnopeInit().

int old_encrypt ( const char *  src,
int  len,
char *  dest,
int  size 
)

Definition at line 362 of file enc_old.c.

References alog(), binary_to_hex(), debug, MD5Final(), MD5Init(), MD5Update(), and XTOI.

Referenced by AnopeInit(), old_check_password(), and old_encrypt_in_place().

int old_encrypt_check_len ( int  passlen,
int  bufsize 
)

Definition at line 399 of file enc_old.c.

References fatal().

Referenced by AnopeInit().

int old_encrypt_in_place ( char *  buf,
int  size 
)

Definition at line 394 of file enc_old.c.

References old_encrypt().

Referenced by AnopeInit().


Generated on Sun Dec 30 09:26:55 2007 for Anope by  doxygen 1.5.1-20070107