aboutsummaryrefslogtreecommitdiff
path: root/internal/contentenc/content.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/content.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/content.go')
-rw-r--r--internal/contentenc/content.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/internal/contentenc/content.go b/internal/contentenc/content.go
index 2298c5e..6ac766f 100644
--- a/internal/contentenc/content.go
+++ b/internal/contentenc/content.go
@@ -40,10 +40,16 @@ func New(cc *cryptocore.CryptoCore, plainBS uint64) *ContentEnc {
}
}
+// PlainBS returns the plaintext block size
func (be *ContentEnc) PlainBS() uint64 {
return be.plainBS
}
+// CipherBS returns the ciphertext block size
+func (be *ContentEnc) CipherBS() uint64 {
+ return be.cipherBS
+}
+
// DecryptBlocks - Decrypt a number of blocks
func (be *ContentEnc) DecryptBlocks(ciphertext []byte, firstBlockNo uint64, fileId []byte) ([]byte, error) {
cBuf := bytes.NewBuffer(ciphertext)