diff options
Diffstat (limited to 'libextra/gl/md5.c')
-rw-r--r-- | libextra/gl/md5.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/libextra/gl/md5.c b/libextra/gl/md5.c index 0747e9b5ea..65c1183938 100644 --- a/libextra/gl/md5.c +++ b/libextra/gl/md5.c @@ -315,13 +315,13 @@ md5_process_block (const void *buffer, size_t len, struct md5_ctx *ctx) uint32_t B = ctx->B; uint32_t C = ctx->C; uint32_t D = ctx->D; + uint32_t lolen = len; /* First increment the byte count. RFC 1321 specifies the possible length of the file up to 2^64 bits. Here we only compute the number of bytes. Do a double word increment. */ - ctx->total[0] += len; - if (ctx->total[0] < len) - ++ctx->total[1]; + ctx->total[0] += lolen; + ctx->total[1] += (len >> 31 >> 1) + (ctx->total[0] < lolen); /* Process all bytes in the buffer with 64 bytes in each round of the loop. */ |