check cpu sm3/4 support

This commit is contained in:
Emman 2021-12-21 15:57:43 +08:00
parent dcb255ad47
commit 73e8e0f0e5

View File

@ -9,6 +9,8 @@ import (
"hash" "hash"
"io" "io"
"testing" "testing"
"golang.org/x/sys/cpu"
) )
type sm3Test struct { type sm3Test struct {
@ -108,6 +110,7 @@ func TestBlockSize(t *testing.T) {
if got := c.BlockSize(); got != BlockSize { if got := c.BlockSize(); got != BlockSize {
t.Errorf("BlockSize = %d want %d", got, BlockSize) t.Errorf("BlockSize = %d want %d", got, BlockSize)
} }
fmt.Printf("ARM64 has sm3 %v ? has sm4 %v ?\n", cpu.ARM64.HasSM3, cpu.ARM64.HasSM4)
} }
var bench = New() var bench = New()