#include "module.h"#include <string.h>
Go to the source code of this file.
Data Structures | |
| 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) |
| #define | XTOI(c) ((c)>9 ? (c)-'A'+10 : (c)-'0') |
Typedefs | |
| typedef unsigned int | UINT4 |
| typedef void * | POINTER |
Functions | |
| void | MD5Transform (UINT4[4], unsigned char[64]) |
| void | Encode (unsigned char *, UINT4 *, unsigned int) |
| void | Decode (UINT4 *, unsigned char *, unsigned int) |
| void | MD5Init (MD5_CTX *context) |
| void | MD5Update (MD5_CTX *context, unsigned char *input, unsigned int inputLen) |
| void | MD5Final (digest, MD5_CTX *context) |
| void | MD5Transform (state, block) |
| int | md5_encrypt (const char *src, int len, char *dest, int size) |
| int | md5_encrypt_in_place (char *buf, int size) |
| int | md5_encrypt_check_len (int passlen, int bufsize) |
| int | md5_decrypt (const char *src, char *dest, int size) |
| int | md5_check_password (const char *plaintext, const char *password) |
| int | AnopeInit (int argc, char **argv) |
| void | AnopeFini (void) |
Variables | |
| static unsigned char | PADDING [64] |
| #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 100 of file enc_md5.c.
Referenced by MD5Transform().
| #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 105 of file enc_md5.c.
Referenced by MD5Transform().
| #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 110 of file enc_md5.c.
Referenced by MD5Transform().
| #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 115 of file enc_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 |
| void AnopeFini | ( | void | ) |
Definition at line 415 of file enc_md5.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 400 of file enc_md5.c.
References encmodule_check_password(), encmodule_decrypt(), encmodule_encrypt(), encmodule_encrypt_check_len(), encmodule_encrypt_in_place(), ENCRYPTION, md5_check_password(), md5_decrypt(), md5_encrypt(), md5_encrypt_check_len(), md5_encrypt_in_place(), MOD_CONT, moduleAddAuthor(), moduleAddVersion(), and moduleSetType().
| static void Decode | ( | UINT4 * | output, | |
| unsigned char * | input, | |||
| unsigned int | len | |||
| ) |
| static void Encode | ( | unsigned char * | output, | |
| UINT4 * | input, | |||
| unsigned int | len | |||
| ) |
| int md5_check_password | ( | const char * | plaintext, | |
| const char * | password | |||
| ) |
Definition at line 385 of file enc_md5.c.
References BUFSIZE, and md5_encrypt().
Referenced by AnopeInit().
| int md5_decrypt | ( | const char * | src, | |
| char * | dest, | |||
| int | size | |||
| ) |
| int md5_encrypt | ( | const char * | src, | |
| int | len, | |||
| char * | dest, | |||
| int | size | |||
| ) |
Definition at line 338 of file enc_md5.c.
References alog(), binary_to_hex(), debug, MD5Final(), MD5Init(), and MD5Update().
Referenced by AnopeInit(), md5_check_password(), and md5_encrypt_in_place().
| int md5_encrypt_check_len | ( | int | passlen, | |
| int | bufsize | |||
| ) |
| int md5_encrypt_in_place | ( | char * | buf, | |
| int | size | |||
| ) |
| void MD5Final | ( | digest | , | |
| MD5_CTX * | context | |||
| ) |
Definition at line 181 of file enc_md5.c.
References MD5_CTX::count, Encode(), MD5Update(), PADDING, and MD5_CTX::state.
Referenced by md5_encrypt(), and old_encrypt().
| void MD5Init | ( | MD5_CTX * | context | ) |
| void MD5Transform | ( | state | , | |
| block | ||||
| ) |
| void MD5Transform | ( | UINT4 | [4], | |
| unsigned | char[64] | |||
| ) |
Referenced by MD5Update().
| void MD5Update | ( | MD5_CTX * | context, | |
| unsigned char * | input, | |||
| unsigned int | inputLen | |||
| ) |
Definition at line 139 of file enc_md5.c.
References MD5Transform().
Referenced by md5_encrypt(), MD5Final(), and old_encrypt().
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 80 of file enc_md5.c.
Referenced by MD5Final().
1.5.7.1