summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/modes/gcm128.c
diff options
context:
space:
mode:
authormiod <>2014-05-07 22:05:48 +0000
committermiod <>2014-05-07 22:05:48 +0000
commit55b870bc0442258199f29518a1c056569c6cff35 (patch)
treedeb34c5a4686fe5f3219b9c2cc98fdf18af20a2d /src/lib/libcrypto/modes/gcm128.c
parent6e694fdc39d16d30d31406ef82c6b069d9d005d9 (diff)
downloadopenbsd-55b870bc0442258199f29518a1c056569c6cff35.tar.gz
openbsd-55b870bc0442258199f29518a1c056569c6cff35.tar.bz2
openbsd-55b870bc0442258199f29518a1c056569c6cff35.zip
Get __STRICT_ALIGNMENT from <machine/endian.h> and decide upon it, rather
than defining it for not (i386 and amd64 (and sometimes s390)) only. Compile-time tests remain compile-time tests, and runtime-test remain runtime-test instead of being converted to compile-time tests, per matthew@'s explicit demand (rationale: this makes sure the compiler checks your code even if you won't run it). No functional change except on s390 (which we don't run on) and vax (which we run on, but noone cares about) ok matthew@
Diffstat (limited to 'src/lib/libcrypto/modes/gcm128.c')
-rw-r--r--src/lib/libcrypto/modes/gcm128.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/lib/libcrypto/modes/gcm128.c b/src/lib/libcrypto/modes/gcm128.c
index 92b7f4f3c8..f3bcb7dd6e 100644
--- a/src/lib/libcrypto/modes/gcm128.c
+++ b/src/lib/libcrypto/modes/gcm128.c
@@ -60,7 +60,7 @@
60#endif 60#endif
61#include <assert.h> 61#include <assert.h>
62 62
63#if defined(BSWAP4) && defined(STRICT_ALIGNMENT) 63#if defined(BSWAP4) && defined(__STRICT_ALIGNMENT)
64/* redefine, because alignment is ensured */ 64/* redefine, because alignment is ensured */
65#undef GETU32 65#undef GETU32
66#define GETU32(p) BSWAP4(*(const u32 *)(p)) 66#define GETU32(p) BSWAP4(*(const u32 *)(p))
@@ -935,7 +935,7 @@ int CRYPTO_gcm128_encrypt(GCM128_CONTEXT *ctx,
935 return 0; 935 return 0;
936 } 936 }
937 } 937 }
938#if defined(STRICT_ALIGNMENT) 938#ifdef __STRICT_ALIGNMENT
939 if (((size_t)in|(size_t)out)%sizeof(size_t) != 0) 939 if (((size_t)in|(size_t)out)%sizeof(size_t) != 0)
940 break; 940 break;
941#endif 941#endif
@@ -1113,7 +1113,7 @@ int CRYPTO_gcm128_decrypt(GCM128_CONTEXT *ctx,
1113 return 0; 1113 return 0;
1114 } 1114 }
1115 } 1115 }
1116#if defined(STRICT_ALIGNMENT) 1116#ifdef __STRICT_ALIGNMENT
1117 if (((size_t)in|(size_t)out)%sizeof(size_t) != 0) 1117 if (((size_t)in|(size_t)out)%sizeof(size_t) != 0)
1118 break; 1118 break;
1119#endif 1119#endif