762e1d039c
Patch from https://mta.openssl.org/pipermail/openssl-dev/2016-March/005625.html. Upstream has yet to make a decision on aliasing requirements for their assembly. If they choose to go with the stricter aliasing requirement rather than land this patch, we'll probably want to tweak EVP_AEAD's API guarantees accordingly and then undiverge. In the meantime, import this to avoid a regression on x86 from when we had compiler-vectorized code on GCC platforms. Per our assembly coverage tools and pending multi-CPU-variant tests, we have good coverage here. Unlike Poly1305 (which is currently waiting on yet another upstream bugfix), where there is risk of missed carries everywhere, it is much more difficult to accidentally make a ChaCha20 implementation that fails based on the data passed into it. This restores a sizeable speed improvement on x86. Before: Did 1131000 ChaCha20-Poly1305 (16 bytes) seal operations in 1000205us (1130768.2 ops/sec): 18.1 MB/s Did 161000 ChaCha20-Poly1305 (1350 bytes) seal operations in 1006136us (160018.1 ops/sec): 216.0 MB/s Did 28000 ChaCha20-Poly1305 (8192 bytes) seal operations in 1023264us (27363.4 ops/sec): 224.2 MB/s Did 1166000 ChaCha20-Poly1305-Old (16 bytes) seal operations in 1000447us (1165479.0 ops/sec): 18.6 MB/s Did 160000 ChaCha20-Poly1305-Old (1350 bytes) seal operations in 1004818us (159232.8 ops/sec): 215.0 MB/s Did 30000 ChaCha20-Poly1305-Old (8192 bytes) seal operations in 1016977us (29499.2 ops/sec): 241.7 MB/s After: Did 2208000 ChaCha20-Poly1305 (16 bytes) seal operations in 1000031us (2207931.6 ops/sec): 35.3 MB/s Did 402000 ChaCha20-Poly1305 (1350 bytes) seal operations in 1001717us (401310.9 ops/sec): 541.8 MB/s Did 97000 ChaCha20-Poly1305 (8192 bytes) seal operations in 1005394us (96479.6 ops/sec): 790.4 MB/s Did 2444000 ChaCha20-Poly1305-Old (16 bytes) seal operations in 1000089us (2443782.5 ops/sec): 39.1 MB/s Did 459000 ChaCha20-Poly1305-Old (1350 bytes) seal operations in 1000563us (458741.7 ops/sec): 619.3 MB/s Did 97000 ChaCha20-Poly1305-Old (8192 bytes) seal operations in 1007942us (96235.7 ops/sec): 788.4 MB/s Change-Id: I976da606dae062a776e0cc01229ec03a074035d1 Reviewed-on: https://boringssl-review.googlesource.com/7561 Reviewed-by: Steven Valdez <svaldez@google.com> Reviewed-by: David Benjamin <davidben@google.com> |
||
---|---|---|
.. | ||
aes | ||
asn1 | ||
base64 | ||
bio | ||
bn | ||
buf | ||
bytestring | ||
chacha | ||
cipher | ||
cmac | ||
conf | ||
curve25519 | ||
des | ||
dh | ||
digest | ||
dsa | ||
ec | ||
ecdh | ||
ecdsa | ||
engine | ||
err | ||
evp | ||
hkdf | ||
hmac | ||
lhash | ||
md4 | ||
md5 | ||
modes | ||
obj | ||
pem | ||
perlasm | ||
pkcs8 | ||
poly1305 | ||
rand | ||
rc4 | ||
rsa | ||
sha | ||
stack | ||
test | ||
x509 | ||
x509v3 | ||
CMakeLists.txt | ||
constant_time_test.c | ||
cpu-aarch64-linux.c | ||
cpu-arm-linux.c | ||
cpu-arm.c | ||
cpu-intel.c | ||
crypto.c | ||
directory_posix.c | ||
directory_win.c | ||
directory.h | ||
ex_data.c | ||
internal.h | ||
mem.c | ||
refcount_c11.c | ||
refcount_lock.c | ||
refcount_test.c | ||
thread_none.c | ||
thread_pthread.c | ||
thread_test.c | ||
thread_win.c | ||
thread.c | ||
time_support.c |