-
Notifications
You must be signed in to change notification settings - Fork 264
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
feat(sha2): implement intrinsic based version for sha256 #90
Conversation
I have also added feature detection at runtime, based on how blake2_simd implements it (https://github.com/oconnor663/blake2_simd/blob/master/blake2s/src/guts.rs) As otherwise it gets tricky to deploy this without creating many different builds |
Impressive numbers |
re: build failure, looks like |
4324edd
to
7cc074b
Compare
This is why I wanted to add those intrinsics only in v0.9. For now I think we can use a disabled by default feature or wait until I will get time to work on RustCrypto/traits#43 (probably only in January). |
7cc074b
to
cdcbc41
Compare
@dignifiedquire can you rebase? we've bumped MSRV to 1.41+ |
@dignifiedquire are you planning to implement the same for the other SHA algos? |
@Fleshgrinder |
cdcbc41
to
5206c21
Compare
I have rebased the code and pulled in the changes I had in https://github.com/filecoin-project/rust-sha2ni Fyi rust-sha2ni just got a security audit through NCC (the sha2-256 part), will publishe the report soon. |
@dignifiedquire |
#167 is merged, so I will close this PR. |
This is not optimal yet when processing multiple blocks, but it does give a considerable speedup over the non intrinsic version already
Measurements were taken on an
AMD Ryzen 7 3700X 8-Core
.Baseline
With asm-hashes
With Intrinsics