diff --git a/.github/workflows/test_qemu.yml b/.github/workflows/test_qemu.yml index c2bffbd..cb97092 100644 --- a/.github/workflows/test_qemu.yml +++ b/.github/workflows/test_qemu.yml @@ -30,7 +30,7 @@ jobs: uses: actions/checkout@v4 - name: Test - run: go test -v -short ./... + run: go test -v -short ./sm3/... env: DISABLE_SM3NI: 1 DISABLE_SM4NI: 1 diff --git a/sm3/sm3blocks_arm64.s b/sm3/sm3blocks_arm64.s index 61805e3..89bdbc9 100644 --- a/sm3/sm3blocks_arm64.s +++ b/sm3/sm3blocks_arm64.s @@ -112,11 +112,11 @@ VST1.P [V11.S4], 16(wordPtr) \ #define ROUND_12_15(index, const, a, b, c, d, e, f, g, h) \ - MESSAGE_SCHEDULE(index) \ + MESSAGE_SCHEDULE(index) \ ROUND_00_11(index, const, a, b, c, d, e, f, g, h) \ #define ROUND_16_63(index, const, a, b, c, d, e, f, g, h) \ - MESSAGE_SCHEDULE(index); \ // V11 is Wt+4 now, Pls do not use it + MESSAGE_SCHEDULE(index) \ // V11 is Wt+4 now, Pls do not use it PROLD(a, V12, 12) \ VMOV V12.B16, V13.B16 \ LOAD_T(const, tmp1) \ diff --git a/sm3/sm3blocks_test.go b/sm3/sm3blocks_test.go index 46fbe19..2311304 100644 --- a/sm3/sm3blocks_test.go +++ b/sm3/sm3blocks_test.go @@ -3,6 +3,7 @@ package sm3 import ( + "encoding/binary" "fmt" "testing" ) @@ -53,6 +54,13 @@ func TestBlockMultBy4(t *testing.T) { buffer := make([]byte, 1216) blockMultBy4(&digs[0], &p[0], &buffer[0], 1) expected := "[66c7f0f4 62eeedd9 d1f2d46b dc10e4e2 4167c487 5cf2f7a2 297da02b 8f4ba8e0]" + for i := 128; i < 128+68*4*4; i += 64 { + fmt.Printf("%08x %08x %08x %08x ", binary.LittleEndian.Uint32(buffer[i:]), binary.LittleEndian.Uint32(buffer[i+4:]), binary.LittleEndian.Uint32(buffer[i+8:]), binary.LittleEndian.Uint32(buffer[i+12:])) + fmt.Printf("%08x %08x %08x %08x ", binary.LittleEndian.Uint32(buffer[i+16:]), binary.LittleEndian.Uint32(buffer[i+20:]), binary.LittleEndian.Uint32(buffer[i+24:]), binary.LittleEndian.Uint32(buffer[i+28:])) + fmt.Printf("%08x %08x %08x %08x ", binary.LittleEndian.Uint32(buffer[i+32:]), binary.LittleEndian.Uint32(buffer[i+36:]), binary.LittleEndian.Uint32(buffer[i+40:]), binary.LittleEndian.Uint32(buffer[i+44:])) + fmt.Printf("%08x %08x %08x %08x ", binary.LittleEndian.Uint32(buffer[i+48:]), binary.LittleEndian.Uint32(buffer[i+52:]), binary.LittleEndian.Uint32(buffer[i+56:]), binary.LittleEndian.Uint32(buffer[i+60:])) + fmt.Println() + } s := fmt.Sprintf("%x", digs[0][:]) if s != expected { t.Errorf("digs[0] got %s", s)