summaryrefslogtreecommitdiff
path: root/init_dir.go
diff options
context:
space:
mode:
authorJakob Unterwurzacher2021-09-28 17:43:36 +0200
committerJakob Unterwurzacher2021-09-28 18:09:31 +0200
commite8e35982845f36e714b915350eaf6855487aa0e8 (patch)
treeb06f7d5f0b7d664af05f6f0c0a07552cc59f10dc /init_dir.go
parentc8996d2664d7d1cbce310db3425cc15c9ad26b08 (diff)
-init: suggest xchacha if we don't have AES accel
Example on Raspberry Pi 4: $ ./gocryptfs/gocryptfs -init $(mktemp -d) Notice: Your CPU does not have AES acceleration. Consider using -xchacha for better performance. Choose a password for protecting your files. Password: https://github.com/rfjakob/gocryptfs/issues/607
Diffstat (limited to 'init_dir.go')
-rw-r--r--init_dir.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/init_dir.go b/init_dir.go
index 00fb390..ab4c3df 100644
--- a/init_dir.go
+++ b/init_dir.go
@@ -14,6 +14,7 @@ import (
"github.com/rfjakob/gocryptfs/v2/internal/fido2"
"github.com/rfjakob/gocryptfs/v2/internal/nametransform"
"github.com/rfjakob/gocryptfs/v2/internal/readpassword"
+ "github.com/rfjakob/gocryptfs/v2/internal/stupidgcm"
"github.com/rfjakob/gocryptfs/v2/internal/syscallcompat"
"github.com/rfjakob/gocryptfs/v2/internal/tlog"
)
@@ -67,6 +68,11 @@ func initDir(args *argContainer) {
tlog.Fatal.Printf("Invalid cipherdir: %v", err)
os.Exit(exitcodes.CipherDir)
}
+ if !args.xchacha && !stupidgcm.CpuHasAES() {
+ tlog.Info.Printf(tlog.ColorYellow +
+ "Notice: Your CPU does not have AES acceleration. Consider using -xchacha for better performance." +
+ tlog.ColorReset)
+ }
}
// Choose password for config file
if len(args.extpass) == 0 && args.fido2 == "" {