MCPcopy Create free account
hub / github.com/XTLS/Go / prf12

Function prf12

prf.go:67–75  ·  view source on GitHub ↗

prf12 implements the TLS 1.2 pseudo-random function, as defined in RFC 5246, Section 5.

(hashFunc func() hash.Hash)

Source from the content-addressed store, hash-verified

65
66// prf12 implements the TLS 1.2 pseudo-random function, as defined in RFC 5246, Section 5.
67func prf12(hashFunc func() hash.Hash) func(result, secret, label, seed []byte) {
68 return func(result, secret, label, seed []byte) {
69 labelAndSeed := make([]byte, len(label)+len(seed))
70 copy(labelAndSeed, label)
71 copy(labelAndSeed[len(label):], seed)
72
73 pHash(result, secret, labelAndSeed, hashFunc)
74 }
75}
76
77const (
78 masterSecretLength = 48 // Length of a master secret in TLS 1.1.

Callers 1

prfAndHashForVersionFunction · 0.85

Calls 1

pHashFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…