X-Git-Url: http://git.silcnet.org/gitweb/?p=silc.git;a=blobdiff_plain;f=lib%2Fsilccrypt%2Fmd5.c;h=910939be1b091cc6f72fb28e1ee720007e0c8aa5;hp=63514cd10f3c9684640d30e826aa1d47bd245d70;hb=a818c5b5411bbc4436d1c5f011236985c96bb787;hpb=7910ce2a5c55211a4ea09a52832c6ed32c0b64fd diff --git a/lib/silccrypt/md5.c b/lib/silccrypt/md5.c index 63514cd1..910939be 100644 --- a/lib/silccrypt/md5.c +++ b/lib/silccrypt/md5.c @@ -54,19 +54,19 @@ SILC_HASH_API_CONTEXT_LEN(md5) #ifndef HIGHFIRST #define byteReverse(buf, len) /* Nothing */ #else -void byteReverse(unsigned char *buf, uint32s); +void byteReverse(unsigned char *buf, SilcUInt32s); #ifndef ASM_MD5 /* * Note: this code is harmless on little-endian machines. */ -void byteReverse(unsigned char *buf, uint32s) +void byteReverse(unsigned char *buf, SilcUInt32s) { - uint32 t; + SilcUInt32 t; do { - t = (uint32)((unsigned)buf[3]<<8 | buf[2]) << 16 | + t = (SilcUInt32)((unsigned)buf[3]<<8 | buf[2]) << 16 | ((unsigned)buf[1]<<8 | buf[0]); - *(uint32 *)buf = t; + *(SilcUInt32 *)buf = t; buf += 4; } while (--longs); } @@ -96,12 +96,12 @@ MD5Init(struct MD5Context *ctx) void MD5Update(struct MD5Context *ctx, unsigned char const *buf, unsigned len) { - uint32 t; + SilcUInt32 t; /* Update bitcount */ t = ctx->bits[0]; - if ((ctx->bits[0] = t + ((uint32)len << 3)) < t) + if ((ctx->bits[0] = t + ((SilcUInt32)len << 3)) < t) ctx->bits[1]++; /* Carry from low to high */ ctx->bits[1] += len >> 29; @@ -176,8 +176,8 @@ MD5Final(unsigned char digest[16], struct MD5Context *ctx) byteReverse(ctx->in, 14); /* Append length in bits and transform */ - ((uint32 *)ctx->in)[ 14 ] = ctx->bits[0]; - ((uint32 *)ctx->in)[ 15 ] = ctx->bits[1]; + ((SilcUInt32 *)ctx->in)[ 14 ] = ctx->bits[0]; + ((SilcUInt32 *)ctx->in)[ 15 ] = ctx->bits[1]; MD5Transform(ctx->buf, ctx->in); byteReverse((unsigned char *)ctx->buf, 4); @@ -205,10 +205,10 @@ MD5Final(unsigned char digest[16], struct MD5Context *ctx) * the data and converts bytes into longwords for this routine. */ void -MD5Transform(uint32 buf[4], const unsigned char kbuf[64]) +MD5Transform(SilcUInt32 buf[4], const unsigned char kbuf[64]) { - register uint32 a, b, c, d, i; - uint32 in[16]; + register SilcUInt32 a, b, c, d, i; + SilcUInt32 in[16]; for (i = 0; i < 16; i++) SILC_GET32_MSB(in[i], kbuf + 4 * i);