]> Cypherpunks repositories - gostls13.git/commit
crypto/{cipher,tls,internal/cryptohw}: prioritise AES-GCM when hardware support is...
authorAdam Langley <agl@golang.org>
Mon, 7 Nov 2016 18:25:57 +0000 (10:25 -0800)
committerBrad Fitzpatrick <bradfitz@golang.org>
Mon, 7 Nov 2016 20:01:18 +0000 (20:01 +0000)
commita9ce0f96e1f2ab69ce3319c5a97c1d01beb9472c
tree3a680a8bdf563bdcc535384db7c89c4b52e5ee85
parent9e4a70e8fd3e6fed93fcd6159228b3a8ecae1d80
crypto/{cipher,tls,internal/cryptohw}: prioritise AES-GCM when hardware support is present.

Support for ChaCha20-Poly1305 ciphers was recently added to crypto/tls.
These ciphers are preferable in software, but they cannot beat hardware
support for AES-GCM, if present.

This change moves detection for hardware AES-GCM support into
cipher/internal/cipherhw so that it can be used from crypto/tls. Then,
when AES-GCM hardware is present, the AES-GCM cipher suites are
prioritised by default in crypto/tls. (Some servers, such as Google,
respect the client's preference between AES-GCM and ChaCha20-Poly1305.)

Fixes #17779.

Change-Id: I50de2be486f0b0b8052c4628d3e3205a1d54a646
Reviewed-on: https://go-review.googlesource.com/32871
Run-TryBot: Adam Langley <agl@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
12 files changed:
src/crypto/aes/asm_amd64.s
src/crypto/aes/asm_s390x.s
src/crypto/aes/cipher_amd64.go
src/crypto/aes/cipher_s390x.go
src/crypto/internal/cipherhw/asm_amd64.s [new file with mode: 0644]
src/crypto/internal/cipherhw/asm_s390x.s [new file with mode: 0644]
src/crypto/internal/cipherhw/cipherhw_amd64.go [new file with mode: 0644]
src/crypto/internal/cipherhw/cipherhw_s390x.go [new file with mode: 0644]
src/crypto/internal/cipherhw/doc.go [new file with mode: 0644]
src/crypto/internal/cipherhw/generic.go [new file with mode: 0644]
src/crypto/tls/common.go
src/go/build/deps_test.go