mirror of
https://github.com/refraction-networking/utls.git
synced 2025-04-03 20:17:36 +03:00
[dev.boringcrypto] all: merge master into dev.boringcrypto
Conflicts due to crypto/internal/cipherhw removal: src/crypto/aes/cipher_amd64.go src/crypto/internal/cipherhw/cipherhw_amd64.go src/go/build/deps_test.go This removes the AESGCMSupport patch, as there is no equivalent place for it. The logic will be added back in the next change. Change-Id: I8169069ff732b6cd0b56279c073cf5e0dd36959d
This commit is contained in:
commit
7007fbaa33
1 changed files with 18 additions and 2 deletions
20
common.go
20
common.go
|
@ -7,12 +7,12 @@ package tls
|
|||
import (
|
||||
"container/list"
|
||||
"crypto"
|
||||
"crypto/internal/cipherhw"
|
||||
"crypto/rand"
|
||||
"crypto/sha512"
|
||||
"crypto/x509"
|
||||
"errors"
|
||||
"fmt"
|
||||
"internal/cpu"
|
||||
"io"
|
||||
"math/big"
|
||||
"net"
|
||||
|
@ -929,7 +929,23 @@ func defaultCipherSuites() []uint16 {
|
|||
|
||||
func initDefaultCipherSuites() {
|
||||
var topCipherSuites []uint16
|
||||
if cipherhw.AESGCMSupport() {
|
||||
|
||||
// Check the cpu flags for each platform that has optimized GCM implementations.
|
||||
// Worst case, these variables will just all be false
|
||||
hasGCMAsmAMD64 := cpu.X86.HasAES && cpu.X86.HasPCLMULQDQ
|
||||
|
||||
// TODO: enable the arm64 HasAES && HasPMULL feature check after the
|
||||
// optimized AES-GCM implementation for arm64 is merged (CL 107298).
|
||||
// This is explicitly set to false for now to prevent misprioritization
|
||||
// of AES-GCM based cipher suites, which will be slower than chacha20-poly1305
|
||||
hasGCMAsmARM64 := false
|
||||
// hasGCMAsmARM64 := cpu.ARM64.HasAES && cpu.ARM64.HasPMULL
|
||||
|
||||
hasGCMAsmS390X := cpu.S390X.HasKM && (cpu.S390X.HasKMA || (cpu.S390X.HasKMCTR && cpu.S390X.HasKIMD))
|
||||
|
||||
hasGCMAsm := hasGCMAsmAMD64 || hasGCMAsmARM64 || hasGCMAsmS390X
|
||||
|
||||
if hasGCMAsm {
|
||||
// If AES-GCM hardware is provided then prioritise AES-GCM
|
||||
// cipher suites.
|
||||
topCipherSuites = []uint16{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue