From 5373617d6c12e1d99ddeabac031aac28afbb9cb6 Mon Sep 17 00:00:00 2001 From: Sun Yimin Date: Sat, 1 Jan 2022 11:14:31 +0800 Subject: [PATCH] Update cipher_asm_fuzzy_test.go --- sm4/cipher_asm_fuzzy_test.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/sm4/cipher_asm_fuzzy_test.go b/sm4/cipher_asm_fuzzy_test.go index a390971..0ade790 100644 --- a/sm4/cipher_asm_fuzzy_test.go +++ b/sm4/cipher_asm_fuzzy_test.go @@ -4,9 +4,7 @@ package sm4 import ( - "crypto/rand" "fmt" - "io" "testing" ) @@ -46,15 +44,16 @@ func TestExpandKey(t *testing.T) { */ func TestExpandKeySimple(t *testing.T) { - key := make([]byte, 16) + 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) - 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) } +