Mercurial > hg > CbC > CbC_gcc
comparison libiberty/sha1.c @ 111:04ced10e8804
gcc 7
author | kono |
---|---|
date | Fri, 27 Oct 2017 22:46:09 +0900 |
parents | a06113de4d67 |
children | 84e7813d76e9 |
comparison
equal
deleted
inserted
replaced
68:561a7518be6b | 111:04ced10e8804 |
---|---|
1 /* sha1.c - Functions to compute SHA1 message digest of files or | 1 /* sha1.c - Functions to compute SHA1 message digest of files or |
2 memory blocks according to the NIST specification FIPS-180-1. | 2 memory blocks according to the NIST specification FIPS-180-1. |
3 | 3 |
4 Copyright (C) 2000, 2001, 2003, 2004, 2005, 2006, 2008 Free Software | 4 Copyright (C) 2000-2017 Free Software Foundation, Inc. |
5 Foundation, Inc. | |
6 | 5 |
7 This program is free software; you can redistribute it and/or modify it | 6 This program is free software; you can redistribute it and/or modify it |
8 under the terms of the GNU General Public License as published by the | 7 under the terms of the GNU General Public License as published by the |
9 Free Software Foundation; either version 2, or (at your option) any | 8 Free Software Foundation; either version 2, or (at your option) any |
10 later version. | 9 later version. |
298 | 297 |
299 /* First increment the byte count. RFC 1321 specifies the possible | 298 /* First increment the byte count. RFC 1321 specifies the possible |
300 length of the file up to 2^64 bits. Here we only compute the | 299 length of the file up to 2^64 bits. Here we only compute the |
301 number of bytes. Do a double word increment. */ | 300 number of bytes. Do a double word increment. */ |
302 ctx->total[0] += len; | 301 ctx->total[0] += len; |
303 if (ctx->total[0] < len) | 302 ctx->total[1] += ((len >> 31) >> 1) + (ctx->total[0] < len); |
304 ++ctx->total[1]; | |
305 | 303 |
306 #define rol(x, n) (((x) << (n)) | ((sha1_uint32) (x) >> (32 - (n)))) | 304 #define rol(x, n) (((x) << (n)) | ((sha1_uint32) (x) >> (32 - (n)))) |
307 | 305 |
308 #define M(I) ( tm = x[I&0x0f] ^ x[(I-14)&0x0f] \ | 306 #define M(I) ( tm = x[I&0x0f] ^ x[(I-14)&0x0f] \ |
309 ^ x[(I-8)&0x0f] ^ x[(I-3)&0x0f] \ | 307 ^ x[(I-8)&0x0f] ^ x[(I-3)&0x0f] \ |