Skip to content

Commit a1bdf71

Browse files
authored
internal/cipher/gcmsiv: debug arm64 #523
1 parent d8e3b77 commit a1bdf71

2 files changed

Lines changed: 25 additions & 4 deletions

File tree

.github/workflows/test_smni_arm64.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
3939

4040
- name: Test
41-
run: go test -v -short ./cipher/...
41+
run: go test -v -short ./internal/cipher/gcmsiv/...
4242
env:
4343
GODEBUG: x509sha1=1
4444
GOARCH: ${{ matrix.arch }}

internal/cipher/gcmsiv/gcmsiv_asm_test.go

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,17 +43,38 @@ func TestPolyvalBlocksUpdateAsm(t *testing.T) {
4343
var table polyvalAsmTable
4444
polyvalTableInitAsm(&authKey, &table)
4545

46-
expected, _ := hex.DecodeString("b1aba232dd6c847586593756cb2644eb")
46+
expected1, _ := hex.DecodeString("cc07e4605483f50fd35586290940202c")
47+
expected2, _ := hex.DecodeString("e07a52a82c82073210069f28dd621a5b")
4748

4849
var y [16]byte
4950
var blocks = []byte{
5051
0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77,
5152
0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff,
5253
0xff, 0xee, 0xdd, 0xcc, 0xbb, 0xaa, 0x99, 0x88,
5354
0x77, 0x66, 0x55, 0x44, 0x33, 0x22, 0x11, 0x00,
55+
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
56+
0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
57+
0x0f, 0x0e, 0x0d, 0x0c, 0x0b, 0x0a, 0x09, 0x08,
58+
0x07, 0x06, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00,
59+
0x07, 0x06, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00,
60+
0x0f, 0x0e, 0x0d, 0x0c, 0x0b, 0x0a, 0x09, 0x08,
61+
0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
62+
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
63+
0x77, 0x66, 0x55, 0x44, 0x33, 0x22, 0x11, 0x00,
64+
0xff, 0xee, 0xdd, 0xcc, 0xbb, 0xaa, 0x99, 0x88,
65+
0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff,
66+
0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77,
67+
0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff,
68+
0xff, 0xee, 0xdd, 0xcc, 0xbb, 0xaa, 0x99, 0x88,
69+
0x77, 0x66, 0x55, 0x44, 0x33, 0x22, 0x11, 0x00,
70+
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
71+
}
72+
polyvalBlocksUpdateAsm(&table, &y, blocks)
73+
if !bytes.Equal(y[:], expected1) {
74+
t.Errorf("unexpected result: got %x, want %x", y, expected1)
5475
}
5576
polyvalBlocksUpdateAsm(&table, &y, blocks)
56-
if !bytes.Equal(y[:], expected) {
57-
t.Errorf("unexpected result: got %x, want %x", y, expected)
77+
if !bytes.Equal(y[:], expected2) {
78+
t.Errorf("unexpected result: got %x, want %x", y, expected2)
5879
}
5980
}

0 commit comments

Comments
 (0)