HCoop
/
bpt
/
emacs.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
merge trunk
[bpt/emacs.git]
/
lib
/
md5.c
diff --git
a/lib/md5.c
b/lib/md5.c
index
b7fad63
..
30b7e50
100644
(file)
--- a/
lib/md5.c
+++ b/
lib/md5.c
@@
-1,6
+1,6
@@
/* Functions to compute MD5 message digest of files or memory blocks.
according to the definition of MD5 in RFC 1321 from April 1992.
/* Functions to compute MD5 message digest of files or memory blocks.
according to the definition of MD5 in RFC 1321 from April 1992.
- Copyright (C) 1995-1997, 1999-2001, 2005-2006, 2008-201
1
Free Software
+ Copyright (C) 1995-1997, 1999-2001, 2005-2006, 2008-201
2
Free Software
Foundation, Inc.
This file is part of the GNU C Library.
Foundation, Inc.
This file is part of the GNU C Library.
@@
-15,8
+15,7
@@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software Foundation,
- Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
+ along with this program; if not, see <http://www.gnu.org/licenses/>. */
/* Written by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995. */
/* Written by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995. */
@@
-24,7
+23,8
@@
#include "md5.h"
#include "md5.h"
-#include <stddef.h>
+#include <stdalign.h>
+#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
@@
-254,8
+254,7
@@
md5_process_bytes (const void *buffer, size_t len, struct md5_ctx *ctx)
if (len >= 64)
{
#if !_STRING_ARCH_unaligned
if (len >= 64)
{
#if !_STRING_ARCH_unaligned
-# define alignof(type) offsetof (struct { char c; type x; }, x)
-# define UNALIGNED_P(p) (((size_t) p) % alignof (uint32_t) != 0)
+# define UNALIGNED_P(p) ((uintptr_t) (p) % alignof (uint32_t) != 0)
if (UNALIGNED_P (buffer))
while (len > 64)
{
if (UNALIGNED_P (buffer))
while (len > 64)
{
@@
-313,13
+312,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 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. */
/* 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. */
/* Process all bytes in the buffer with 64 bytes in each round of
the loop. */