Skip to content

Use SHA-1/2 instructions for Skylake architecture. #1

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

Closed
Pratyush opened this issue Sep 1, 2017 · 3 comments
Closed

Use SHA-1/2 instructions for Skylake architecture. #1

Pratyush opened this issue Sep 1, 2017 · 3 comments

Comments

@Pratyush
Copy link

Pratyush commented Sep 1, 2017

The new Intel Skylake architecture introduces SHA1 and SHA2 specific instructions that should speed up computation of these two primitives:
https://software.intel.com/en-us/articles/intel-sha-extensions

There is sample code in C for these that uses intrinsics to do this:

https://github.com/noloader/SHA-Intrinsics

It would be great to have an implementation of these in this library so that we can have blazingly fast hash functions.

@tarcieri
Copy link
Member

tarcieri commented Sep 1, 2017

These instructions are not available on Skylake. The only shipping CPUs which presently have them are AMD Ryzen and Intel Goldmont.

As far as server-class CPUs, this feature will be in Cannonlake CPUs, which will "start to ship in the first half of 2018"

@newpavlov
Copy link
Member

newpavlov commented Sep 1, 2017

I have a draft for SHA1 and SHA2 (as code already structured around respective intrinsics/assembly instructions), but unfortunately I don't have access to CPU with this extension to properly test it. And as was correctly stated by @tarcieri Skylake does not have this extension.

You can see very raw draft for SHA1 in this branch.

@newpavlov
Copy link
Member

newpavlov commented Apr 4, 2018

I've opened a new issue in the RustCrypto/hashes repo. I think we'll go with intrinsics approach as part of the existing sha1 and sha2 crates.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants