boringssl/crypto/cipher_extra
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
..
asm Enable extra_in with the ChaCha20-Poly1305 AEAD. 2017-07-14 22:13:25 +00:00
test Test CBC padding more aggressively. 2018-10-30 20:53:00 +00:00
aead_test.cc Add XChaCha20-Poly1305 AEAD. 2018-08-09 18:49:09 +00:00
cipher_extra.c sync EVP_get_cipherbyname with EVP_do_all_sorted 2019-02-11 17:20:23 +00:00
cipher_test.cc Add EVP_CTRL_AEAD_* constants. 2018-08-09 17:08:15 +00:00
derive_key.c Move cipher/ into crypto/fipsmodule/ 2017-05-05 22:39:40 +00:00
e_aesccm.c Prefer vpaes over bsaes in AES-GCM-SIV and AES-CCM. 2019-03-05 17:55:03 +00:00
e_aesctrhmac.c Don't use bsaes over vpaes for CTR-DRBG. 2019-02-01 18:03:39 +00:00
e_aesgcmsiv.c Prefer vpaes over bsaes in AES-GCM-SIV and AES-CCM. 2019-03-05 17:55:03 +00:00
e_chacha20poly1305.c Modernize OPENSSL_COMPILE_ASSERT, part 2. 2018-11-14 16:06:37 +00:00
e_null.c
e_rc2.c Move OPENSSL_FALLTHROUGH to internal headers. 2018-01-29 18:17:57 +00:00
e_rc4.c
e_tls.c Add start of infrastructure for checking constant-time properties. 2018-12-18 22:43:02 +00:00
internal.h Run the comment converter on libcrypto. 2017-08-18 21:49:04 +00:00
tls_cbc.c Fix EVP_tls_cbc_digest_record is slow using SHA-384 and short messages 2018-10-29 18:26:27 +00:00