summaryrefslogtreecommitdiff
path: root/cryptfs/cryptfs_content.go
diff options
context:
space:
mode:
Diffstat (limited to 'cryptfs/cryptfs_content.go')
-rw-r--r--cryptfs/cryptfs_content.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/cryptfs/cryptfs_content.go b/cryptfs/cryptfs_content.go
index a903e02..ab5ec78 100644
--- a/cryptfs/cryptfs_content.go
+++ b/cryptfs/cryptfs_content.go
@@ -219,3 +219,13 @@ func (be *CryptFS) MergeBlocks(oldData []byte, newData []byte, offset int) []byt
}
return out[0:outLen]
}
+
+// Get the block number at plain-text offset
+func (be *CryptFS) BlockNoPlainOff(plainOffset uint64) uint64 {
+ return plainOffset / be.plainBS
+}
+
+// Get the block number at ciphter-text offset
+func (be *CryptFS) BlockNoCipherOff(cipherOffset uint64) uint64 {
+ return cipherOffset / be.cipherBS
+}