summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTreehugger Robot <treehugger-gerrit@google.com>2018-12-04 02:01:31 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2018-12-04 02:01:31 +0000
commitbf1f16488d48634c5c9c6a9611ae1a409da53c93 (patch)
tree6d61864b509d96c0d059b204237f6137006b0e65
parent01a9b8b4187de01713f47413202e863ce69cdded (diff)
parent6ff660ab3ef2145bc6b94183c7fe2411de548945 (diff)
downloadandroid_system_keymaster-bf1f16488d48634c5c9c6a9611ae1a409da53c93.tar.gz
android_system_keymaster-bf1f16488d48634c5c9c6a9611ae1a409da53c93.tar.bz2
android_system_keymaster-bf1f16488d48634c5c9c6a9611ae1a409da53c93.zip
Merge "Align ARM Neon blocks to 16 bytes"
-rw-r--r--key_blob_utils/ocb.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/key_blob_utils/ocb.c b/key_blob_utils/ocb.c
index 1d3d6e3..9a68182 100644
--- a/key_blob_utils/ocb.c
+++ b/key_blob_utils/ocb.c
@@ -239,7 +239,7 @@ static inline block double_block(block b) {
}
#elif __ARM_NEON__
#include <arm_neon.h>
-typedef int8x16_t block; /* Yay! Endian-neutral reads! */
+typedef int8x16_t block __attribute__ ((aligned (16))); /* Yay! Endian-neutral reads! */
#define xor_block(x, y) veorq_s8(x, y)
#define zero_block() vdupq_n_s8(0)
static inline int unequal_blocks(block a, block b) {
@@ -672,6 +672,8 @@ ae_ctx* ae_allocate(void* misc) {
#elif(__ALTIVEC__ && !__PPC64__)
if (posix_memalign(&p, 16, sizeof(ae_ctx)) != 0)
p = NULL;
+#elif __ARM_NEON__
+ p = memalign(16, sizeof(ae_ctx));
#else
p = malloc(sizeof(ae_ctx));
#endif