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

Method deriveSecret

key_schedule.go:54–59  ·  view source on GitHub ↗

deriveSecret implements Derive-Secret from RFC 8446, Section 7.1.

(secret []byte, label string, transcript hash.Hash)

Source from the content-addressed store, hash-verified

52
53// deriveSecret implements Derive-Secret from RFC 8446, Section 7.1.
54func (c *cipherSuiteTLS13) deriveSecret(secret []byte, label string, transcript hash.Hash) []byte {
55 if transcript == nil {
56 transcript = c.hash.New()
57 }
58 return c.expandLabel(secret, label, transcript.Sum(nil), c.hash.Size())
59}
60
61// extract implements HKDF-Extract with the cipher suite hash.
62func (c *cipherSuiteTLS13) extract(newSecret, currentSecret []byte) []byte {

Callers 9

exportKeyingMaterialMethod · 0.95
loadSessionMethod · 0.80
readServerFinishedMethod · 0.80
sendClientFinishedMethod · 0.80
checkForResumptionMethod · 0.80
sendServerParametersMethod · 0.80
sendServerFinishedMethod · 0.80
sendSessionTicketsMethod · 0.80

Calls 3

expandLabelMethod · 0.95
SizeMethod · 0.80
SumMethod · 0.45

Tested by

no test coverage detected