diff options
| -rw-r--r-- | ext/digest/sha1/sha1.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/ext/digest/sha1/sha1.c b/ext/digest/sha1/sha1.c index ce200270b7..003c87d224 100644 --- a/ext/digest/sha1/sha1.c +++ b/ext/digest/sha1/sha1.c @@ -220,14 +220,16 @@ int SHA1_Init(SHA1_CTX *context) */ void SHA1_Update(SHA1_CTX *context, const uint8_t *data, size_t len) { - uint32_t i, j; + size_t i; + uint32_t j; _DIAGASSERT(context != 0); _DIAGASSERT(data != 0); j = context->count[0]; if ((context->count[0] += len << 3) < j) - context->count[1] += (len>>29)+1; + context->count[1]++; + context->count[1] += (uint32_t)(len >> 29); j = (j >> 3) & 63; if ((j + len) > 63) { (void)memcpy(&context->buffer[j], data, (i = 64-j)); |
