Skip to content

Commit

Permalink
stupidgcm: prefer Go stdlib over OpenSSL on Apple M1
Browse files Browse the repository at this point in the history
  • Loading branch information
rfjakob committed May 26, 2021
1 parent 09870bf commit 1d2ac1e
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion internal/stupidgcm/prefer.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package stupidgcm

import (
"runtime"

"golang.org/x/sys/cpu"
)

Expand All @@ -23,6 +25,11 @@ func PreferOpenSSL() bool {
// Go stdlib is probably faster
return false
}
// Openssl is probably faster
// On the Apple M1, Go stdlib is faster than OpenSSL, despite cpu.ARM64.HasAES
// reading false: https://github.com/rfjakob/gocryptfs/issues/556#issuecomment-848079309
if runtime.GOOS == "darwin" && runtime.GOARCH == "arm64" {
return false
}
// OpenSSL is probably faster
return true
}

0 comments on commit 1d2ac1e

Please sign in to comment.