Skip to content

Commit e8e3598

Browse files
committed
-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: #607
1 parent c8996d2 commit e8e3598

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

init_dir.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import (
1414
"github.com/rfjakob/gocryptfs/v2/internal/fido2"
1515
"github.com/rfjakob/gocryptfs/v2/internal/nametransform"
1616
"github.com/rfjakob/gocryptfs/v2/internal/readpassword"
17+
"github.com/rfjakob/gocryptfs/v2/internal/stupidgcm"
1718
"github.com/rfjakob/gocryptfs/v2/internal/syscallcompat"
1819
"github.com/rfjakob/gocryptfs/v2/internal/tlog"
1920
)
@@ -67,6 +68,11 @@ func initDir(args *argContainer) {
6768
tlog.Fatal.Printf("Invalid cipherdir: %v", err)
6869
os.Exit(exitcodes.CipherDir)
6970
}
71+
if !args.xchacha && !stupidgcm.CpuHasAES() {
72+
tlog.Info.Printf(tlog.ColorYellow +
73+
"Notice: Your CPU does not have AES acceleration. Consider using -xchacha for better performance." +
74+
tlog.ColorReset)
75+
}
7076
}
7177
// Choose password for config file
7278
if len(args.extpass) == 0 && args.fido2 == "" {

0 commit comments

Comments
 (0)