summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/sha/sha512.c
diff options
context:
space:
mode:
authormiod <>2014-04-17 21:07:06 +0000
committermiod <>2014-04-17 21:07:06 +0000
commit1c6d8e10c55680bf1b3261a5be4aa6974c5623e7 (patch)
tree0a9a0f517dbd50b32040bad730556cb5be06768b /src/lib/libcrypto/sha/sha512.c
parentf7422b60fbfd0a5881e0d15bfedc4ad749763bf4 (diff)
downloadopenbsd-1c6d8e10c55680bf1b3261a5be4aa6974c5623e7.tar.gz
openbsd-1c6d8e10c55680bf1b3261a5be4aa6974c5623e7.tar.bz2
openbsd-1c6d8e10c55680bf1b3261a5be4aa6974c5623e7.zip
Remove support for big-endian i386 and amd64.
Before someone suggests the OpenSSL people are junkies, here is what they mention about this: /* Most will argue that x86_64 is always little-endian. Well, * yes, but then we have stratus.com who has modified gcc to * "emulate" big-endian on x86. Is there evidence that they * [or somebody else] won't do same for x86_64? Naturally no. * And this line is waiting ready for that brave soul:-) */ So, yes, they are on drugs. But they are not alone, the stratus.com people are, too.
Diffstat (limited to 'src/lib/libcrypto/sha/sha512.c')
-rw-r--r--src/lib/libcrypto/sha/sha512.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/src/lib/libcrypto/sha/sha512.c b/src/lib/libcrypto/sha/sha512.c
index 50c229ddeb..32bfecbf9b 100644
--- a/src/lib/libcrypto/sha/sha512.c
+++ b/src/lib/libcrypto/sha/sha512.c
@@ -318,13 +318,11 @@ static const SHA_LONG64 K512[80] = {
318 : "=r"(ret) \ 318 : "=r"(ret) \
319 : "J"(n),"0"(a) \ 319 : "J"(n),"0"(a) \
320 : "cc"); ret; }) 320 : "cc"); ret; })
321# if !defined(B_ENDIAN)
322# define PULL64(x) ({ SHA_LONG64 ret=*((const SHA_LONG64 *)(&(x))); \ 321# define PULL64(x) ({ SHA_LONG64 ret=*((const SHA_LONG64 *)(&(x))); \
323 asm ("bswapq %0" \ 322 asm ("bswapq %0" \
324 : "=r"(ret) \ 323 : "=r"(ret) \
325 : "0"(ret)); ret; }) 324 : "0"(ret)); ret; })
326# endif 325# elif (defined(__i386) || defined(__i386__))
327# elif (defined(__i386) || defined(__i386__)) && !defined(B_ENDIAN)
328# if defined(I386_ONLY) 326# if defined(I386_ONLY)
329# define PULL64(x) ({ const unsigned int *p=(const unsigned int *)(&(x));\ 327# define PULL64(x) ({ const unsigned int *p=(const unsigned int *)(&(x));\
330 unsigned int hi=p[0],lo=p[1]; \ 328 unsigned int hi=p[0],lo=p[1]; \
@@ -421,11 +419,7 @@ static void sha512_block_data_order (SHA512_CTX *ctx, const void *in, size_t num
421 419
422 for (i=0;i<16;i++,F--) 420 for (i=0;i<16;i++,F--)
423 { 421 {
424#ifdef B_ENDIAN
425 T = W[i];
426#else
427 T = PULL64(W[i]); 422 T = PULL64(W[i]);
428#endif
429 F[0] = A; 423 F[0] = A;
430 F[4] = E; 424 F[4] = E;
431 F[8] = T; 425 F[8] = T;