-
Notifications
You must be signed in to change notification settings - Fork 545
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
Add SHA-512 hardware acceleration on ARMv8 #3860
Conversation
Regarding
you probably noticed that our advantage is confined to the smaller input sizes. I recently had to benchmark several (Rust) SHA-256 libraries using SHA-NI and noticed something similar; basically every implementation was fast for long messages, but for small messages there were huge swings in performance, and with OpenSSL always the worst. I believe this is due to differences in buffer management. This is a good sign that we're doing the right thing in this regard. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Two small things but otherwise looks good to me, thanks!
CI failures look relevent, but are confusing. iOS:
sha3? Android:
sha3? GCC
Doesn't specify but I'm going to go ahead and guess it's sha3 |
Oh right, instead of |
That is it, thanks! Thanks for the quick review! |
4a0ba90
to
eb8384c
Compare
Adds support for ARMv8 hardware acceleration using instrinsics. It is heavily based on the existing SHA-256 implementation with changes to use the equivalent intrinsics for SHA-512.
Tested on a MacBook Pro with M2 Pro.
Baseline software:
ARMv8 intrinsics:
Which means a factor 2,67 or 267% performance increase.
Even beats OpenSSL on the same machine (via Homebrew):
Before, the baseline software was significantly slower: