diff options
Diffstat (limited to 'umac.c')
-rw-r--r-- | umac.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -136,12 +136,14 @@ static UINT32 LOAD_UINT32_REVERSED(void *ptr) | |||
136 | return (UINT32)temp; | 136 | return (UINT32)temp; |
137 | } | 137 | } |
138 | 138 | ||
139 | # if (__LITTLE_ENDIAN__) | ||
139 | static void STORE_UINT32_REVERSED(void *ptr, UINT32 x) | 140 | static void STORE_UINT32_REVERSED(void *ptr, UINT32 x) |
140 | { | 141 | { |
141 | UINT32 i = (UINT32)x; | 142 | UINT32 i = (UINT32)x; |
142 | *(UINT32 *)ptr = (i >> 24) | ((i & 0x00FF0000) >> 8 ) | 143 | *(UINT32 *)ptr = (i >> 24) | ((i & 0x00FF0000) >> 8 ) |
143 | | ((i & 0x0000FF00) << 8 ) | (i << 24); | 144 | | ((i & 0x0000FF00) << 8 ) | (i << 24); |
144 | } | 145 | } |
146 | # endif /* __LITTLE_ENDIAN */ | ||
145 | #endif /* HAVE_SWAP32 */ | 147 | #endif /* HAVE_SWAP32 */ |
146 | 148 | ||
147 | /* The following definitions use the above reversal-primitives to do the right | 149 | /* The following definitions use the above reversal-primitives to do the right |
@@ -544,6 +546,7 @@ static void nh_transform(nh_ctx *hc, UINT8 *buf, UINT32 nbytes) | |||
544 | 546 | ||
545 | /* ---------------------------------------------------------------------- */ | 547 | /* ---------------------------------------------------------------------- */ |
546 | 548 | ||
549 | #if (__LITTLE_ENDIAN__) | ||
547 | static void endian_convert(void *buf, UWORD bpw, UINT32 num_bytes) | 550 | static void endian_convert(void *buf, UWORD bpw, UINT32 num_bytes) |
548 | /* We endian convert the keys on little-endian computers to */ | 551 | /* We endian convert the keys on little-endian computers to */ |
549 | /* compensate for the lack of big-endian memory reads during hashing. */ | 552 | /* compensate for the lack of big-endian memory reads during hashing. */ |
@@ -566,7 +569,6 @@ static void endian_convert(void *buf, UWORD bpw, UINT32 num_bytes) | |||
566 | } while (--iters); | 569 | } while (--iters); |
567 | } | 570 | } |
568 | } | 571 | } |
569 | #if (__LITTLE_ENDIAN__) | ||
570 | #define endian_convert_if_le(x,y,z) endian_convert((x),(y),(z)) | 572 | #define endian_convert_if_le(x,y,z) endian_convert((x),(y),(z)) |
571 | #else | 573 | #else |
572 | #define endian_convert_if_le(x,y,z) do{}while(0) /* Do nothing */ | 574 | #define endian_convert_if_le(x,y,z) do{}while(0) /* Do nothing */ |