diff options
Diffstat (limited to 'src/lib/libcrypto/modes/xts128.c')
-rw-r--r-- | src/lib/libcrypto/modes/xts128.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/lib/libcrypto/modes/xts128.c b/src/lib/libcrypto/modes/xts128.c index 9cf27a25e9..de23de457d 100644 --- a/src/lib/libcrypto/modes/xts128.c +++ b/src/lib/libcrypto/modes/xts128.c | |||
@@ -62,7 +62,6 @@ int CRYPTO_xts128_encrypt(const XTS128_CONTEXT *ctx, const unsigned char iv[16], | |||
62 | const unsigned char *inp, unsigned char *out, | 62 | const unsigned char *inp, unsigned char *out, |
63 | size_t len, int enc) | 63 | size_t len, int enc) |
64 | { | 64 | { |
65 | const union { long one; char little; } is_endian = {1}; | ||
66 | union { u64 u[2]; u32 d[4]; u8 c[16]; } tweak, scratch; | 65 | union { u64 u[2]; u32 d[4]; u8 c[16]; } tweak, scratch; |
67 | unsigned int i; | 66 | unsigned int i; |
68 | 67 | ||
@@ -98,7 +97,7 @@ int CRYPTO_xts128_encrypt(const XTS128_CONTEXT *ctx, const unsigned char iv[16], | |||
98 | 97 | ||
99 | if (len==0) return 0; | 98 | if (len==0) return 0; |
100 | 99 | ||
101 | if (is_endian.little) { | 100 | if (_BYTE_ORDER == _LITTLE_ENDIAN) { |
102 | unsigned int carry,res; | 101 | unsigned int carry,res; |
103 | 102 | ||
104 | res = 0x87&(((int)tweak.d[3])>>31); | 103 | res = 0x87&(((int)tweak.d[3])>>31); |
@@ -134,7 +133,7 @@ int CRYPTO_xts128_encrypt(const XTS128_CONTEXT *ctx, const unsigned char iv[16], | |||
134 | else { | 133 | else { |
135 | union { u64 u[2]; u8 c[16]; } tweak1; | 134 | union { u64 u[2]; u8 c[16]; } tweak1; |
136 | 135 | ||
137 | if (is_endian.little) { | 136 | if (_BYTE_ORDER == _LITTLE_ENDIAN) { |
138 | unsigned int carry,res; | 137 | unsigned int carry,res; |
139 | 138 | ||
140 | res = 0x87&(((int)tweak.d[3])>>31); | 139 | res = 0x87&(((int)tweak.d[3])>>31); |