1
0
mirror of https://github.com/fumiama/unibase2n.git synced 2026-06-05 00:32:47 +08:00

fix amd64 Base256 error

This commit is contained in:
源文雨
2022-10-03 19:52:27 +08:00
parent 0857bd846c
commit e7db987de9
2 changed files with 4 additions and 3 deletions

View File

@@ -78,9 +78,9 @@ func TestDec16blk8(t *testing.T) {
}
n, _ := Base{bit: 8}.EncodeLen(32)
out := make([]byte, n)
enc16blk8(0x2333, in[:], out)
enc16blk8(0x1100, in[:], out)
t.Log(out)
dec16blk8(0x2333, out[:], tmp[:])
dec16blk8(0x1100, out[:], tmp[:])
assert.Equal(t, in, tmp)
}

View File

@@ -146,8 +146,9 @@ TEXT ·enc16blk8(SB), NOSPLIT, $0-56
CLD
lop:
LODSB
ANDW $0xff, AX
// add mask
LEAW 0(AX)(BX*1), AX
ADDW BX, AX
RORW $8, AX
STOSW
LOOP lop