cipher_suite.go 632 B

1234567891011121314151617181920212223
  1. package quic
  2. import (
  3. "crypto"
  4. "crypto/cipher"
  5. _ "crypto/tls"
  6. _ "unsafe"
  7. )
  8. // copied from github.com/quic-go/quic-go/internal/qtls/cipher_suite_go121.go
  9. type cipherSuiteTLS13 struct {
  10. ID uint16
  11. KeyLen int
  12. AEAD func(key, fixedNonce []byte) cipher.AEAD
  13. Hash crypto.Hash
  14. }
  15. // 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.
  16. // So we can user go:linkname to implement the same feature.
  17. //go:linkname aeadAESGCMTLS13 crypto/tls.aeadAESGCMTLS13
  18. func aeadAESGCMTLS13(key, nonceMask []byte) cipher.AEAD