aboutsummaryrefslogtreecommitdiffstats
path: root/lib/md5.c
diff options
context:
space:
mode:
authorWilmer van der Gaast <wilmer@gaast.net>2008-01-17 22:06:55 +0000
committerWilmer van der Gaast <wilmer@gaast.net>2008-01-17 22:06:55 +0000
commit52744f8f65a278a59a8903d5c594e057d63c7006 (patch)
tree9cd0ff1f2b49146b3d42c70c272ff88d215436b8 /lib/md5.c
parent13857c648210a16448619c65e33f9918bfe27cbe (diff)
Fixing some Solaris compiler warnings (u_int->uint, adding some typecasts
for pid_t variables).
Diffstat (limited to 'lib/md5.c')
-rw-r--r--lib/md5.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/lib/md5.c b/lib/md5.c
index 08c298a2..f1779794 100644
--- a/lib/md5.c
+++ b/lib/md5.c
@@ -25,7 +25,7 @@
#include <string.h> /* for memcpy() */
#include "md5.h"
-static void md5_transform(u_int32_t buf[4], u_int32_t const in[16]);
+static void md5_transform(uint32_t buf[4], uint32_t const in[16]);
/*
* Wrapper function for all-in-one MD5
@@ -52,12 +52,12 @@ void md5_init(struct MD5Context *ctx)
void md5_append(struct MD5Context *ctx, const md5_byte_t *buf,
unsigned int len)
{
- u_int32_t t;
+ uint32_t t;
/* Update bitcount */
t = ctx->bits[0];
- if ((ctx->bits[0] = t + ((u_int32_t) len << 3)) < t)
+ if ((ctx->bits[0] = t + ((uint32_t) len << 3)) < t)
ctx->bits[1]++; /* Carry from low to high */
ctx->bits[1] += len >> 29;
@@ -74,7 +74,7 @@ void md5_append(struct MD5Context *ctx, const md5_byte_t *buf,
return;
}
memcpy(p, buf, t);
- md5_transform(ctx->buf, (u_int32_t *) ctx->in);
+ md5_transform(ctx->buf, (uint32_t *) ctx->in);
buf += t;
len -= t;
}
@@ -82,7 +82,7 @@ void md5_append(struct MD5Context *ctx, const md5_byte_t *buf,
while (len >= 64) {
memcpy(ctx->in, buf, 64);
- md5_transform(ctx->buf, (u_int32_t *) ctx->in);
+ md5_transform(ctx->buf, (uint32_t *) ctx->in);
buf += 64;
len -= 64;
}
@@ -116,7 +116,7 @@ void md5_finish(struct MD5Context *ctx, md5_byte_t digest[16])
if (count < 8) {
/* Two lots of padding: Pad the first block to 64 bytes */
memset(p, 0, count);
- md5_transform(ctx->buf, (u_int32_t *) ctx->in);
+ md5_transform(ctx->buf, (uint32_t *) ctx->in);
/* Now fill the next block with 56 bytes */
memset(ctx->in, 0, 56);
@@ -126,10 +126,10 @@ void md5_finish(struct MD5Context *ctx, md5_byte_t digest[16])
}
/* Append length in bits and transform */
- ((u_int32_t *) ctx->in)[14] = ctx->bits[0];
- ((u_int32_t *) ctx->in)[15] = ctx->bits[1];
+ ((uint32_t *) ctx->in)[14] = ctx->bits[0];
+ ((uint32_t *) ctx->in)[15] = ctx->bits[1];
- md5_transform(ctx->buf, (u_int32_t *) ctx->in);
+ md5_transform(ctx->buf, (uint32_t *) ctx->in);
memcpy(digest, ctx->buf, 16);
memset(ctx, 0, sizeof(ctx)); /* In case it's sensitive */
}
@@ -151,9 +151,9 @@ void md5_finish(struct MD5Context *ctx, md5_byte_t digest[16])
* reflect the addition of 16 longwords of new data. MD5Update blocks
* the data and converts bytes into longwords for this routine.
*/
-static void md5_transform(u_int32_t buf[4], u_int32_t const in[16])
+static void md5_transform(uint32_t buf[4], uint32_t const in[16])
{
- register u_int32_t a, b, c, d;
+ register uint32_t a, b, c, d;
a = buf[0];
b = buf[1];