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

Function aeadAESGCMTLS13

cipher_suites.go:537–554  ·  view source on GitHub ↗

aeadAESGCMTLS13 should be an internal detail, but widely used packages access it using linkname. Notable members of the hall of shame include: - github.com/xtls/xray-core - github.com/v2fly/v2ray-core Do not remove or change the type signature. See go.dev/issue/67401. go:linkname aeadAESGCMTLS13

(key, nonceMask []byte)

Source from the content-addressed store, hash-verified

535//
536//go:linkname aeadAESGCMTLS13
537func aeadAESGCMTLS13(key, nonceMask []byte) aead {
538 if len(nonceMask) != aeadNonceLength {
539 panic("tls: internal error: wrong nonce length")
540 }
541 aes, err := aes.NewCipher(key)
542 if err != nil {
543 panic(err)
544 }
545 //aead, err := gcm.NewGCMForTLS13(aes)
546 aead, err := cipher.NewGCM(aes)
547 if err != nil {
548 panic(err)
549 }
550
551 ret := &xorNonceAEAD{aead: aead}
552 copy(ret.nonceMask[:], nonceMask)
553 return ret
554}
555
556func aeadChaCha20Poly1305(key, nonceMask []byte) aead {
557 if len(nonceMask) != aeadNonceLength {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…