mirror of
https://github.com/openwall/john.git
synced 2026-12-03 18:45:21 +07:00
[GH-ISSUE #1082] Possible bug in sse-intrisic for flat mode #676
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#676
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 (Mar 8, 2015).
Original GitHub issue: https://github.com/openwall/john/issues/1082
It appears that in flat mode, the way the code is written, the last byte group (32 bit or 64 bit) might need to be in BE format. This was seen when working with Sybase-ASE. When the code was originally done, I think the bits do not get swapped. But what happens when you do a reload (i.e. multiple buffers).
In that case every limb EXCEPT the last one should have that last word swapped.
It would be easy in the intrisic code to simply remove that stipulation, and simply swap it like the others. HOWEVER, all formats using flat would need to be changed. I have to think on this one a bit. I might add a new flag that lists this is NOT the final limb. IF that flag is set, swapping happens on that word. That should not impact any existing formats.
I am not quite sure how dyna is working on multi-limb big crypt stuff (i.e. flat). It might not be working properly, I have to check.
This is more of a research place holder bug report for now. I have seen something I do not like, BUT the fix may be possibly very ugly.
@magnumripper commented on GitHub (Mar 8, 2015):
Yes I noticed that (but did not see this coming). This is a design decision. I think we might just want to add a flag for it - eg. SSEi_FLAT_LASTLIMB which would make us not swap last word, while using SSEi_FLAT we should.
@jfoug commented on GitHub (Mar 8, 2015):
That means every format requires change, and if I am doing that, I will simply remove that non-swap, and then everything swaps.
I think it better (amount of code chnage better), to add a SSEi_FLAT_NOT_LASTLIMB instead. That way, if a format knows it needs 10 limbs, the limbs 1-9 all get that flag. The last does not get it. That way, existing code that swaps the length would not have any new flag added, and would still function fine.
@magnumripper commented on GitHub (Mar 8, 2015):
Sure, that's better. I'm not quite happy with the name SSEi_FLAT_NOT_LASTLIMB but I can't think of any that is definitely better. We could call it eg. SSEi_FLAT_MULTI or SSEi_FLAT_SWAPLAST. Maybe the latter one describes the difference best?
@jfoug commented on GitHub (Mar 8, 2015):
The last is probably best. I still do not have sybase-ase done. I now get the first 8 limbs, but 9th is still not right. That is sort of an ugly format for doing with simd. Once I get it, it should be slick. Simply add password to first limb (or 2), and clean prior UTF16 items. Then add salt to 2nd to last limb, and last limb (only 8 bytes). I am only working with 4 limbs. Limb 3 to 7 is simply a flat NULL byte buffer, that all threads will share. Keeps working set much smaller. But getting the data setup correctly was not easy. This actually ended up being a 4 dimension array (pretty rare to code into the 4th dimension). But I am close, and I really think it is the 'right' way to go. Doing this in flat mode. Already ugly enough with UTF-BE and the fun we get to have with that, so I did not want to also add BE-MMX_COEF logic on top of that. But this last word swap caught me by surprise.
@jfoug commented on GitHub (Mar 8, 2015):
There is this flag already (I think I will just use this one)
@jfoug commented on GitHub (Mar 8, 2015):
Nope, can not. What we have here is '1BUF_first_BLK' I think I will use that SSEi_FLAT_SWAPLAST. flag