Skip to content

crypto/sha512: implement sha512 with ARMv8.2 features #46970

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

howjmay
Copy link
Contributor

@howjmay howjmay commented Jun 29, 2021

ARMv8.2 starts to support SIMD instrisics to accelerate SHA512 operations.
Here, SHA512 in assembly with the NEON instruction is implemented.

The following benchmark was run on Apple M1 chip. Comparing to the
pure golang implementation (the implementation in sha512block.go)
the time difference is listed in the following.

benchmark old ns/op new ns/op delta
BenchmarkHash8Bytes-8 506.6 ns/op 177.4 ns/op -64.98%
BenchmarkHash1K-8 4034 ns/op 1192 ns/op -70.45%
BenchmarkHash8K-8 28418 ns/op 8635 ns/op -69.61%

benchmark old MB/s new MB/s speedup
BenchmarkHash8Bytes-8 15.79 MB/s 45.11 MB/s 2.86x
BenchmarkHash1K-8 253.81 MB/s 859.03 MB/s 3.38x
BenchmarkHash8K-8 288.27 MB/s 948.68 MB/s 3.29x

@google-cla google-cla bot added the cla: yes Used by googlebot to label PRs as having a valid CLA. The text of this label should not change. label Jun 29, 2021
@gopherbot
Copy link
Contributor

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

Please visit https://go-review.googlesource.com/c/go/+/331594 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
Copy link
Contributor

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

Please visit https://go-review.googlesource.com/c/go/+/331594 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

ARMv8.2 support SIMD instrisics to accelerate SHA512 operations.
Here SHA512 in assembly with the NEON instruction in implemented.

The following benchmark was run on Apple M1 chip. Compare to the
pure golang implementation (the implementation insha512block.go)
the time difference is listed in the following.

benchmark                  old ns/op     new ns/op      delta
BenchmarkHash8Bytes-8    506.6 ns/op   177.4 ns/op    -64.98%
BenchmarkHash1K-8         4034 ns/op    1192 ns/op    -70.45%
BenchmarkHash8K-8        28418 ns/op    8635 ns/op    -69.61%

benchmark                   old MB/s      new MB/s    speedup
BenchmarkHash8Bytes-8     15.79 MB/s    45.11 MB/s      2.86x
BenchmarkHash1K-8        253.81 MB/s   859.03 MB/s      3.38x
BenchmarkHash8K-8        288.27 MB/s   948.68 MB/s      3.29x
@gopherbot
Copy link
Contributor

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

Please visit https://go-review.googlesource.com/c/go/+/331594 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
Copy link
Contributor

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

Please visit https://go-review.googlesource.com/c/go/+/331594 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
Copy link
Contributor

Message from Hau Yang:

Patch Set 7:

(1 comment)


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

@gopherbot
Copy link
Contributor

Message from Hau Yang:

Patch Set 7:

(1 comment)


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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes Used by googlebot to label PRs as having a valid CLA. The text of this label should not change.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants