boringssl/crypto
David Benjamin a2d4c0c426 Work around Android devices without AT_HWCAP2.
Some ARMv8 Android devices don't have AT_HWCAP2. This means, when running in
32-bit mode (ARM capability APIs on Linux are different between AArch32 and
AArch64), we can't discover the various nice instructions.

On a Nexus 6P, this gives a, uh, minor performance win when running in 32-bit
mode.

Before:
Did 1085000 AES-128-GCM (16 bytes) seal operations in 1000003us (1084996.7 ops/sec): 17.4 MB/s
Did 60000 AES-128-GCM (1350 bytes) seal operations in 1013416us (59205.7 ops/sec): 79.9 MB/s
Did 11000 AES-128-GCM (8192 bytes) seal operations in 1019778us (10786.7 ops/sec): 88.4 MB/s
Did 1009000 AES-256-GCM (16 bytes) seal operations in 1000650us (1008344.6 ops/sec): 16.1 MB/s
Did 49000 AES-256-GCM (1350 bytes) seal operations in 1015698us (48242.7 ops/sec): 65.1 MB/s
Did 9394 AES-256-GCM (8192 bytes) seal operations in 1071104us (8770.4 ops/sec): 71.8 MB/s
Did 1557000 SHA-1 (16 bytes) operations in 1000317us (1556506.6 ops/sec): 24.9 MB/s
Did 762000 SHA-1 (256 bytes) operations in 1000527us (761598.6 ops/sec): 195.0 MB/s
Did 45000 SHA-1 (8192 bytes) operations in 1013773us (44388.6 ops/sec): 363.6 MB/s
Did 1459000 SHA-256 (16 bytes) operations in 1000271us (1458604.7 ops/sec): 23.3 MB/s
Did 538000 SHA-256 (256 bytes) operations in 1000990us (537467.9 ops/sec): 137.6 MB/s
Did 26000 SHA-256 (8192 bytes) operations in 1008403us (25783.3 ops/sec): 211.2 MB/s

After:
Did 1890000 AES-128-GCM (16 bytes) seal operations in 1000068us (1889871.5 ops/sec): 30.2 MB/s
Did 509000 AES-128-GCM (1350 bytes) seal operations in 1000112us (508943.0 ops/sec): 687.1 MB/s
Did 110000 AES-128-GCM (8192 bytes) seal operations in 1007966us (109130.7 ops/sec): 894.0 MB/s
Did 1960000 AES-256-GCM (16 bytes) seal operations in 1000303us (1959406.3 ops/sec): 31.4 MB/s
Did 460000 AES-256-GCM (1350 bytes) seal operations in 1001873us (459140.0 ops/sec): 619.8 MB/s
Did 97000 AES-256-GCM (8192 bytes) seal operations in 1005337us (96485.1 ops/sec): 790.4 MB/s
Did 1927000 SHA-1 (16 bytes) operations in 1000429us (1926173.7 ops/sec): 30.8 MB/s
Did 1151000 SHA-1 (256 bytes) operations in 1000425us (1150511.0 ops/sec): 294.5 MB/s
Did 87000 SHA-1 (8192 bytes) operations in 1003089us (86732.1 ops/sec): 710.5 MB/s
Did 2357390 SHA-256 (16 bytes) operations in 1000116us (2357116.6 ops/sec): 37.7 MB/s
Did 1410000 SHA-256 (256 bytes) operations in 1000176us (1409751.9 ops/sec): 360.9 MB/s
Did 101000 SHA-256 (8192 bytes) operations in 1007007us (100297.2 ops/sec): 821.6 MB/s

BUG=chromium:596156

Change-Id: Iacc1f8d8a07e991d4615f2e12c5c54923fb31aa2
Reviewed-on: https://boringssl-review.googlesource.com/7507
Reviewed-by: David Benjamin <davidben@google.com>
2016-03-26 04:56:45 +00:00
..
aes Mark ARM assembly globals hidden uniformly in arm-xlate.pl. 2016-02-11 17:28:03 +00:00
asn1 Fix build when using Visual Studio 2015 Update 1. 2016-03-25 21:39:52 +00:00
base64 Remove calls to ERR_load_crypto_strings. 2016-01-25 23:09:08 +00:00
bio Fix Windows build 2016-03-20 16:46:10 +00:00
bn Remove unnecessary |BN_CTX_start|/|BN_CTX_end| in |BN_mod_exp_mont_consttime|. 2016-03-20 17:16:27 +00:00
buf
bytestring Add CBS_ASN1_UTF8STRING define. 2016-03-23 19:29:49 +00:00
chacha Add a standalone ChaCha test. 2016-03-04 19:11:03 +00:00
cipher Fix build when using Visual Studio 2015 Update 1. 2016-03-25 21:39:52 +00:00
cmac
conf Add missing internal includes. 2016-03-20 16:38:54 +00:00
curve25519 Appease sanitizers in x25519_ge_scalarmult. 2016-03-10 19:08:42 +00:00
des Use the straight-forward ROTATE macro. 2015-12-16 19:57:31 +00:00
dh Don't cast |OPENSSL_malloc|/|OPENSSL_realloc| result. 2016-02-11 22:07:56 +00:00
digest Fix potential double free in EVP_DigestInit_ex 2016-03-22 15:17:32 +00:00
dsa Fix a few more missing CBB_cleanups. 2016-03-08 21:08:48 +00:00
ec Use |size_t| and |int| consistently in p{224,256}-64.c. 2016-03-22 23:28:08 +00:00
ecdh
ecdsa Fix a few more missing CBB_cleanups. 2016-03-08 21:08:48 +00:00
engine
err Align with upstream's error strings, take two. 2016-03-15 16:02:12 +00:00
evp Fix build with -Wwrite-strings. 2016-03-24 03:11:20 +00:00
hkdf Fix build when using Visual Studio 2015 Update 1. 2016-03-25 21:39:52 +00:00
hmac
lhash
md4 Add one-shot |MD4| function. 2016-03-09 01:13:55 +00:00
md5 Make HOST_l2c return void. 2015-12-16 20:02:37 +00:00
modes Fix build when using Visual Studio 2015 Update 1. 2016-03-25 21:39:52 +00:00
obj Rename NID_x25519 to NID_X25519. 2016-03-07 15:48:51 +00:00
pem Decouple the EVP and PEM code. 2016-02-26 22:50:21 +00:00
perlasm perlasm/x86_64-xlate.pl: handle binary constants early. 2016-03-17 18:23:40 +00:00
pkcs8 BIO_new_mem_buf should take const void * 2016-02-24 19:14:19 +00:00
poly1305 Flip the arguments to ExpectBytesEqual in poly1305_test. 2016-03-24 19:30:47 +00:00
rand Add a deterministic PRNG for fuzzing. 2016-03-03 01:36:19 +00:00
rc4 Remove the stitched RC4-MD5 code and use the generic one. 2015-12-16 23:57:42 +00:00
rsa Add tests for RSA objects with only n and d. 2016-03-25 20:52:17 +00:00
sha Consistently use named constants in ARM assembly files. 2016-02-23 17:18:18 +00:00
stack If no comparison function is set, sk_sort is a NOP 2016-02-25 20:02:53 +00:00
test Fix build when using Visual Studio 2015 Update 1. 2016-03-25 21:39:52 +00:00
x509 Fix build when using Visual Studio 2015 Update 1. 2016-03-25 21:39:52 +00:00
x509v3 Fix build when using Visual Studio 2015 Update 1. 2016-03-25 21:39:52 +00:00
CMakeLists.txt Rewrite ARM feature detection. 2016-03-26 04:54:44 +00:00
constant_time_test.c
cpu-aarch64-linux.c Rewrite ARM feature detection. 2016-03-26 04:54:44 +00:00
cpu-arm-linux.c Work around Android devices without AT_HWCAP2. 2016-03-26 04:56:45 +00:00
cpu-arm.c Rewrite ARM feature detection. 2016-03-26 04:54:44 +00:00
cpu-intel.c Add missing internal includes. 2016-03-20 16:38:54 +00:00
crypto.c Add |FIPS_mode|, which returns zero. 2016-03-02 00:15:37 +00:00
directory_posix.c
directory_win.c
directory.h
ex_data.c Skip free callbacks on empty CRYPTO_EX_DATAs. 2015-12-15 21:32:14 +00:00
internal.h Fix build when using Visual Studio 2015 Update 1. 2016-03-25 21:39:52 +00:00
mem.c Fix some indentation. 2016-01-28 00:51:45 +00:00
refcount_c11.c
refcount_lock.c
refcount_test.c
thread_none.c
thread_pthread.c Remove call to |fprintf| in |CRYPTO_once|. 2016-03-03 18:01:43 +00:00
thread_test.c
thread_win.c Fix data <-> function pointer casts in thread_win.c. 2016-01-27 22:08:26 +00:00
thread.c
time_support.c Remove some mingw support cruft. 2016-01-25 23:05:45 +00:00