summaryrefslogtreecommitdiff
path: root/internal/contentenc
diff options
context:
space:
mode:
Diffstat (limited to 'internal/contentenc')
-rw-r--r--internal/contentenc/content.go10
-rw-r--r--internal/contentenc/offsets.go6
2 files changed, 8 insertions, 8 deletions
diff --git a/internal/contentenc/content.go b/internal/contentenc/content.go
index dd6aa26..5bac2a2 100644
--- a/internal/contentenc/content.go
+++ b/internal/contentenc/content.go
@@ -8,7 +8,7 @@ import (
"encoding/hex"
"errors"
- "github.com/rfjakob/gocryptfs/internal/toggledlog"
+ "github.com/rfjakob/gocryptfs/internal/tlog"
)
// DecryptBlocks - Decrypt a number of blocks
@@ -42,12 +42,12 @@ func (be *ContentEnc) DecryptBlock(ciphertext []byte, blockNo uint64, fileId []b
// All-zero block?
if bytes.Equal(ciphertext, be.allZeroBlock) {
- toggledlog.Debug.Printf("DecryptBlock: file hole encountered")
+ tlog.Debug.Printf("DecryptBlock: file hole encountered")
return make([]byte, be.plainBS), nil
}
if len(ciphertext) < be.cryptoCore.IVLen {
- toggledlog.Warn.Printf("DecryptBlock: Block is too short: %d bytes", len(ciphertext))
+ tlog.Warn.Printf("DecryptBlock: Block is too short: %d bytes", len(ciphertext))
return nil, errors.New("Block is too short")
}
@@ -64,8 +64,8 @@ func (be *ContentEnc) DecryptBlock(ciphertext []byte, blockNo uint64, fileId []b
plaintext, err := be.cryptoCore.Gcm.Open(plaintext, nonce, ciphertext, aData)
if err != nil {
- toggledlog.Warn.Printf("DecryptBlock: %s, len=%d", err.Error(), len(ciphertextOrig))
- toggledlog.Debug.Println(hex.Dump(ciphertextOrig))
+ tlog.Warn.Printf("DecryptBlock: %s, len=%d", err.Error(), len(ciphertextOrig))
+ tlog.Debug.Println(hex.Dump(ciphertextOrig))
return nil, err
}
diff --git a/internal/contentenc/offsets.go b/internal/contentenc/offsets.go
index cfb1c69..da0551a 100644
--- a/internal/contentenc/offsets.go
+++ b/internal/contentenc/offsets.go
@@ -1,7 +1,7 @@
package contentenc
import (
- "github.com/rfjakob/gocryptfs/internal/toggledlog"
+ "github.com/rfjakob/gocryptfs/internal/tlog"
)
// Contentenc methods that translate offsets between ciphertext and plaintext
@@ -35,12 +35,12 @@ func (be *ContentEnc) CipherSizeToPlainSize(cipherSize uint64) uint64 {
}
if cipherSize == HEADER_LEN {
- toggledlog.Warn.Printf("cipherSize %d == header size: interrupted write?\n", cipherSize)
+ tlog.Warn.Printf("cipherSize %d == header size: interrupted write?\n", cipherSize)
return 0
}
if cipherSize < HEADER_LEN {
- toggledlog.Warn.Printf("cipherSize %d < header size %d: corrupt file\n", cipherSize, HEADER_LEN)
+ tlog.Warn.Printf("cipherSize %d < header size %d: corrupt file\n", cipherSize, HEADER_LEN)
return 0
}