MCPcopy
hub / github.com/grpc/grpc-go / hkdfExpand

Function hkdfExpand

credentials/alts/internal/conn/aeadrekey.go:126–131  ·  view source on GitHub ↗

hkdfExpand computes the first 16 bytes of the HKDF-expand function defined in RFC5869.

(key, info []byte)

Source from the content-addressed store, hash-verified

124// hkdfExpand computes the first 16 bytes of the HKDF-expand function
125// defined in RFC5869.
126func hkdfExpand(key, info []byte) []byte {
127 mac := hmac.New(sha256.New, key)
128 mac.Write(info)
129 mac.Write([]byte{0x01}[:])
130 return mac.Sum(nil)[:aeadKeyLen]
131}

Callers 1

rekeyIfRequiredMethod · 0.85

Calls 1

WriteMethod · 0.65

Tested by

no test coverage detected