mihomo/transport/vless/encryption/client_test.go
2025-12-17 17:35:58 +08:00

20 lines
551 B
Go

package encryption
import (
"fmt"
"runtime"
"testing"
)
func TestHasAESGCMHardwareSupport(t *testing.T) {
fmt.Println("HasAESGCMHardwareSupport:", HasAESGCMHardwareSupport)
if runtime.GOARCH == "arm64" && runtime.GOOS == "darwin" {
// It should be supported starting from Apple Silicon M1
// https://github.com/golang/go/blob/go1.25.0/src/internal/cpu/cpu_arm64_darwin.go#L26-L30
if !HasAESGCMHardwareSupport {
t.Errorf("For ARM64 Darwin platforms (excluding iOS), AES GCM hardware acceleration should always be available.")
}
}
}