aboutsummaryrefslogtreecommitdiff
path: root/internal
diff options
context:
space:
mode:
Diffstat (limited to 'internal')
-rw-r--r--internal/contentenc/content.go3
-rw-r--r--internal/cryptocore/cryptocore.go16
2 files changed, 19 insertions, 0 deletions
diff --git a/internal/contentenc/content.go b/internal/contentenc/content.go
index 747bb4c..e023492 100644
--- a/internal/contentenc/content.go
+++ b/internal/contentenc/content.go
@@ -73,6 +73,9 @@ type ContentEnc struct {
// New returns an initialized ContentEnc instance.
func New(cc *cryptocore.CryptoCore, plainBS uint64, forceDecode bool) *ContentEnc {
+ tlog.Debug.Printf("contentenc.New: plainBS=%d, forceDecode=%v",
+ plainBS, forceDecode)
+
if fuse.MAX_KERNEL_WRITE%plainBS != 0 {
log.Panicf("unaligned MAX_KERNEL_WRITE=%d", fuse.MAX_KERNEL_WRITE)
}
diff --git a/internal/cryptocore/cryptocore.go b/internal/cryptocore/cryptocore.go
index d66f390..9f5b9bd 100644
--- a/internal/cryptocore/cryptocore.go
+++ b/internal/cryptocore/cryptocore.go
@@ -36,6 +36,19 @@ const (
BackendAESSIV AEADTypeEnum = 5
)
+func (a AEADTypeEnum) String() string {
+ switch a {
+ case BackendOpenSSL:
+ return "BackendOpenSSL"
+ case BackendGoGCM:
+ return "BackendGoGCM"
+ case BackendAESSIV:
+ return "BackendAESSIV"
+ default:
+ return fmt.Sprintf("%d", a)
+ }
+}
+
// CryptoCore is the low level crypto implementation.
type CryptoCore struct {
// EME is used for filename encryption.
@@ -58,6 +71,9 @@ type CryptoCore struct {
// Note: "key" is either the scrypt hash of the password (when decrypting
// a config file) or the masterkey (when finally mounting the filesystem).
func New(key []byte, aeadType AEADTypeEnum, IVBitLen int, useHKDF bool, forceDecode bool) *CryptoCore {
+ tlog.Debug.Printf("cryptocore.New: key=%d bytes, aeadType=%v, IVBitLen=%d, useHKDF=%v, forceDecode=%v",
+ len(key), aeadType, IVBitLen, useHKDF, forceDecode)
+
if len(key) != KeyLen {
log.Panic(fmt.Sprintf("Unsupported key length %d", len(key)))
}