Fix bsaes-armv7.pl getting disabled by accident.

https://boringssl-review.googlesource.com/c/34188 accidentally disabled
it (__ARM_MAX_ARCH__ wasn't defined), which, in turn, masked a bug in
https://boringssl-review.googlesource.com/c/34874.

Remove the __ARM_MAX_ARCH__ check as that's hardcoded to 8 anyway. Then
revert the problematic part of the bsaes-armv7.pl change. That brings
back the somewhat questionable post-dispatch to pre-dispatch call, but I
hope to patch the fallbacks out soon anyway.

Change-Id: I567e55fe35cb716d5ed56580113a302617f5ad71
Reviewed-on: https://boringssl-review.googlesource.com/c/35044
Commit-Queue: David Benjamin <davidben@google.com>
Commit-Queue: Adam Langley <agl@google.com>
Reviewed-by: Adam Langley <agl@google.com>
This commit is contained in:
David Benjamin 2019-02-26 19:44:57 -06:00 committed by CQ bot account: commit-bot@chromium.org
parent 6443173d03
commit f1f73f8966
3 changed files with 7 additions and 8 deletions

View File

@ -1113,7 +1113,10 @@ my ($inp,$out,$len,$key, $ivp,$fp,$rounds)=map("r$_",(0..3,8..10));
my ($keysched)=("sp");
$code.=<<___;
.extern aes_nohw_cbc_encrypt
@ TODO(davidben): This should be aes_nohw_cbc_encrypt, but that function does
@ not exist. Rather than add it, patch this fallback out. See
@ https://crbug.com/boringssl/256.
.extern AES_cbc_encrypt
.extern aes_nohw_decrypt
.global bsaes_cbc_encrypt
@ -1123,10 +1126,10 @@ bsaes_cbc_encrypt:
#ifndef __KERNEL__
cmp $len, #128
#ifndef __thumb__
blo aes_nohw_cbc_encrypt
blo AES_cbc_encrypt
#else
bhs 1f
b aes_nohw_cbc_encrypt
b AES_cbc_encrypt
1:
#endif
#endif

View File

@ -49,7 +49,7 @@ OPENSSL_INLINE char bsaes_capable(void) { return vpaes_capable(); }
OPENSSL_INLINE int hwaes_capable(void) { return CRYPTO_is_ARMv8_AES_capable(); }
#if defined(OPENSSL_ARM) && __ARM_MAX_ARCH__ >= 7
#if defined(OPENSSL_ARM)
#define BSAES
OPENSSL_INLINE char bsaes_capable(void) { return CRYPTO_is_NEON_capable(); }
#endif

View File

@ -64,10 +64,6 @@
#include "../modes/internal.h"
#include "../delocate.h"
#if defined(OPENSSL_ARM) || defined(OPENSSL_AARCH64)
#include <openssl/arm_arch.h>
#endif
OPENSSL_MSVC_PRAGMA(warning(push))
OPENSSL_MSVC_PRAGMA(warning(disable: 4702)) // Unreachable code.