MCPcopy
hub / github.com/FiloSottile/age / streamKey

Function streamKey

primitives.go:65–72  ·  view source on GitHub ↗
(fileKey, nonce []byte)

Source from the content-addressed store, hash-verified

63}
64
65func streamKey(fileKey, nonce []byte) []byte {
66 h := hkdf.New(sha256.New, fileKey, nonce, []byte("payload"))
67 streamKey := make([]byte, chacha20poly1305.KeySize)
68 if _, err := io.ReadFull(h, streamKey); err != nil {
69 panic("age: internal error: failed to read from HKDF: " + err.Error())
70 }
71 return streamKey
72}

Callers 4

EncryptFunction · 0.70
EncryptReaderFunction · 0.70
DecryptFunction · 0.70
DecryptReaderAtFunction · 0.70

Calls 1

ErrorMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…