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

Function streamKey

testkit_test.go:408–415  ·  view source on GitHub ↗
(fileKey, nonce []byte)

Source from the content-addressed store, hash-verified

406}
407
408func streamKey(fileKey, nonce []byte) []byte {
409 h := hkdf.New(sha256.New, fileKey, nonce, []byte("payload"))
410 streamKey := make([]byte, chacha20poly1305.KeySize)
411 if _, err := io.ReadFull(h, streamKey); err != nil {
412 panic("age: internal error: failed to read from HKDF: " + err.Error())
413 }
414 return streamKey
415}

Callers 1

testVectorRoundTripFunction · 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…