mirror of
https://github.com/openwall/john.git
synced 2026-12-03 18:45:21 +07:00
[GH-ISSUE #2734] Support for Intel SHA extensions #1757
Labels
No labels
bug
core branch
documentation
enhancement
enhancement
fixed - pending verify
fuzz bug
good first issue
invalid
invalid
maintenance/cleanup
new cracking mode
new format
new tool
non-trivial
notes/external issues
portability
question
RFC / discussion
testing
WONTFIX
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
openwall/john#1757
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @kholia on GitHub (Sep 7, 2017).
Original GitHub issue: https://github.com/openwall/john/issues/2734
References,
https://software.intel.com/en-us/articles/intel-sha-extensions-implementations (has sample code)
https://en.wikipedia.org/wiki/Intel_SHA_extensions
It seems that Intel Software Development Emulator can be used to development and testing.
intel-sha-extensions_1.zip <- code from Intel.
@magnumripper commented on GitHub (Sep 7, 2017):
"The SHA instructions are non-SIMD although they are defined with XMM width operands"
I had a look at this some time ago. As far as I understood it, the extensions are fast at producing a single SHA-1 or SHA-256 digest, as opposed to our current code producing eg. eight in parallel. At the time, my conclusion was we wouldn't gain anything (unless they are several times faster than our current code). I hope someone can prove me wrong!
@magnumripper commented on GitHub (Sep 7, 2017):
@solardiz do you have insights?
@solardiz commented on GitHub (Sep 7, 2017):
It's hard to tell without testing on real hardware, including interleaving of several instances of SHA using those instructions and maybe our usual SIMD at once. We might gain something. Without access to hardware yet, we could review documentation for what uop port(s) those instructions are issued on - do they fully conflict with SIMD or not. Also need their latency & throughput numbers, to compare that against what we achieve with SIMD.
At four (SHA-1) or two (SHA-256) rounds per instructions and interleaving of several instances (to be friendly to CPU's pipelining), these might be competitive with AVX2 or AVX-512 even despite of computing fewer instances.
AMD Ryzen hardware is already available, cheaply. So maybe one of us should get a machine like that and try? Then we'll also need to try/tune on Intel, which might or might not require different tuning - interleaving factor and whether and how much SIMD to use as well.
Per http://instlatx64.atw.hu it looks like on Ryzen the 4 rounds of SHA-1 may only be issued once per 4 cycles, and the 2 rounds of SHA-256 only once per 2 cycles. If so, I wouldn't expect them to be useful for us on those CPUs unless we can efficiently interleave with SIMD.
@magnumripper commented on GitHub (Sep 7, 2017):
This would be a great GSoC project, or the like.
@solardiz commented on GitHub (May 25, 2024):
Closing this in favor of #5437.