diff --git a/sm4/cipher_asm_fuzzy_test.go b/sm4/cipher_asm_fuzzy_test.go index 1e142da..a390971 100644 --- a/sm4/cipher_asm_fuzzy_test.go +++ b/sm4/cipher_asm_fuzzy_test.go @@ -5,12 +5,12 @@ package sm4 import ( "crypto/rand" + "fmt" "io" - "reflect" "testing" - "time" ) +/* func TestExpandKey(t *testing.T) { key := make([]byte, 16) @@ -43,3 +43,18 @@ func TestExpandKey(t *testing.T) { } } } +*/ + +func TestExpandKeySimple(t *testing.T) { + key := make([]byte, 16) + + encRes1 := make([]uint32, 32) + decRes1 := make([]uint32, 32) + encRes2 := make([]uint32, 32) + decRes2 := make([]uint32, 32) + io.ReadFull(rand.Reader, key) + expandKeyGo(key, encRes1, decRes1) + expandKeyAsm(&key[0], &ck[0], &encRes2[0], &decRes2[0]) + fmt.Printf("expected=%v, result=%v\n", encRes1, encRes2) + fmt.Printf("expected=%v, result=%v\n", decRes1, decRes2) +}