Skip to content

Commit

Permalink
kdf-sm3: debug arm64
Browse files Browse the repository at this point in the history
  • Loading branch information
emmansun authored May 21, 2024
1 parent 79af127 commit 1ff1d53
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions sm3/sm3blocks_arm64.s
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ loop:

SUB $1, blockCount
CBNZ blockCount, loop

/*
// transpose state
TRANSPOSE_MATRIX(a, b, c, d, tmp1, tmp2, tmp3, tmp4)
TRANSPOSE_MATRIX(e, f, g, h, tmp1, tmp2, tmp3, tmp4)
Expand All @@ -305,5 +305,5 @@ loop:
MOVD (digSave), R20
VST1.P [d.S4], 16(R20)
VST1 [h.S4], (R20)

*/
RET
2 changes: 1 addition & 1 deletion sm3/sm3blocks_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ func TestBlockMultBy4(t *testing.T) {
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 {
for i := 0; 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:]))
Expand Down

0 comments on commit 1ff1d53

Please sign in to comment.