diff options
Diffstat (limited to 'src/core/enc_old.c')
-rw-r--r-- | src/core/enc_old.c | 32 |
1 files changed, 9 insertions, 23 deletions
diff --git a/src/core/enc_old.c b/src/core/enc_old.c index 8c7d88e8e..77c1964c0 100644 --- a/src/core/enc_old.c +++ b/src/core/enc_old.c @@ -138,8 +138,7 @@ Rotation is separate from addition to prevent recomputation. /* MD5 initialization. Begins an MD5 operation, writing a new context. */ -static void MD5Init(context) -MD5_CTX *context; /* context */ +static void MD5Init(MD5_CTX *context) { context->count[0] = context->count[1] = 0; /* Load magic initialization constants. @@ -154,10 +153,7 @@ MD5_CTX *context; /* context */ operation, processing another message block, and updating the context. */ -static void MD5Update(context, input, inputLen) -MD5_CTX *context; /* context */ -unsigned char *input; /* input block */ -unsigned int inputLen; /* length of input block */ +static void MD5Update(MD5_CTX *context, unsigned char *input, unsigned int inputLen) { unsigned int i, index, partLen; @@ -195,9 +191,7 @@ unsigned int inputLen; /* length of input block */ /* MD5 finalization. Ends an MD5 message-digest operation, writing the the message digest and zeroizing the context. */ -static void MD5Final(digest, context) -unsigned char digest[16]; /* message digest */ -MD5_CTX *context; /* context */ +static void MD5Final(unsigned char digest[16], MD5_CTX *context) { unsigned char bits[8]; unsigned int index, padLen; @@ -223,9 +217,7 @@ MD5_CTX *context; /* context */ /* MD5 basic transformation. Transforms state based on block. */ -static void MD5Transform(state, block) -UINT4 state[4]; -unsigned char block[64]; +static void MD5Transform(UINT4 state[4], unsigned char block[64]) { UINT4 a = state[0], b = state[1], c = state[2], d = state[3], x[16]; @@ -316,10 +308,7 @@ unsigned char block[64]; /* Encodes input (UINT4) into output (unsigned char). Assumes len is a multiple of 4. */ -static void Encode(output, input, len) -unsigned char *output; -UINT4 *input; -unsigned int len; +static void Encode(unsigned char *output, UINT4 *input, unsigned int len) { unsigned int i, j; @@ -334,10 +323,7 @@ unsigned int len; /* Decodes input (unsigned char) into output (UINT4). Assumes len is a multiple of 4. */ -static void Decode(output, input, len) -UINT4 *output; -unsigned char *input; -unsigned int len; +static void Decode(UINT4 *output, unsigned char *input, unsigned int len) { unsigned int i, j; @@ -374,14 +360,14 @@ int old_encrypt(const char *src, int len, char *dest, int size) memset(&digest, 0, sizeof(digest)); MD5Init(&context); - MD5Update(&context, src, len); - MD5Final(digest, &context); + MD5Update(&context, (unsigned char *)src, len); + MD5Final((unsigned char *)digest, &context); for (i = 0; i < 32; i += 2) dest[i / 2] = XTOI(digest[i]) << 4 | XTOI(digest[i + 1]); if(debug) { memset(tmp,0,33); - binary_to_hex(dest,tmp,16); + binary_to_hex((unsigned char *)dest,tmp,16); alog("enc_old: Converted [%s] to [%s]",src,tmp); } |