diff options
Diffstat (limited to 'block-sha1/sha1.c')
-rw-r--r-- | block-sha1/sha1.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/block-sha1/sha1.c b/block-sha1/sha1.c index d8934757a5..c0054a0b0a 100644 --- a/block-sha1/sha1.c +++ b/block-sha1/sha1.c @@ -70,6 +70,7 @@ */ #if defined(__i386__) || defined(__x86_64__) || \ + defined(_M_IX86) || defined(_M_X64) || \ defined(__ppc__) || defined(__ppc64__) || \ defined(__powerpc__) || defined(__powerpc64__) || \ defined(__s390__) || defined(__s390x__) @@ -236,13 +237,13 @@ void blk_SHA1_Init(blk_SHA_CTX *ctx) void blk_SHA1_Update(blk_SHA_CTX *ctx, const void *data, unsigned long len) { - int lenW = ctx->size & 63; + unsigned int lenW = ctx->size & 63; ctx->size += len; /* Read the data into W and process blocks as they get full */ if (lenW) { - int left = 64 - lenW; + unsigned int left = 64 - lenW; if (len < left) left = len; memcpy(lenW + (char *)ctx->W, data, left); @@ -269,8 +270,8 @@ void blk_SHA1_Final(unsigned char hashout[20], blk_SHA_CTX *ctx) int i; /* Pad with a binary 1 (ie 0x80), then zeroes, then length */ - padlen[0] = htonl(ctx->size >> 29); - padlen[1] = htonl(ctx->size << 3); + padlen[0] = htonl((uint32_t)(ctx->size >> 29)); + padlen[1] = htonl((uint32_t)(ctx->size << 3)); i = ctx->size & 63; blk_SHA1_Update(ctx, pad, 1+ (63 & (55 - i))); |