ktls_prf.go 1.1 KB

123456789101112131415161718192021222324
  1. // Copyright 2009 The Go Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style
  3. // license that can be found in the LICENSE file.
  4. //go:build linux && go1.25 && badlinkname
  5. package ktls
  6. import "unsafe"
  7. //go:linkname cipherSuiteByID github.com/metacubex/utls.cipherSuiteByID
  8. func cipherSuiteByID(id uint16) unsafe.Pointer
  9. //go:linkname keysFromMasterSecret github.com/metacubex/utls.keysFromMasterSecret
  10. func keysFromMasterSecret(version uint16, suite unsafe.Pointer, masterSecret, clientRandom, serverRandom []byte, macLen, keyLen, ivLen int) (clientMAC, serverMAC, clientKey, serverKey, clientIV, serverIV []byte)
  11. //go:linkname cipherSuiteTLS13ByID github.com/metacubex/utls.cipherSuiteTLS13ByID
  12. func cipherSuiteTLS13ByID(id uint16) unsafe.Pointer
  13. //go:linkname nextTrafficSecret github.com/metacubex/utls.(*cipherSuiteTLS13).nextTrafficSecret
  14. func nextTrafficSecret(cs unsafe.Pointer, trafficSecret []byte) []byte
  15. //go:linkname trafficKey github.com/metacubex/utls.(*cipherSuiteTLS13).trafficKey
  16. func trafficKey(cs unsafe.Pointer, trafficSecret []byte) (key, iv []byte)