isAESGCMPreferred returns whether we have hardware support for AES-GCM, and the first known cipher in the peer's preference list is an AES-GCM cipher, implying the peer also has hardware support for it.
(ciphers []uint16)
| 388 | // first known cipher in the peer's preference list is an AES-GCM cipher, |
| 389 | // implying the peer also has hardware support for it. |
| 390 | func isAESGCMPreferred(ciphers []uint16) bool { |
| 391 | if !hasAESGCMHardwareSupport { |
| 392 | return false |
| 393 | } |
| 394 | for _, cID := range ciphers { |
| 395 | if c := cipherSuiteByID(cID); c != nil { |
| 396 | return aesgcmCiphers[cID] |
| 397 | } |
| 398 | if c := cipherSuiteTLS13ByID(cID); c != nil { |
| 399 | return aesgcmCiphers[cID] |
| 400 | } |
| 401 | } |
| 402 | return false |
| 403 | } |
| 404 | |
| 405 | func cipherRC4(key, iv []byte, isRead bool) any { |
| 406 | cipher, _ := rc4.NewCipher(key) |
no test coverage detected
searching dependent graphs…