(hash []byte, offset int64, fileKey *[keySize]byte)
| 377 | } |
| 378 | |
| 379 | func 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 | |
| 389 | func decryptFileInfos(keyGen *KeyGenerator, files []FileInfo, folderKey *[keySize]byte) error { |
| 390 | for i, fi := range files { |
no test coverage detected