crypto icon indicating copy to clipboard operation
crypto copied to clipboard

crypto/salsa20/salsa: implement XORKeyStream12 and XORKeyStream8

Open pschou opened this issue 4 years ago • 8 comments

Implementing the 12 and 8 in both go and assembly. This is to address a TODO request.

For assembly, I did minimal changes here by using the amd64 BX register for the round count, it's limited to uint16, but that's enough for 20, 12, and 8. ;)

[schou@centos7 salsa]$ go test -bench=. -benchtime=5s goos: linux goarch: amd64 pkg: golang.org/x/crypto/salsa20/salsa BenchmarkSalsa20_04_amd64-12 24599977 225 ns/op BenchmarkSalsa20_08_amd64-12 16236384 340 ns/op BenchmarkSalsa20_12_amd64-12 11904351 470 ns/op BenchmarkSalsa20_16_amd64-12 9508006 576 ns/op BenchmarkSalsa20_20_amd64-12 7956676 712 ns/op BenchmarkSalsa20_24_amd64-12 6763491 845 ns/op BenchmarkSalsa20_04_ref-12 4826463 1223 ns/op BenchmarkSalsa20_08_ref-12 4027645 1397 ns/op BenchmarkSalsa20_12_ref-12 3223832 1708 ns/op BenchmarkSalsa20_16_ref-12 2806656 2020 ns/op BenchmarkSalsa20_20_ref-12 2436237 2220 ns/op BenchmarkSalsa20_24_ref-12 2230200 2571 ns/op PASS ok golang.org/x/crypto/salsa20/salsa 82.830s

All the best!

pschou avatar Jan 14 '21 17:01 pschou

This PR (HEAD: a36c3ace3bacb5beaaab03fba0a8e275cbed0e67) has been imported to Gerrit for code review.

Please visit https://go-review.googlesource.com/c/crypto/+/283792 to see it.

Tip: You can toggle comments from me using the comments slash command (e.g. /comments off) See the Wiki page for more info

gopherbot avatar Jan 14 '21 17:01 gopherbot

This PR (HEAD: 8412a7f757e7abca5baaabd167d9a7ff1518413d) has been imported to Gerrit for code review.

Please visit https://go-review.googlesource.com/c/crypto/+/283792 to see it.

Tip: You can toggle comments from me using the comments slash command (e.g. /comments off) See the Wiki page for more info

gopherbot avatar Jan 14 '21 17:01 gopherbot

This PR (HEAD: dca78e525b3ae0d6ad157449c6f46d82fddf4b41) has been imported to Gerrit for code review.

Please visit https://go-review.googlesource.com/c/crypto/+/283792 to see it.

Tip: You can toggle comments from me using the comments slash command (e.g. /comments off) See the Wiki page for more info

gopherbot avatar Jan 14 '21 17:01 gopherbot

Message from Paul Schou:

Patch Set 5:

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/283792. After addressing review feedback, remember to publish your drafts!

gopherbot avatar Jan 14 '21 17:01 gopherbot

This PR (HEAD: 202d1e6533a146c4146cc6174773d9b71f629b95) has been imported to Gerrit for code review.

Please visit https://go-review.googlesource.com/c/crypto/+/283792 to see it.

Tip: You can toggle comments from me using the comments slash command (e.g. /comments off) See the Wiki page for more info

gopherbot avatar Jan 14 '21 19:01 gopherbot

This PR (HEAD: 5b6679e8fe0b2ab1d08c46532c54f877ad3d87c5) has been imported to Gerrit for code review.

Please visit https://go-review.googlesource.com/c/crypto/+/283792 to see it.

Tip: You can toggle comments from me using the comments slash command (e.g. /comments off) See the Wiki page for more info

gopherbot avatar Jan 14 '21 19:01 gopherbot

This PR (HEAD: 59dc8437733804d6e777b072cfb7071517d6d8a2) has been imported to Gerrit for code review.

Please visit https://go-review.googlesource.com/c/crypto/+/283792 to see it.

Tip: You can toggle comments from me using the comments slash command (e.g. /comments off) See the Wiki page for more info

gopherbot avatar Jan 15 '21 00:01 gopherbot

This PR (HEAD: 38cdb9b465a4b8da9e0649f55d3aa4c15835efe1) has been imported to Gerrit for code review.

Please visit https://go-review.googlesource.com/c/crypto/+/283792 to see it.

Tip: You can toggle comments from me using the comments slash command (e.g. /comments off) See the Wiki page for more info

gopherbot avatar Jan 17 '21 15:01 gopherbot