MCPcopy Index your code
hub / github.com/syncthing/syncthing / encryptBlockHash

Function encryptBlockHash

lib/protocol/encryption.go:379–387  ·  view source on GitHub ↗
(hash []byte, offset int64, fileKey *[keySize]byte)

Source from the content-addressed store, hash-verified

377}
378
379func encryptBlockHash(hash []byte, offset int64, fileKey *[keySize]byte) []byte {
380 // The offset goes into the encrypted block hash as additional data,
381 // essentially mixing in with the nonce. This means a block hash
382 // remains stable for the same data at the same offset, but doesn't
383 // reveal the existence of identical data blocks at other offsets.
384 var additional [8]byte
385 binary.BigEndian.PutUint64(additional[:], uint64(offset))
386 return encryptDeterministic(hash, fileKey, additional[:])
387}
388
389func decryptFileInfos(keyGen *KeyGenerator, files []FileInfo, folderKey *[keySize]byte) error {
390 for i, fi := range files {

Callers 2

RequestMethod · 0.85
encryptFileInfoFunction · 0.85

Calls 1

encryptDeterministicFunction · 0.85

Tested by

no test coverage detected