mirror of
https://github.com/openwall/john.git
synced 2026-12-03 18:45:21 +07:00
[GH-ISSUE #863] linux 32 bit SSE code for SHA512 busted in bitcoin format #467
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#467
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 @jfoug on GitHub (Nov 29, 2014).
Original GitHub issue: https://github.com/openwall/john/issues/863
If I make this change, it works (OMP build only). Non OMP build runs fine. This is a SSE4.1 build, that gets SSE4.1 code for SHA512. Most 32 bit builds do not get SIMD code.
@magnumripper it is pretty obvious that the JTR_ALIGN(16) is not working right for this, do you have any ideas? Could we do a union, and put an __m128i as one of the unused elements, and get proper alignment??? I KNOW the mem_alloc_tiny is NOT how this will be done, I was just doing that to test. I put that code in there, and crash just went away.
@magnumripper commented on GitHub (Nov 29, 2014):
Yeah a union should do the trick. This must be a compiler bug, right? I have seen similar problems with auto variables long ago (perhaps gcc 4.6, possibly older).
@jfoug commented on GitHub (Nov 29, 2014):
I could not get __m128i (or __m128d) into a union (or struct for that matter). They are defined as a union on 32 bit systems, so I think there is some issues.
Yes, I am pretty sure this is a compiler bug. If I built without OMP, it worked fine. as soon as I added OMP, I had to come up with some other memory layout technique othr than JTR_ALIGN(16). The align(8) is fine on teh hash1 array, but who knows if it is aligned.
What I have ended up doing, is making a new method in memory.h that aligns stack memory. You have to provide a large enough stack buffer (X-1 bytes larger at least than needed), pass the pointer and the alignment value, and get back a pointer inside the array that is aligned. It would not have to be a stack var, anything, even allocate memory could be used, AS LONG is the buffer has enough extra padding. I will be checking in soon.
This affected ONLY the bitcoin format.
@jfoug commented on GitHub (Nov 29, 2014):
82c5c16fixed.