github.com/v2fly/v2ray-core/v5@v5.16.2-0.20240507031116-8191faa6e095/common/protocol/quic/cipher_suite.go (about)

     1  package quic
     2  
     3  import (
     4  	"crypto"
     5  	"crypto/cipher"
     6  	_ "crypto/tls"
     7  	_ "unsafe"
     8  )
     9  
    10  // copied from github.com/quic-go/quic-go/internal/qtls/cipher_suite_go121.go
    11  
    12  type cipherSuiteTLS13 struct {
    13  	ID     uint16
    14  	KeyLen int
    15  	AEAD   func(key, fixedNonce []byte) cipher.AEAD
    16  	Hash   crypto.Hash
    17  }
    18  
    19  // github.com/quic-go/quic-go/internal/handshake/cipher_suite.go describes these cipher suite implementations are copied from the standard library crypto/tls package.
    20  // So we can user go:linkname to implement the same feature.
    21  
    22  //go:linkname aeadAESGCMTLS13 crypto/tls.aeadAESGCMTLS13
    23  func aeadAESGCMTLS13(key, nonceMask []byte) cipher.AEAD