MCPcopy Create free account
hub / github.com/XTLS/REALITY / cipherSuite

Struct cipherSuite

cipher_suites.go:134–146  ·  view source on GitHub ↗

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.

Source from the content-addressed store, hash-verified

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.
134type 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
148var 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},

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected