A cipherSuite is a TLS 1.0–1.2 cipher suite, and defines the key exchange mechanism, as well as the cipher+MAC pair or the AEAD.
| 132 | // A cipherSuite is a TLS 1.0–1.2 cipher suite, and defines the key exchange |
| 133 | // mechanism, as well as the cipher+MAC pair or the AEAD. |
| 134 | type cipherSuite struct { |
| 135 | id uint16 |
| 136 | // the lengths, in bytes, of the key material needed for each component. |
| 137 | keyLen int |
| 138 | macLen int |
| 139 | ivLen int |
| 140 | ka func(version uint16) keyAgreement |
| 141 | // flags is a bitmask of the suite* values, above. |
| 142 | flags int |
| 143 | cipher func(key, iv []byte, isRead bool) any |
| 144 | mac func(key []byte) hash.Hash |
| 145 | aead func(key, fixedNonce []byte) aead |
| 146 | } |
| 147 | |
| 148 | var cipherSuites = []*cipherSuite{ // TODO: replace with a map, since the order doesn't matter. |
| 149 | {TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305, 32, 0, 12, ecdheRSAKA, suiteECDHE | suiteTLS12, nil, nil, aeadChaCha20Poly1305}, |
nothing calls this directly
no outgoing calls
no test coverage detected