aboutsummaryrefslogtreecommitdiff
path: root/internal/contentenc/intrablock.go
diff options
context:
space:
mode:
authorJakob Unterwurzacher2016-07-02 00:12:36 +0200
committerJakob Unterwurzacher2016-07-02 00:12:36 +0200
commit7b22b426b9f5e68a0ff51799e04f193dc74586d0 (patch)
treeba30788cce61ca58608d669b75b07296df9b9422 /internal/contentenc/intrablock.go
parentf2b4d57068d13b6dc3de2ccc6550675d11d34cfa (diff)
contentenc: rename PlaintextRange and CiphertextRange
The name could be misunderstood and actually caused a bug: doWrite used to always preallocate 4128 instead of the actual data length.
Diffstat (limited to 'internal/contentenc/intrablock.go')
-rw-r--r--internal/contentenc/intrablock.go14
1 files changed, 6 insertions, 8 deletions
diff --git a/internal/contentenc/intrablock.go b/internal/contentenc/intrablock.go
index 330b980..ec9562d 100644
--- a/internal/contentenc/intrablock.go
+++ b/internal/contentenc/intrablock.go
@@ -16,16 +16,14 @@ func (ib *intraBlock) IsPartial() bool {
return false
}
-// CiphertextRange - get byte range in ciphertext file corresponding to BlockNo
-// (complete block)
-func (ib *intraBlock) CiphertextRange() (offset uint64, length uint64) {
- return ib.fs.BlockNoToCipherOff(ib.BlockNo), ib.fs.cipherBS
+// BlockCipherOff returns the ciphertext offset corresponding to BlockNo
+func (ib *intraBlock) BlockCipherOff() (offset uint64) {
+ return ib.fs.BlockNoToCipherOff(ib.BlockNo)
}
-// PlaintextRange - get byte range in plaintext corresponding to BlockNo
-// (complete block)
-func (ib *intraBlock) PlaintextRange() (offset uint64, length uint64) {
- return ib.fs.BlockNoToPlainOff(ib.BlockNo), ib.fs.plainBS
+// BlockPlainOff returns the plaintext offset corresponding to BlockNo
+func (ib *intraBlock) BlockPlainOff() (offset uint64) {
+ return ib.fs.BlockNoToPlainOff(ib.BlockNo)
}
// CropBlock - crop a potentially larger plaintext block down to the relevant part