projects
/
gnulib.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
log10-ieee: Work around test failure on NetBSD 5.1 and Solaris 11.
[gnulib.git]
/
lib
/
sha512.c
diff --git
a/lib/sha512.c
b/lib/sha512.c
index
3fb4559
..
0c0779c
100644
(file)
--- a/
lib/sha512.c
+++ b/
lib/sha512.c
@@
-1,7
+1,7
@@
/* sha512.c - Functions to compute SHA512 and SHA384 message digest of files or
memory blocks according to the NIST specification FIPS-180-2.
/* sha512.c - Functions to compute SHA512 and SHA384 message digest of files or
memory blocks according to the NIST specification FIPS-180-2.
- Copyright (C) 2005
, 2006, 2008, 2009
Free Software Foundation, Inc.
+ Copyright (C) 2005
-2006, 2008-2012
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
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
@@
-24,7
+24,8
@@
#include "sha512.h"
#include "sha512.h"
-#include <stddef.h>
+#include <stdalign.h>
+#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <stdlib.h>
#include <string.h>
@@
-58,7
+59,7
@@
static const unsigned char fillbuf[128] = { 0x80, 0 /* , 0, 0, ... */ };
/*
Takes a pointer to a 512 bit block of data (eight 64 bit ints) and
/*
Takes a pointer to a 512 bit block of data (eight 64 bit ints) and
- intializes it to the start constants of the SHA512 algorithm. This
+ in
i
tializes it to the start constants of the SHA512 algorithm. This
must be called before using hash in the call to sha512_hash
*/
void
must be called before using hash in the call to sha512_hash
*/
void
@@
-381,8
+382,7
@@
sha512_process_bytes (const void *buffer, size_t len, struct sha512_ctx *ctx)
if (len >= 128)
{
#if !_STRING_ARCH_unaligned
if (len >= 128)
{
#if !_STRING_ARCH_unaligned
-# define alignof(type) offsetof (struct { char c; type x; }, x)
-# define UNALIGNED_P(p) (((size_t) p) % alignof (u64) != 0)
+# define UNALIGNED_P(p) ((uintptr_t) (p) % alignof (u64) != 0)
if (UNALIGNED_P (buffer))
while (len > 128)
{
if (UNALIGNED_P (buffer))
while (len > 128)
{