mirror of
https://github.com/openwall/john.git
synced 2026-12-03 20:43:49 +07:00
[GH-ISSUE #630] Try to assess why 32-bit SHA-1 SSE2 assembler code is faster than the interleaved intrinsics version #290
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#290
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 @magnumripper on GitHub (Jun 8, 2014).
Original GitHub issue: https://github.com/openwall/john/issues/630
We should try to establish why the 32-bit SHA1 SSE2 assembler is (sometimes) faster than the intrinsics version even though the latter can do interleaved code and use XOP and stuff. This always bothered me - is there some optimization we can do to the intrinsics? Compiler hints? Compiler flags?
@jfoug commented on GitHub (Jun 8, 2014):
Or is the actual algorithm used the same between the 2? Could we be doing a 'full' sha1, but a shortcut within the old mmx code ?? Yes, this one has not made me overly happy either. Seems very counter intuitive, unless the intrinsics are simply NOT good at the ROL's, which is highly likely. I do not think MDx has ROL's, only sha1.
@magnumripper commented on GitHub (Jun 18, 2014):
But if the assembler is using vector rotates, there ought to be intrinsics for the very same instructions. And I can't see how any significant shortcuts could be used as both versions can do iterated formats and full-length blocks.
Here's a (poor) way to try to compare apples to apples. It's probably better to look at the .S file with intact macros and compare it to the intrinsics.
(edit: I did the above after chopping all non-SHA1 code from the intrinsics)
@magnumripper commented on GitHub (Jun 18, 2014):
I see an awful lot of
movl... they are not SIMD are they?@jfoug commented on GitHub (Jun 18, 2014):
movl is CPU
@magnumripper commented on GitHub (Jun 18, 2014):
-fverbose-asm made it a whole lot easier to follow
@magnumripper commented on GitHub (Jun 18, 2014):
It might be that those movl's are from conversion to flat buffer. I'll edit it out and see how it looks
@magnumripper commented on GitHub (Jun 18, 2014):
Yeah that was it.
@magnumripper commented on GitHub (Jun 18, 2014):
Note to self: http://arctic.org/~dean/crypto/sha1.html