aboutsummaryrefslogtreecommitdiff
path: root/crypt/sha512.h
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@gmail.com>2011-07-02 13:03:53 -0400
committerUlrich Drepper <drepper@gmail.com>2011-07-02 13:03:53 -0400
commitfeea4948bca7e442edad3f995696f33450549e80 (patch)
treef0d06f3188f1179aa50dd5281234ed4167422db4 /crypt/sha512.h
parentfcfc776bc6242fdefde0efd7b0c315fbeca08555 (diff)
downloadglibc-feea4948bca7e442edad3f995696f33450549e80.zip
glibc-feea4948bca7e442edad3f995696f33450549e80.tar.gz
glibc-feea4948bca7e442edad3f995696f33450549e80.tar.bz2
Fix last patch for big-endian machines
Diffstat (limited to 'crypt/sha512.h')
-rw-r--r--crypt/sha512.h12
1 files changed, 9 insertions, 3 deletions
diff --git a/crypt/sha512.h b/crypt/sha512.h
index 90e55dc..d98a2fc 100644
--- a/crypt/sha512.h
+++ b/crypt/sha512.h
@@ -24,9 +24,8 @@
#include <limits.h>
#include <stdint.h>
#include <stdio.h>
-#ifdef _LIBC
-# include <bits/wordsize.h>
-#endif
+#include <endian.h>
+#include <bits/wordsize.h>
/* Structure to save state of computation between the single steps. */
@@ -40,6 +39,13 @@ struct sha512_ctx
# define USE_TOTAL128
unsigned int total128 __attribute__ ((__mode__ (TI)));
#endif
+#if BYTE_ORDER == LITTLE_ENDIAN
+# define TOTAL128_low 0
+# define TOTAL128_high 1
+#else
+# define TOTAL128_low 1
+# define TOTAL128_high 0
+#endif
uint64_t total[2];
};
uint64_t buflen;