MCPcopy Create free account
hub / github.com/XTLS/Go / aesgcmPreferred

Function aesgcmPreferred

cipher_suites.go:389–399  ·  view source on GitHub ↗

aesgcmPreferred returns whether the first known cipher in the preference list is an AES-GCM cipher, implying the peer has hardware support for it.

(ciphers []uint16)

Source from the content-addressed store, hash-verified

387// aesgcmPreferred returns whether the first known cipher in the preference list
388// is an AES-GCM cipher, implying the peer has hardware support for it.
389func aesgcmPreferred(ciphers []uint16) bool {
390 for _, cID := range ciphers {
391 if c := cipherSuiteByID(cID); c != nil {
392 return aesgcmCiphers[cID]
393 }
394 if c := cipherSuiteTLS13ByID(cID); c != nil {
395 return aesgcmCiphers[cID]
396 }
397 }
398 return false
399}
400
401func cipherRC4(key, iv []byte, isRead bool) any {
402 cipher, _ := rc4.NewCipher(key)

Callers 2

processClientHelloMethod · 0.85
pickCipherSuiteMethod · 0.85

Calls 2

cipherSuiteByIDFunction · 0.85
cipherSuiteTLS13ByIDFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…