diff --git a/sm3/sm3blocks_arm64.s b/sm3/sm3blocks_arm64.s index 89bdbc9..bf93f14 100644 --- a/sm3/sm3blocks_arm64.s +++ b/sm3/sm3blocks_arm64.s @@ -59,7 +59,7 @@ VST1.P [V12.B16, V13.B16, V14.B16, V15.B16], 64(wordPtr) #define LOAD_T(const, T) \ - MOVD $const, R20 \ + MOVW $const, R20 \ VDUP R20, T.S4 \ #define ROUND_00_11(index, const, a, b, c, d, e, f, g, h) \ diff --git a/sm3/sm3blocks_test.go b/sm3/sm3blocks_test.go index 2311304..584da03 100644 --- a/sm3/sm3blocks_test.go +++ b/sm3/sm3blocks_test.go @@ -51,7 +51,7 @@ func createTwoBlocksBy4() [4]*byte { func TestBlockMultBy4(t *testing.T) { digs := initState4() p := createOneBlockBy4() - buffer := make([]byte, 1216) + buffer := make([]byte, preallocSize) 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 {