Use go:linkname in qtls_go118.go

Once and for all, whatever
This commit is contained in:
RPRX 2023-02-04 21:27:13 +08:00 committed by GitHub
parent fa7300e910
commit 00c9576118
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 10 deletions

View file

@ -1,16 +1,18 @@
package quic
import (
"crypto"
"crypto/cipher"
"github.com/quic-go/qtls-go1-20"
_ "crypto/tls"
_ "unsafe"
)
type (
// A CipherSuiteTLS13 is a cipher suite for TLS 1.3
CipherSuiteTLS13 = qtls.CipherSuiteTLS13
)
func AEADAESGCMTLS13(key, fixedNonce []byte) cipher.AEAD {
return qtls.AEADAESGCMTLS13(key, fixedNonce)
type CipherSuiteTLS13 struct {
ID uint16
KeyLen int
AEAD func(key, fixedNonce []byte) cipher.AEAD
Hash crypto.Hash
}
//go:linkname AEADAESGCMTLS13 crypto/tls.aeadAESGCMTLS13
func AEADAESGCMTLS13(key, nonceMask []byte) cipher.AEAD