diff options
author | miod <> | 2014-04-17 21:17:12 +0000 |
---|---|---|
committer | miod <> | 2014-04-17 21:17:12 +0000 |
commit | aa8f085033b21b0ec0b70c18909ba27ef8752e51 (patch) | |
tree | da9109a7546d5e98b8647a37cc675d8b776d00ad /src/lib/libcrypto/aes | |
parent | e3644ed49258ff4a399142bf4ed0a7ba5f9bf76a (diff) | |
download | openbsd-aa8f085033b21b0ec0b70c18909ba27ef8752e51.tar.gz openbsd-aa8f085033b21b0ec0b70c18909ba27ef8752e51.tar.bz2 openbsd-aa8f085033b21b0ec0b70c18909ba27ef8752e51.zip |
Get rid of MS Visual C compiler and Intel C compiler specific defines.
Diffstat (limited to 'src/lib/libcrypto/aes')
-rw-r--r-- | src/lib/libcrypto/aes/aes_locl.h | 10 | ||||
-rw-r--r-- | src/lib/libcrypto/aes/aes_x86core.c | 4 |
2 files changed, 3 insertions, 11 deletions
diff --git a/src/lib/libcrypto/aes/aes_locl.h b/src/lib/libcrypto/aes/aes_locl.h index 054b442d41..1d0e86331e 100644 --- a/src/lib/libcrypto/aes/aes_locl.h +++ b/src/lib/libcrypto/aes/aes_locl.h | |||
@@ -62,14 +62,8 @@ | |||
62 | #include <stdlib.h> | 62 | #include <stdlib.h> |
63 | #include <string.h> | 63 | #include <string.h> |
64 | 64 | ||
65 | #if defined(_MSC_VER) && (defined(_M_IX86) || defined(_M_AMD64) || defined(_M_X64)) | 65 | #define GETU32(pt) (((u32)(pt)[0] << 24) ^ ((u32)(pt)[1] << 16) ^ ((u32)(pt)[2] << 8) ^ ((u32)(pt)[3])) |
66 | # define SWAP(x) (_lrotl(x, 8) & 0x00ff00ff | _lrotr(x, 8) & 0xff00ff00) | 66 | #define PUTU32(ct, st) { (ct)[0] = (u8)((st) >> 24); (ct)[1] = (u8)((st) >> 16); (ct)[2] = (u8)((st) >> 8); (ct)[3] = (u8)(st); } |
67 | # define GETU32(p) SWAP(*((u32 *)(p))) | ||
68 | # define PUTU32(ct, st) { *((u32 *)(ct)) = SWAP((st)); } | ||
69 | #else | ||
70 | # define GETU32(pt) (((u32)(pt)[0] << 24) ^ ((u32)(pt)[1] << 16) ^ ((u32)(pt)[2] << 8) ^ ((u32)(pt)[3])) | ||
71 | # define PUTU32(ct, st) { (ct)[0] = (u8)((st) >> 24); (ct)[1] = (u8)((st) >> 16); (ct)[2] = (u8)((st) >> 8); (ct)[3] = (u8)(st); } | ||
72 | #endif | ||
73 | 67 | ||
74 | #ifdef AES_LONG | 68 | #ifdef AES_LONG |
75 | typedef unsigned long u32; | 69 | typedef unsigned long u32; |
diff --git a/src/lib/libcrypto/aes/aes_x86core.c b/src/lib/libcrypto/aes/aes_x86core.c index c5d17b3127..295ea22bb4 100644 --- a/src/lib/libcrypto/aes/aes_x86core.c +++ b/src/lib/libcrypto/aes/aes_x86core.c | |||
@@ -91,9 +91,7 @@ typedef unsigned long long u64; | |||
91 | #endif | 91 | #endif |
92 | 92 | ||
93 | #undef ROTATE | 93 | #undef ROTATE |
94 | #if defined(_MSC_VER) || defined(__ICC) | 94 | #if defined(__GNUC__) && __GNUC__>=2 |
95 | # define ROTATE(a,n) _lrotl(a,n) | ||
96 | #elif defined(__GNUC__) && __GNUC__>=2 | ||
97 | # if defined(__i386) || defined(__i386__) || defined(__x86_64) || defined(__x86_64__) | 95 | # if defined(__i386) || defined(__i386__) || defined(__x86_64) || defined(__x86_64__) |
98 | # define ROTATE(a,n) ({ register unsigned int ret; \ | 96 | # define ROTATE(a,n) ({ register unsigned int ret; \ |
99 | asm ( \ | 97 | asm ( \ |