Commit 1d77deec by Kai Tietz

re PR other/54620 (sha1.c has incorrect math if sizeof(size_t) is 8)

	PR other/54620
	* sha1.c (sha1_process_block):  Handle case that size_t is
	a wider-integer-scalar as a 32-bit unsigned integer.

From-SVN: r195604
parent 4cfc6e54
......@@ -300,8 +300,7 @@ sha1_process_block (const void *buffer, size_t len, struct sha1_ctx *ctx)
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[1] += ((len >> 31) >> 1) + (ctx->total[0] < len);
#define rol(x, n) (((x) << (n)) | ((sha1_uint32) (x) >> (32 - (n))))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment