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)
| 535 | // |
| 536 | //go:linkname aeadAESGCMTLS13 |
| 537 | func 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 | |
| 556 | func aeadChaCha20Poly1305(key, nonceMask []byte) aead { |
| 557 | if len(nonceMask) != aeadNonceLength { |
nothing calls this directly
no outgoing calls
no test coverage detected
searching dependent graphs…