aboutsummaryrefslogtreecommitdiff
path: root/internal/nametransform/names.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/nametransform/names.go')
-rw-r--r--internal/nametransform/names.go6
1 files changed, 4 insertions, 2 deletions
diff --git a/internal/nametransform/names.go b/internal/nametransform/names.go
index 4850138..05ae75e 100644
--- a/internal/nametransform/names.go
+++ b/internal/nametransform/names.go
@@ -1,4 +1,4 @@
-// Package namtransforms encrypts and decrypts filenames.
+// Package nametransform encrypts and decrypts filenames.
package nametransform
import (
@@ -12,12 +12,14 @@ import (
"github.com/rfjakob/gocryptfs/internal/tlog"
)
+// NameTransform is used to transform filenames.
type NameTransform struct {
cryptoCore *cryptocore.CryptoCore
longNames bool
DirIVCache dirIVCache
}
+// New returns a new NameTransform instance.
func New(c *cryptocore.CryptoCore, longNames bool) *NameTransform {
return &NameTransform{
cryptoCore: c,
@@ -51,7 +53,7 @@ func (n *NameTransform) DecryptName(cipherName string, iv []byte) (string, error
return plain, err
}
-// encryptName - encrypt "plainName", return base64-encoded "cipherName64".
+// EncryptName encrypts "plainName", returns a base64-encoded "cipherName64".
// Used internally by EncryptPathDirIV().
// The encryption is either CBC or EME, depending on "useEME".
//