*/
#include "silcincludes.h"
+#include "md5_internal.h"
#include "md5.h"
/*
#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);
}
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;
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);
* 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);