diff options
Diffstat (limited to 'crypt/sha512.h')
-rw-r--r-- | crypt/sha512.h | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/crypt/sha512.h b/crypt/sha512.h index 9952c5f..90e55dc 100644 --- a/crypt/sha512.h +++ b/crypt/sha512.h @@ -1,6 +1,6 @@ /* Declaration of functions and data types used for SHA512 sum computing library functions. - Copyright (C) 2007 Free Software Foundation, Inc. + Copyright (C) 2007, 2011 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -24,6 +24,9 @@ #include <limits.h> #include <stdint.h> #include <stdio.h> +#ifdef _LIBC +# include <bits/wordsize.h> +#endif /* Structure to save state of computation between the single steps. */ @@ -31,7 +34,14 @@ struct sha512_ctx { uint64_t H[8]; - uint64_t total[2]; + union + { +#if defined __GNUC__ && __WORDSIZE == 64 +# define USE_TOTAL128 + unsigned int total128 __attribute__ ((__mode__ (TI))); +#endif + uint64_t total[2]; + }; uint64_t buflen; char buffer[256] __attribute__ ((__aligned__ (__alignof__ (uint64_t)))); }; |