diff options
author | Jakob Unterwurzacher | 2016-06-15 23:30:44 +0200 |
---|---|---|
committer | Jakob Unterwurzacher | 2016-06-15 23:30:44 +0200 |
commit | 6c3f97399a01a2d8480b39978209099335efbf7d (patch) | |
tree | 097b34a37b5f62ebcfd7294d096b16f436c180f9 /internal/contentenc | |
parent | 09e88f31d1b4308bf82c7f4eb0dd83855ad67ffc (diff) |
Rename internal "toggledlog" package to "tlog"
tlog is used heavily everywhere and deserves a shorter name.
Renamed using sed magic, without any manual rework:
find * -type f -exec sed -i 's/toggledlog/tlog/g' {} +
Diffstat (limited to 'internal/contentenc')
-rw-r--r-- | internal/contentenc/content.go | 10 | ||||
-rw-r--r-- | internal/contentenc/offsets.go | 6 |
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 } |