summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorkettenis <>2018-01-24 23:03:37 +0000
committerkettenis <>2018-01-24 23:03:37 +0000
commitffa49cfcc71c84fb877cf150d758ca8420dcb2d2 (patch)
tree7189f82b04c78fde1c13c21aaa10de0acd6432a3 /src
parent1d8e5453558fbe5e97fd1becfef826a261de138b (diff)
downloadopenbsd-ffa49cfcc71c84fb877cf150d758ca8420dcb2d2.tar.gz
openbsd-ffa49cfcc71c84fb877cf150d758ca8420dcb2d2.tar.bz2
openbsd-ffa49cfcc71c84fb877cf150d758ca8420dcb2d2.zip
Make the NEON codepaths conditional on __STRICT_ALIGNMENT not being
defined as they rely on unaligned access. ok joel@
Diffstat (limited to 'src')
-rw-r--r--src/lib/libcrypto/modes/asm/ghash-armv4.pl2
-rw-r--r--src/lib/libcrypto/modes/gcm128.c4
-rw-r--r--src/lib/libcrypto/sha/asm/sha512-armv4.pl4
3 files changed, 5 insertions, 5 deletions
diff --git a/src/lib/libcrypto/modes/asm/ghash-armv4.pl b/src/lib/libcrypto/modes/asm/ghash-armv4.pl
index 4f8372d897..2d57806b46 100644
--- a/src/lib/libcrypto/modes/asm/ghash-armv4.pl
+++ b/src/lib/libcrypto/modes/asm/ghash-armv4.pl
@@ -319,7 +319,7 @@ sub Dhi() { shift=~m|q([1]?[0-9])|?"d".($1*2+1):""; }
319sub Q() { shift=~m|d([1-3]?[02468])|?"q".($1/2):""; } 319sub Q() { shift=~m|d([1-3]?[02468])|?"q".($1/2):""; }
320 320
321$code.=<<___; 321$code.=<<___;
322#if __ARM_ARCH__>=7 322#if __ARM_ARCH__>=7 && !defined(__STRICT_ALIGNMENT)
323.fpu neon 323.fpu neon
324 324
325.global gcm_gmult_neon 325.global gcm_gmult_neon
diff --git a/src/lib/libcrypto/modes/gcm128.c b/src/lib/libcrypto/modes/gcm128.c
index 42291519bc..74362e6adc 100644
--- a/src/lib/libcrypto/modes/gcm128.c
+++ b/src/lib/libcrypto/modes/gcm128.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: gcm128.c,v 1.21 2017/12/09 07:16:51 deraadt Exp $ */ 1/* $OpenBSD: gcm128.c,v 1.22 2018/01/24 23:03:37 kettenis Exp $ */
2/* ==================================================================== 2/* ====================================================================
3 * Copyright (c) 2010 The OpenSSL Project. All rights reserved. 3 * Copyright (c) 2010 The OpenSSL Project. All rights reserved.
4 * 4 *
@@ -661,7 +661,7 @@ void gcm_ghash_4bit_x86(u64 Xi[2],const u128 Htable[16],const u8 *inp,size_t len
661# endif 661# endif
662# elif defined(__arm__) || defined(__arm) 662# elif defined(__arm__) || defined(__arm)
663# include "arm_arch.h" 663# include "arm_arch.h"
664# if __ARM_ARCH__>=7 664# if __ARM_ARCH__>=7 && !defined(__STRICT_ALIGNMENT)
665# define GHASH_ASM_ARM 665# define GHASH_ASM_ARM
666# define GCM_FUNCREF_4BIT 666# define GCM_FUNCREF_4BIT
667void gcm_gmult_neon(u64 Xi[2],const u128 Htable[16]); 667void gcm_gmult_neon(u64 Xi[2],const u128 Htable[16]);
diff --git a/src/lib/libcrypto/sha/asm/sha512-armv4.pl b/src/lib/libcrypto/sha/asm/sha512-armv4.pl
index 28ae155f4b..a247a00c2b 100644
--- a/src/lib/libcrypto/sha/asm/sha512-armv4.pl
+++ b/src/lib/libcrypto/sha/asm/sha512-armv4.pl
@@ -229,7 +229,7 @@ WORD64(0x5fcb6fab,0x3ad6faec, 0x6c44198c,0x4a475817)
229sha512_block_data_order: 229sha512_block_data_order:
230 sub r3,pc,#8 @ sha512_block_data_order 230 sub r3,pc,#8 @ sha512_block_data_order
231 add $len,$inp,$len,lsl#7 @ len to point at the end of inp 231 add $len,$inp,$len,lsl#7 @ len to point at the end of inp
232#if __ARM_ARCH__>=7 232#if __ARM_ARCH__>=7 && !defined(__STRICT_ALIGNMENT)
233 ldr r12,.LOPENSSL_armcap 233 ldr r12,.LOPENSSL_armcap
234 ldr r12,[r3,r12] @ OPENSSL_armcap_P 234 ldr r12,[r3,r12] @ OPENSSL_armcap_P
235 tst r12,#1 235 tst r12,#1
@@ -533,7 +533,7 @@ ___
533} 533}
534 534
535$code.=<<___; 535$code.=<<___;
536#if __ARM_ARCH__>=7 536#if __ARM_ARCH__>=7 && !defined(__STRICT_ALIGNMENT)
537.fpu neon 537.fpu neon
538 538
539.align 4 539.align 4