diff options
author | joseph <joseph@7b3dc134-2b1b-0410-93df-9e9f96275f8d> | 2011-07-22 13:43:39 +0000 |
---|---|---|
committer | joseph <joseph@7b3dc134-2b1b-0410-93df-9e9f96275f8d> | 2011-07-22 13:43:39 +0000 |
commit | c837cf0bbdd09079d64188bf0028bb21df2faec7 (patch) | |
tree | d3ead9b4b8d60f25f78b12417b2ba02f14971704 /libc/crypt/sha512.h | |
parent | a63bdad03a9963d53373008e78fc29ee48f161af (diff) | |
download | eglibc2-c837cf0bbdd09079d64188bf0028bb21df2faec7.tar.gz |
Merge changes between 14282 and r14661 from /fsf/trunk.
git-svn-id: svn://svn.eglibc.org/trunk@14662 7b3dc134-2b1b-0410-93df-9e9f96275f8d
Diffstat (limited to 'libc/crypt/sha512.h')
-rw-r--r-- | libc/crypt/sha512.h | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/libc/crypt/sha512.h b/libc/crypt/sha512.h index 9952c5f86..28d63fcfd 100644 --- a/libc/crypt/sha512.h +++ b/libc/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,8 @@ #include <limits.h> #include <stdint.h> #include <stdio.h> +#include <endian.h> +#include <bits/wordsize.h> /* Structure to save state of computation between the single steps. */ @@ -31,9 +33,22 @@ 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 +#define TOTAL128_low (1 - (BYTE_ORDER == LITTLE_ENDIAN)) +#define TOTAL128_high (BYTE_ORDER == LITTLE_ENDIAN) + uint64_t total[2]; + }; uint64_t buflen; - char buffer[256] __attribute__ ((__aligned__ (__alignof__ (uint64_t)))); + union + { + char buffer[256]; + uint64_t buffer64[32]; + }; }; /* Initialize structure containing state of computation. |