From c521b305c606c153c1aeea7cc133e6f2f7920974 Mon Sep 17 00:00:00 2001 From: David Benjamin Date: Mon, 20 Apr 2015 21:31:49 -0400 Subject: [PATCH] aes/asm/bsaes-armv7: fix kernel-side XTS and harmonize with Linux. XTS bug spotted and fix suggested by Adrian Kotelba. (Imported from upstream's e620e5ae37bc3fc5e457ebf3edcdd01b20f8c5dd.) Another patch we missed. Change-Id: Ibea40eeec01a49b29064b14631706756795c9592 Reviewed-on: https://boringssl-review.googlesource.com/4489 Reviewed-by: Adam Langley --- crypto/aes/asm/bsaes-armv7.pl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/crypto/aes/asm/bsaes-armv7.pl b/crypto/aes/asm/bsaes-armv7.pl index 82d29ef0..440e65d3 100644 --- a/crypto/aes/asm/bsaes-armv7.pl +++ b/crypto/aes/asm/bsaes-armv7.pl @@ -703,7 +703,7 @@ $code.=<<___; # define BSAES_ASM_EXTENDED_KEY # define XTS_CHAIN_TWEAK # define __ARM_ARCH__ __LINUX_ARM_ARCH__ -# define __ARM_MAX_ARCH__ __LINUX_ARM_ARCH__ +# define __ARM_MAX_ARCH__ 7 #endif #ifdef __thumb__ @@ -2087,9 +2087,11 @@ bsaes_xts_decrypt: vld1.8 {@XMM[8]}, [r0] @ initial tweak adr $magic, .Lxts_magic +#ifndef XTS_CHAIN_TWEAK tst $len, #0xf @ if not multiple of 16 it ne @ Thumb2 thing, sanity check in ARM subne $len, #0x10 @ subtract another 16 bytes +#endif subs $len, #0x80 blo .Lxts_dec_short