• Adam Langley's avatar
    crypto/{cipher,tls,internal/cryptohw}: prioritise AES-GCM when hardware support is present. · a9ce0f96
    Adam Langley authored
    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: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
    TryBot-Result: Gobot Gobot <gobot@golang.org>
    a9ce0f96
cipher_s390x.go 2.08 KB