MCPcopy
hub / github.com/XTLS/REALITY / prfAndHashForVersion

Function prfAndHashForVersion

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

Source from the content-addressed store, hash-verified

89const serverFinishedLabel = "server finished"
90
91func prfAndHashForVersion(version uint16, suite *cipherSuite) (prfFunc, crypto.Hash) {
92 switch version {
93 case VersionTLS10, VersionTLS11:
94 return prf10, crypto.Hash(0)
95 case VersionTLS12:
96 if suite.flags&suiteSHA384 != 0 {
97 return prf12(sha512.New384), crypto.SHA384
98 }
99 return prf12(sha256.New), crypto.SHA256
100 default:
101 panic("unknown version")
102 }
103}
104
105func prfForVersion(version uint16, suite *cipherSuite) prfFunc {
106 prf, _ := prfAndHashForVersion(version, suite)

Callers 3

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…