From db47d7e92f0461840dd99d3756433202ea3447a0 Mon Sep 17 00:00:00 2001 From: emmansun Date: Sat, 1 Jan 2022 20:44:51 +0800 Subject: [PATCH] rollback test case --- sm4/arm64_verify_test.go | 2 ++ sm4/cipher_asm_fuzzy_test.go | 22 ++++------------------ 2 files changed, 6 insertions(+), 18 deletions(-) diff --git a/sm4/arm64_verify_test.go b/sm4/arm64_verify_test.go index 40d6a1f..7c756c8 100644 --- a/sm4/arm64_verify_test.go +++ b/sm4/arm64_verify_test.go @@ -20,4 +20,6 @@ func TestTblAsm(t *testing.T) { if !reflect.DeepEqual(out, imm) { t.Errorf("expected=%v, result=%v\n", imm, out) } + + imm = []byte{0, 7, 2, 3} } diff --git a/sm4/cipher_asm_fuzzy_test.go b/sm4/cipher_asm_fuzzy_test.go index 0ade790..1e142da 100644 --- a/sm4/cipher_asm_fuzzy_test.go +++ b/sm4/cipher_asm_fuzzy_test.go @@ -4,11 +4,13 @@ package sm4 import ( - "fmt" + "crypto/rand" + "io" + "reflect" "testing" + "time" ) -/* func TestExpandKey(t *testing.T) { key := make([]byte, 16) @@ -41,19 +43,3 @@ func TestExpandKey(t *testing.T) { } } } -*/ - -func TestExpandKeySimple(t *testing.T) { - key := []byte{0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef, 0xfe, 0xdc, 0xba, 0x98, 0x76, 0x54, 0x32, 0x10} - - encRes1 := make([]uint32, 32) - decRes1 := make([]uint32, 32) - encRes2 := make([]uint32, 32) - decRes2 := make([]uint32, 32) - - 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) -} -