X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=libiberty%2Fsha1.c;h=af08219b1b049cabdf20a0c8ab57994939dd9da0;hb=708a2ffff5cc2d280968a6b28268d8276d391bb4;hp=6a25ab239925aa21ebbbd29708b00120b4b77849;hpb=b68965a0fa54df03570c8183740677d68f87ff07;p=deliverable%2Fbinutils-gdb.git diff --git a/libiberty/sha1.c b/libiberty/sha1.c index 6a25ab2399..af08219b1b 100644 --- a/libiberty/sha1.c +++ b/libiberty/sha1.c @@ -1,8 +1,7 @@ /* sha1.c - Functions to compute SHA1 message digest of files or memory blocks according to the NIST specification FIPS-180-1. - Copyright (C) 2000, 2001, 2003, 2004, 2005, 2006, 2008 Free Software - Foundation, Inc. + Copyright (C) 2000-2020 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the @@ -300,8 +299,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))))