MCPcopy
hub / github.com/dgraph-io/dgraph / encrypt

Function encrypt

x/log_writer.go:175–183  ·  view source on GitHub ↗
(key, iv, src []byte)

Source from the content-addressed store, hash-verified

173}
174
175func encrypt(key, iv, src []byte) ([]byte, error) {
176 ivCopy := make([]byte, 16)
177 copy(ivCopy, iv[:])
178 cipher, err := y.XORBlockAllocate(src, key, ivCopy)
179 if err != nil {
180 return nil, err
181 }
182 return cipher, nil
183}
184
185// used to verify client has correct key and can decrypt audit log header
186func decrypt(key, iv, src []byte) ([]byte, error) {

Callers 2

WriteMethod · 0.85
openMethod · 0.85

Calls 1

copyFunction · 0.85

Tested by

no test coverage detected