summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/whrlpool/wp_block.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/lib/libcrypto/whrlpool/wp_block.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/lib/libcrypto/whrlpool/wp_block.c b/src/lib/libcrypto/whrlpool/wp_block.c
index fadad01401..11164e50f5 100644
--- a/src/lib/libcrypto/whrlpool/wp_block.c
+++ b/src/lib/libcrypto/whrlpool/wp_block.c
@@ -37,6 +37,7 @@
37 37
38#include "wp_locl.h" 38#include "wp_locl.h"
39#include <string.h> 39#include <string.h>
40#include <machine/endian.h>
40 41
41typedef unsigned char u8; 42typedef unsigned char u8;
42#if (defined(_WIN32) || defined(_WIN64)) && !defined(__MINGW32) 43#if (defined(_WIN32) || defined(_WIN64)) && !defined(__MINGW32)
@@ -82,10 +83,10 @@ typedef unsigned long long u64;
82# define ROTATE(a,n) ({ u64 ret; asm ("rolq %1,%0" \ 83# define ROTATE(a,n) ({ u64 ret; asm ("rolq %1,%0" \
83 : "=r"(ret) : "J"(n),"0"(a) : "cc"); ret; }) 84 : "=r"(ret) : "J"(n),"0"(a) : "cc"); ret; })
84# elif defined(__ia64) || defined(__ia64__) 85# elif defined(__ia64) || defined(__ia64__)
85# if defined(L_ENDIAN) 86# if _BYTE_ORDER == _LITTLE_ENDIAN
86# define ROTATE(a,n) ({ u64 ret; asm ("shrp %0=%1,%1,%2" \ 87# define ROTATE(a,n) ({ u64 ret; asm ("shrp %0=%1,%1,%2" \
87 : "=r"(ret) : "r"(a),"M"(64-(n))); ret; }) 88 : "=r"(ret) : "r"(a),"M"(64-(n))); ret; })
88# elif defined(B_ENDIAN) 89# else
89# define ROTATE(a,n) ({ u64 ret; asm ("shrp %0=%1,%1,%2" \ 90# define ROTATE(a,n) ({ u64 ret; asm ("shrp %0=%1,%1,%2" \
90 : "=r"(ret) : "r"(a),"M"(n)); ret; }) 91 : "=r"(ret) : "r"(a),"M"(n)); ret; })
91# endif 92# endif
@@ -94,9 +95,9 @@ typedef unsigned long long u64;
94 95
95#if defined(OPENSSL_SMALL_FOOTPRINT) 96#if defined(OPENSSL_SMALL_FOOTPRINT)
96# if !defined(ROTATE) 97# if !defined(ROTATE)
97# if defined(L_ENDIAN) /* little-endians have to rotate left */ 98# if _BYTE_ORDER == _LITTLE_ENDIAN /* little-endians have to rotate left */
98# define ROTATE(i,n) ((i)<<(n) ^ (i)>>(64-n)) 99# define ROTATE(i,n) ((i)<<(n) ^ (i)>>(64-n))
99# elif defined(B_ENDIAN) /* big-endians have to rotate right */ 100# else /* big-endians have to rotate right */
100# define ROTATE(i,n) ((i)>>(n) ^ (i)<<(64-n)) 101# define ROTATE(i,n) ((i)>>(n) ^ (i)<<(64-n))
101# endif 102# endif
102# endif 103# endif