From 7b22b426b9f5e68a0ff51799e04f193dc74586d0 Mon Sep 17 00:00:00 2001 From: Jakob Unterwurzacher Date: Sat, 2 Jul 2016 00:12:36 +0200 Subject: 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. --- internal/contentenc/content.go | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'internal/contentenc/content.go') 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) -- cgit v1.2.3