Skip to content

Commit e983fa2

Browse files
Garrett-Bodleygopherbot
authored andcommitted
sha3: Avo port of keccakf_amd64.s
This implementation utilizes the same registers found in the reference implementation, aiming to produce a minimal semantic diff between the Avo-generated output and the original hand-written assembly. To verify the Avo implementation, the reference and Avo-generated assembly files are fed to `go tool asm`, capturing the debug output into corresponding temp files. The debug output contains supplementary metadata (line numbers, instruction offsets, and source file references) that must be removed in order to obtain a semantic diff of the two files. This is accomplished via a small utility script written in awk. Commands used to verify Avo output: BASE="d66d9c31b4ae80d173d1187a9e40c188788dbdbc" go tool asm -o /dev/null -debug \ <(git cat-file -p "$BASE":sha3/keccakf_amd64.s) \ > /tmp/reference.s go tool asm -o /dev/null -debug \ sha3/keccakf_amd64.s \ > /tmp/avo.s normalize(){ awk '{ $1=$2=$3=""; print substr($0,4) }' } diff <(normalize < /tmp/reference.s) <(normalize < /tmp/avo.s) Change-Id: I1c0ea516531355263b83d3b66a37df090e293cea Reviewed-on: https://go-review.googlesource.com/c/crypto/+/594655 Reviewed-by: Cherry Mui <[email protected]> Reviewed-by: Filippo Valsorda <[email protected]> Reviewed-by: Russell Webb <[email protected]> Reviewed-by: Roland Shoemaker <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]> Auto-Submit: Filippo Valsorda <[email protected]>
1 parent 80fd972 commit e983fa2

File tree

4 files changed

+5873
-379
lines changed

4 files changed

+5873
-379
lines changed

sha3/_asm/go.mod

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
module sha3/_asm
2+
3+
go 1.22
4+
5+
require (
6+
github.com/mmcloughlin/avo v0.6.0
7+
golang.org/x/crypto v0.25.0
8+
)
9+
10+
require (
11+
golang.org/x/mod v0.19.0 // indirect
12+
golang.org/x/sync v0.7.0 // indirect
13+
golang.org/x/sys v0.22.0 // indirect
14+
golang.org/x/tools v0.23.0 // indirect
15+
)

sha3/_asm/go.sum

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
github.com/mmcloughlin/avo v0.6.0 h1:QH6FU8SKoTLaVs80GA8TJuLNkUYl4VokHKlPhVDg4YY=
2+
github.com/mmcloughlin/avo v0.6.0/go.mod h1:8CoAGaCSYXtCPR+8y18Y9aB/kxb8JSS6FRI7mSkvD+8=
3+
golang.org/x/crypto v0.25.0 h1:ypSNr+bnYL2YhwoMt2zPxHFmbAN1KZs/njMG3hxUp30=
4+
golang.org/x/crypto v0.25.0/go.mod h1:T+wALwcMOSE0kXgUAnPAHqTLW+XHgcELELW8VaDgm/M=
5+
golang.org/x/mod v0.19.0 h1:fEdghXQSo20giMthA7cd28ZC+jts4amQ3YMXiP5oMQ8=
6+
golang.org/x/mod v0.19.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
7+
golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M=
8+
golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
9+
golang.org/x/sys v0.22.0 h1:RI27ohtqKCnwULzJLqkv897zojh5/DwS/ENaMzUOaWI=
10+
golang.org/x/sys v0.22.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
11+
golang.org/x/tools v0.23.0 h1:SGsXPZ+2l4JsgaCKkx+FQ9YZ5XEtA1GZYuoDjenLjvg=
12+
golang.org/x/tools v0.23.0/go.mod h1:pnu6ufv6vQkll6szChhK3C3L/ruaIv5eBeztNG8wtsI=

0 commit comments

Comments
 (0)