From 0ed89f31f4d9ca76be820399b0e32ae9e8f2924f Mon Sep 17 00:00:00 2001 From: Richard Aas Date: Tue, 6 Dec 2011 11:43:01 +0000 Subject: [PATCH] sha1:fix build warnings --- src/sha/sha1.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/sha/sha1.c b/src/sha/sha1.c index a86d7a3..53556f8 100644 --- a/src/sha/sha1.c +++ b/src/sha/sha1.c @@ -1,6 +1,8 @@ /** * @file sha1.c SHA-1 in C + */ +/* By Steve Reid 100% Public Domain @@ -213,8 +215,9 @@ void SHA1_Update(SHA1_CTX* context, const uint8_t* data, const size_t len) size_t i, j; j = (context->count[0] >> 3) & 63; - if ((context->count[0] += len << 3) < (len << 3)) context->count[1]++; - context->count[1] += (len >> 29); + if ((context->count[0] += (uint32_t)(len << 3)) < (len << 3)) + context->count[1]++; + context->count[1] += (uint32_t)(len >> 29); if ((j + len) > 63) { memcpy(&context->buffer[j], data, (i = 64-j)); SHA1_Transform(context->state, context->buffer);