MCPcopy Index your code
hub / github.com/XTLS/Go / prfAndHashForVersion

Function prfAndHashForVersion

prf.go:87–99  ·  view source on GitHub ↗
(version uint16, suite *cipherSuite)

Source from the content-addressed store, hash-verified

85var serverFinishedLabel = []byte("server finished")
86
87func prfAndHashForVersion(version uint16, suite *cipherSuite) (func(result, secret, label, seed []byte), crypto.Hash) {
88 switch version {
89 case VersionTLS10, VersionTLS11:
90 return prf10, crypto.Hash(0)
91 case VersionTLS12:
92 if suite.flags&suiteSHA384 != 0 {
93 return prf12(sha512.New384), crypto.SHA384
94 }
95 return prf12(sha256.New), crypto.SHA256
96 default:
97 panic("unknown version")
98 }
99}
100
101func prfForVersion(version uint16, suite *cipherSuite) func(result, secret, label, seed []byte) {
102 prf, _ := prfAndHashForVersion(version, suite)

Callers 2

prfForVersionFunction · 0.85
newFinishedHashFunction · 0.85

Calls 1

prf12Function · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…