openwall / john

John the Ripper jumbo - advanced offline password cracker, which supports hundreds of hash and cipher types, and runs on many operating systems, CPUs, GPUs, and even some FPGAs
https://www.openwall.com/john/
Other
10.38k stars 2.11k forks source link

raw-sha256-ng fails cracking it's own test vectors when used in a file #928

Closed magnumripper closed 9 years ago

magnumripper commented 9 years ago
form=raw-sha256-ng                guesses:   13 -show=  15 0:00:00:00 DONE : Expected count(s) (16)(-show16)  [!!!FAILED!!!]
.pot CHK:raw-sha256-ng            guesses:   13 0:00:00:00 DONE  [PASSED]
magnumripper commented 9 years ago

Likely same as #926

jfoug commented 9 years ago

I still get this on my Ubuntu 64 bit VM:

$ ./jtrts.pl -internal raw-sha256-ng
-------------------------------------------------------------------------------
- JtR-TestSuite (jtrts). Version 1.13, Dec 21, 2014.  By, Jim Fougeron & others
- Testing:  John the Ripper password cracker, version 1.8.0.2-jumbo-1-bleeding_omp [linux-gnu 64-bit SSE4.1-autoconf]
--------------------------------------------------------------------------------

John Jumbo build detected.
Running JTRTS in -internal mode

form=raw-sha256-ng                guesses:   13 -show=  15 0:00:00:00 DONE : Expected count(s) (16)(-show16)  [!!!FAILED!!!]
.pot CHK:raw-sha256-ng            guesses:   13 0:00:00:00 DONE  [PASSED]

Some tests had Errors. Performed 1 tests.  1 errors
Time used was 5 seconds

Note, it may have to do with SSE4.1 ??? I am getting -show=16 here, while only -show=12 on my cygwin64 (XOP). There must be some other test vectors that are still having problems.

jfoug commented 9 years ago

Clean build and problem went away. I had MEMDEG_DEBUG turned on, and a few other things. Something must have been messed up on the build. Possibly, the raw-sha256-ng was not built, since this only modified a header. This is another reason why I really hate seeing code INSIDE headers. It should be made something like:

split_sha256_raw_shared()

and put into a stand alone .c file, and NOT static buried in a header. VC is smart enough to detect a header change affects a source file and rebuilds. gcc is not (doesn't ctags or something like that handle this??) I know we could do it by hand, editing the makefile, but really???