boringssl/crypto
David Benjamin b8d7b7498c Prefer vpaes over bsaes in AES-GCM-SIV and AES-CCM.
The AES-GCM-SIV code does not use ctr128_f at all so bsaes is simply
identical to aes_nohw. Also, while CCM encrypts with CTR mode, its MAC
is not parallelizable at all.

(Given the existence of non-parallelizable modes, we ought to make a
vpaes-armv7.pl to ensure constant-time AES on NEON. For now, pick the
right implementation for x86_64 at least.)

aes_ctr_set_key and friends probably aren't the right abstraction
(observe the large vs small inputs hint *almost* matches whether you
touch block128_f), but the right abstraction depends on a couple
questions:

- If you don't provide ctr128_f, is there a perf hit to implementing
  ctr128_f on top of your block128_f to unify calling code?

- It is almost certainly better to use bsaes with gcm.c by calling
  ctr128_f exclusively and paying some copies (a dedicated calling
  convention would be even better, but would be a headache) to integrate
  leading and trailing blocks into the CTR pass. Is this a win, loss, or
  no-op for hwaes, where block128_f is just fine? hwaes is the one mode
  we really should not regress.

Hopefully those will get answered as we continue to chip away at this.

Bug: 256
Change-Id: I8f0150b223b671e68f7da6faaff94a3bea398d4d
Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/35169
Reviewed-by: Adam Langley <agl@google.com>
2019-03-05 17:55:03 +00:00
..
asn1 Modernize OPENSSL_COMPILE_ASSERT, part 2. 2018-11-14 16:06:37 +00:00
base64 Modernize OPENSSL_COMPILE_ASSERT, part 2. 2018-11-14 16:06:37 +00:00
bio Fix d2i_*_bio on partial reads. 2018-12-05 22:05:28 +00:00
bn_extra Add some Node compatibility functions. 2019-01-25 16:50:30 +00:00
buf Flatten most of the crypto target. 2018-09-05 23:41:25 +00:00
bytestring Add uint64_t support in CBS and CBB. 2019-02-22 20:38:17 +00:00
chacha Add ABI tests for ChaCha20_ctr32. 2019-01-09 03:11:45 +00:00
cipher_extra Prefer vpaes over bsaes in AES-GCM-SIV and AES-CCM. 2019-03-05 17:55:03 +00:00
cmac Flatten most of the crypto target. 2018-09-05 23:41:25 +00:00
conf Use proper functions for lh_*. 2018-10-15 23:37:04 +00:00
curve25519 Automatically disable assembly with MSAN. 2018-09-07 21:12:37 +00:00
dh Flatten most of the crypto target. 2018-09-05 23:41:25 +00:00
digest_extra Fix undefined pointer casts in SHA-512 code. 2019-01-22 23:18:36 +00:00
dsa Tidy up dsa_sign_setup. 2018-10-25 21:51:57 +00:00
ec_extra Use EC_RAW_POINT in ECDSA. 2018-11-13 02:06:46 +00:00
ecdh_extra Clean up EC_POINT to byte conversions. 2018-11-13 17:27:59 +00:00
ecdsa_extra Remove unreachable code. 2018-11-12 23:34:36 +00:00
engine Flatten most of the crypto target. 2018-09-05 23:41:25 +00:00
err Enforce key usage for RSA keys in TLS 1.2. 2019-01-30 21:28:34 +00:00
evp Add a very roundabout EC keygen API. 2019-01-25 23:08:12 +00:00
fipsmodule modes/asm/ghash-armv4.pl: address "infixes are deprecated" warnings. 2019-03-05 17:52:28 +00:00
hkdf Flatten most of the crypto target. 2018-09-05 23:41:25 +00:00
hmac_extra Convert a number of tests to GTest. 2017-06-01 17:02:13 +00:00
hrss HRSS: flatten sample distribution. 2019-01-22 22:06:43 +00:00
lhash Fix undefined function pointer casts in LHASH. 2018-10-15 23:53:24 +00:00
obj Add initial HRSS support. 2018-12-12 17:35:02 +00:00
pem Rewrite PEM_X509_INFO_read_bio. 2018-10-01 17:35:10 +00:00
perlasm Fix x86_64-xlate.pl comment regex. 2019-02-21 16:50:17 +00:00
pkcs7 Fix undefined function pointer casts in {d2i,i2d}_Foo_{bio,fp} 2018-10-01 17:34:53 +00:00
pkcs8 Fix undefined function pointer casts in {d2i,i2d}_Foo_{bio,fp} 2018-10-01 17:34:53 +00:00
poly1305 Automatically disable assembly with MSAN. 2018-09-07 21:12:37 +00:00
pool Clear out a bunch of -Wextra-semi warnings. 2019-02-21 19:12:39 +00:00
rand_extra Unwind RDRAND functions correctly on Windows. 2019-02-12 20:24:27 +00:00
rc4 Flatten most of the crypto target. 2018-09-05 23:41:25 +00:00
rsa_extra Rename OPENSSL_NO_THREADS, part 1. 2018-09-26 19:10:02 +00:00
stack Don't pass NULL,0 to qsort. 2019-01-22 23:28:38 +00:00
test Add a reference for Linux ARM ABI. 2019-02-27 17:18:02 +00:00
x509 Fix d2i_*_bio on partial reads. 2018-12-05 22:05:28 +00:00
x509v3 Unexport and rename hex_to_string, string_to_hex, and name_cmp. 2018-11-27 00:08:39 +00:00
abi_self_test.cc Use Windows symbol APIs in the unwind tester. 2019-02-12 20:42:47 +00:00
CMakeLists.txt Implement ABI testing for aarch64. 2019-02-05 21:44:04 +00:00
compiler_test.cc Test that nullptr has the obvious memory representation. 2017-07-28 17:39:28 +00:00
constant_time_test.cc Add a test for CRYPTO_memcmp. 2018-03-27 16:22:47 +00:00
cpu-aarch64-fuchsia.c Add cpu-aarch64-fuchsia.c 2018-02-13 20:12:47 +00:00
cpu-aarch64-linux.c Add cpu-aarch64-fuchsia.c 2018-02-13 20:12:47 +00:00
cpu-arm-linux_test.cc Move ARM cpuinfo functions to the header. 2018-11-21 00:46:57 +00:00
cpu-arm-linux.c Move ARM cpuinfo functions to the header. 2018-11-21 00:46:57 +00:00
cpu-arm-linux.h Move ARM cpuinfo functions to the header. 2018-11-21 00:46:57 +00:00
cpu-arm.c
cpu-intel.c Pretend AMD XOP was never a thing. 2018-12-03 22:59:55 +00:00
cpu-ppc64le.c Run the comment converter on libcrypto. 2017-08-18 21:49:04 +00:00
crypto.c Add test of assembly code dispatch. 2019-01-22 20:22:53 +00:00
ex_data.c Unexport more of lhash. 2017-10-25 04:17:18 +00:00
impl_dispatch_test.cc Enable vpaes for AES_* functions. 2019-02-22 23:09:19 +00:00
internal.h Fix header file for _byteswap_ulong and _byteswap_uint64 from MSVC CRT 2019-01-14 19:49:39 +00:00
mem.c Tell ASan about the OPENSSL_malloc prefix. 2019-03-05 17:53:16 +00:00
refcount_c11.c Run the comment converter on libcrypto. 2017-08-18 21:49:04 +00:00
refcount_lock.c Modernize OPENSSL_COMPILE_ASSERT, part 2. 2018-11-14 16:06:37 +00:00
refcount_test.cc Rename OPENSSL_NO_THREADS, part 1. 2018-09-26 19:10:02 +00:00
self_test.cc Extract FIPS KAT tests into a function. 2018-01-22 20:16:38 +00:00
thread_none.c Rename OPENSSL_NO_THREADS, part 1. 2018-09-26 19:10:02 +00:00
thread_pthread.c Modernize OPENSSL_COMPILE_ASSERT, part 2. 2018-11-14 16:06:37 +00:00
thread_test.cc Rename OPENSSL_NO_THREADS, part 1. 2018-09-26 19:10:02 +00:00
thread_win.c Replace the last CRITICAL_SECTION with SRWLOCK. 2018-12-03 20:37:35 +00:00
thread.c