Fork of the Go standard TLS library, providing low-level access to the ClientHello for mimicry purposes.
Find a file
Vlad Krasnov 6823718107 crypto/aes: implement AES-GCM AEAD for arm64
Use the dedicated AES* and PMULL* instructions to accelerate AES-GCM

name              old time/op    new time/op      delta
AESGCMSeal1K-46     12.1µs ± 0%       0.9µs ± 0%    -92.66%  (p=0.000 n=9+10)
AESGCMOpen1K-46     12.1µs ± 0%       0.9µs ± 0%    -92.43%  (p=0.000 n=10+10)
AESGCMSign8K-46     58.6µs ± 0%       2.1µs ± 0%    -96.41%  (p=0.000 n=9+8)
AESGCMSeal8K-46     92.8µs ± 0%       5.7µs ± 0%    -93.86%  (p=0.000 n=9+9)
AESGCMOpen8K-46     92.9µs ± 0%       5.7µs ± 0%    -93.84%  (p=0.000 n=8+9)

name              old speed      new speed        delta
AESGCMSeal1K-46   84.7MB/s ± 0%  1153.4MB/s ± 0%  +1262.21%  (p=0.000 n=9+10)
AESGCMOpen1K-46   84.4MB/s ± 0%  1115.2MB/s ± 0%  +1220.53%  (p=0.000 n=10+10)
AESGCMSign8K-46    140MB/s ± 0%    3894MB/s ± 0%  +2687.50%  (p=0.000 n=9+10)
AESGCMSeal8K-46   88.2MB/s ± 0%  1437.5MB/s ± 0%  +1529.30%  (p=0.000 n=9+9)
AESGCMOpen8K-46   88.2MB/s ± 0%  1430.5MB/s ± 0%  +1522.01%  (p=0.000 n=8+9)

This change mirrors the current amd64 implementation, and provides optimal performance
on a range of arm64 processors including Centriq 2400 and Apple A12. By and large it is
implicitly tested by the robustness of the already existing amd64 implementation.

The implementation interleaves GHASH with CTR mode to achieve the highest possible
throughput, it also aggregates GHASH with a factor of 8, to decrease the cost of the
reduction step.

Even thought there is a significant amount of assembly, the code reuses the go
code for the amd64 implementation, so there is little additional go code.

Since AES-GCM is critical for performance of all web servers, this change is
required to level the playfield for arm64 CPUs, where amd64 currently enjoys an
unfair advantage.

Ideally both amd64 and arm64 codepaths could be replaced by hypothetical AES and
CLMUL intrinsics, with a few additional vector instructions.

Fixes #18498
Fixes #19840

Change-Id: Icc57b868cd1f67ac695c1ac163a8e215f74c7910
Reviewed-on: https://go-review.googlesource.com/107298
Run-TryBot: Vlad Krasnov <vlad@cloudflare.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2018-07-20 03:30:04 +00:00
testdata crypto/tls: add examples for [Load]X509KeyPair 2018-04-30 17:25:27 +00:00
alert.go crypto/tls: switch to OpenSSL 1.1.0 for test data. 2016-10-12 17:03:46 +00:00
auth.go crypto/tls: add RSASSA-PSS support for handshake messages 2018-06-27 23:08:06 +00:00
auth_test.go crypto/tls: add RSASSA-PSS support for handshake messages 2018-06-27 23:08:06 +00:00
cipher_suites.go crypto/tls: add RSASSA-PSS support for handshake messages 2018-06-27 23:08:06 +00:00
common.go crypto/aes: implement AES-GCM AEAD for arm64 2018-07-20 03:30:04 +00:00
conn.go all: update comment URLs from HTTP to HTTPS, where possible 2018-06-01 21:52:00 +00:00
conn_test.go crypto/tls: fix first byte test for 255 CBC padding bytes 2017-10-06 18:07:04 +00:00
example_test.go crypto/tls: add examples for [Load]X509KeyPair 2018-04-30 17:25:27 +00:00
generate_cert.go crypto/tls: handle errors in generate_cert.go 2018-02-13 18:14:27 +00:00
handshake_client.go crypto/tls: add RSASSA-PSS support for handshake messages 2018-06-27 23:08:06 +00:00
handshake_client_test.go crypto/tls: add RSASSA-PSS support for handshake messages 2018-06-27 23:08:06 +00:00
handshake_messages.go all: update comment URLs from HTTP to HTTPS, where possible 2018-06-01 21:52:00 +00:00
handshake_messages_test.go archive/zip, crypto/tls: use rand.Read instead of casting ints to bytes 2017-11-01 05:51:30 +00:00
handshake_server.go crypto/tls: consolidate signatures handling in SKE and CV 2018-06-20 17:15:50 +00:00
handshake_server_test.go go/printer, gofmt: tuned table alignment for better results 2018-04-04 13:39:34 -07:00
handshake_test.go crypto/tls: advertise support for SHA-512 signatures in 1.2 2017-11-08 22:39:36 +00:00
key_agreement.go crypto/tls: add RSASSA-PSS support for handshake messages 2018-06-27 23:08:06 +00:00
prf.go crypto/tls: add RSASSA-PSS support for handshake messages 2018-06-27 23:08:06 +00:00
prf_test.go crypto/tls: support keying material export 2018-03-22 18:48:49 +00:00
ticket.go crypto/tls: minor refactors for readability 2016-03-14 21:17:37 +00:00
tls.go crypto/tls: parse certificate first in X509KeyPair to get better errors 2018-03-27 21:47:54 +00:00
tls_test.go crypto/tls: limit number of consecutive warning alerts 2017-11-08 23:18:52 +00:00