summaryrefslogtreecommitdiffstats
path: root/libcrypt/md5.c
diff options
context:
space:
mode:
author"Steven J. Hill" <sjhill@realitydiluted.com>2006-02-25 04:03:33 +0000
committer"Steven J. Hill" <sjhill@realitydiluted.com>2006-02-25 04:03:33 +0000
commitcb6a88484ce0b5ffba2fe98a40e2d51f4af92eb8 (patch)
tree520f8e8d113184cfa7954ebd274564b8c255fa9a /libcrypt/md5.c
parente4461be66e2655058aef358b00050bc70ac72861 (diff)
downloaduClibc-alpine-cb6a88484ce0b5ffba2fe98a40e2d51f4af92eb8.tar.bz2
uClibc-alpine-cb6a88484ce0b5ffba2fe98a40e2d51f4af92eb8.tar.xz
Merge from trunk. Going pretty good so far. Kind of. Okay, not really.
Diffstat (limited to 'libcrypt/md5.c')
-rw-r--r--libcrypt/md5.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/libcrypt/md5.c b/libcrypt/md5.c
index 7d852b7b2..989d4482c 100644
--- a/libcrypt/md5.c
+++ b/libcrypt/md5.c
@@ -195,10 +195,10 @@ static void __md5_Init (struct MD5Context *context)
static void __md5_Update ( struct MD5Context *context, const unsigned char *input, unsigned int inputLen)
{
- unsigned int i, index, partLen;
+ unsigned int i, idx, partLen;
/* Compute number of bytes mod 64 */
- index = (unsigned int)((context->count[0] >> 3) & 0x3F);
+ idx = (unsigned int)((context->count[0] >> 3) & 0x3F);
/* Update number of bits */
if ((context->count[0] += ((u_int32_t)inputLen << 3))
@@ -206,24 +206,24 @@ static void __md5_Update ( struct MD5Context *context, const unsigned char *inpu
context->count[1]++;
context->count[1] += ((u_int32_t)inputLen >> 29);
- partLen = 64 - index;
+ partLen = 64 - idx;
/* Transform as many times as possible. */
if (inputLen >= partLen) {
- memcpy((void *)&context->buffer[index], (const void *)input,
+ memcpy((void *)&context->buffer[idx], (const void *)input,
partLen);
__md5_Transform (context->state, context->buffer);
for (i = partLen; i + 63 < inputLen; i += 64)
__md5_Transform (context->state, &input[i]);
- index = 0;
+ idx = 0;
}
else
i = 0;
/* Buffer remaining input */
- memcpy ((void *)&context->buffer[index], (const void *)&input[i],
+ memcpy ((void *)&context->buffer[idx], (const void *)&input[i],
inputLen-i);
}
@@ -234,7 +234,7 @@ static void __md5_Update ( struct MD5Context *context, const unsigned char *inpu
static void __md5_Pad ( struct MD5Context *context)
{
unsigned char bits[8];
- unsigned int index, padLen;
+ unsigned int idx, padLen;
unsigned char PADDING[64];
memset(PADDING, 0, sizeof(PADDING));
@@ -244,8 +244,8 @@ static void __md5_Pad ( struct MD5Context *context)
__md5_Encode (bits, context->count, 8);
/* Pad out to 56 mod 64. */
- index = (unsigned int)((context->count[0] >> 3) & 0x3f);
- padLen = (index < 56) ? (56 - index) : (120 - index);
+ idx = (unsigned int)((context->count[0] >> 3) & 0x3f);
+ padLen = (idx < 56) ? (56 - idx) : (120 - idx);
__md5_Update (context, PADDING, padLen);
/* Append length (before padding) */
@@ -531,7 +531,8 @@ static void __md5_to64( char *s, unsigned long v, int n)
* Use MD5 for what it is best at...
*/
-extern char attribute_hidden * __md5_crypt( const char *pw, const char *salt)
+char * __md5_crypt( const char *pw, const char *salt) attribute_hidden;
+char * __md5_crypt( const char *pw, const char *salt)
{
/* Static stuff */
static const char *sp, *ep;