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.21k stars 2.09k forks source link

rawSHA256_ng_fmt_plug.c compile error #1180

Closed askovpen closed 9 years ago

askovpen commented 9 years ago

commit f29b926ca73ed12edb49d09f3ade7592834c734d

Configured for building John the Ripper 1.8.0.2-jumbo-1-bleeding:

Target CPU .................................. x86_64 SSE4.1, 64-bit LE
AES-NI support .............................. run-time detection
Target OS ................................... linux-gnu
Cross compiling ............................. no
Legacy arch header .......................... x86-64.h
OpenMPI support (default disabled) .......... no
Fork support ................................ yes
OpenMP support .............................. yes
OpenCL support .............................. yes
CUDA support ................................ no
Generic crypt(3) format ..................... yes

Optional libraries/features found:
Rexgen (extra cracking mode) ................ no
GMP (PRINCE mode and faster SRP formats) .... yes
128-bit integer (faster PRINCE mode) ........ yes
PCAP (vncpcap2john and SIPdump) ............. yes
BZ2 (gpg2john extra decompression logic) .... yes

Development options (these may hurt performance when enabled):
Memdbg memory debugging settings ............ disabled
AddressSanitizer ("ASan") ................... disabled

gcc 4.8.3 errors:

rawSHA256_ng_fmt_plug.c:85:7: error: incompatible types when assigning to type 'vtype' from type 'int'
rawSHA256_ng_fmt_plug.c:86:7: error: incompatible types when assigning to type 'vtype' from type 'int'
rawSHA256_ng_fmt_plug.c:87:7: error: incompatible types when assigning to type 'vtype' from type 'int'
pseudo_intrinsics.h:284:4: error: incompatible types when assigning to type 'vtype' from type 'int'

clang 3.5.0 errors:

rawSHA256_ng_fmt_plug.c:241:32: error: assigning to 'vtype' (aka '__m128i') from incompatible type 'int'
rawSHA256_ng_fmt_plug.c:241:32: error: assigning to 'vtype' (aka '__m128i') from incompatible type 'int'
rawSHA256_ng_fmt_plug.c:241:32: error: assigning to 'vtype' (aka '__m128i') from incompatible type 'int'
rawSHA256_ng_fmt_plug.c:242:32: error: assigning to 'vtype' (aka '__m128i') from incompatible type 'int'
magnumripper commented 9 years ago

Thank you for reporting. I have yet to reproduce this. Before I spend too much time on it: It's not a "make clean" issue, is it?

askovpen commented 9 years ago

and make clean and git checkout bleeding-jumbo -f made

askovpen commented 9 years ago

problem in commit 72494ddbee61b47be4469a00279b5689921992f1 raw-sha512-ng: Use pseudo-intrinsics.

rawSHA512_ng_fmt_plug.c:119:7: error: incompatible types when assigning to type 'vtype' from type 'int'
rawSHA512_ng_fmt_plug.c:119:7: error: incompatible types when assigning to type 'vtype' from type 'int'
rawSHA512_ng_fmt_plug.c:119:7: error: incompatible types when assigning to type 'vtype' from type 'int'

and next commit 33355db11f39bc05f00268979781ff111f17f162 raw-sha256-ng: Use pseudo-intrinsics.

askovpen commented 9 years ago

commit 458d690d523189c7409bf519bf20368a1727feca compiled ok

magnumripper commented 9 years ago

The problem is I do not see any error nor even any warning. I tried OSX and Linux, gcc and clang and various gcc versions. Just as a test, could you try checking out the avx2 topic branch and see if it's better?

askovpen commented 9 years ago

avx2:

gcc -DAC_BUILT -march=native -msse4.1 -c -g -O2 -I/usr/local/include -DARCH_LITTLE_ENDIAN=1   -Wall -Wdeclaration-after-statement -fomit-frame-pointer --param allow-store-data-races=0 -Wno-deprecated-declarations -Wno-format-extra-args -std=gnu89 -D_GNU_SOURCE -D_XOPEN_SOURCE=600   -I/usr/kerberos/include  -fopenmp  -pthread  -I/usr/local/include -funroll-loops rawSHA256_ng_fmt_plug.c -o rawSHA256_ng_fmt_plug.o
rawSHA256_ng_fmt_plug.c: In function 'crypt_all':
rawSHA256_ng_fmt_plug.c:242:9: warning: implicit declaration of function '_mm_insert_epi32' [-Wimplicit-function-declaration]
         for (i=0; i < 16; i++) GATHER(w[i], saved_key, i);
         ^
rawSHA256_ng_fmt_plug.c:86:11: error: incompatible types when assigning to type 'vtype' from type 'int'
         x = _mm_insert_epi32(x, y[index + 1][z], 1);    \
           ^
rawSHA256_ng_fmt_plug.c:242:32: note: in expansion of macro 'GATHER'
         for (i=0; i < 16; i++) GATHER(w[i], saved_key, i);
                                ^
rawSHA256_ng_fmt_plug.c:87:11: error: incompatible types when assigning to type 'vtype' from type 'int'
         x = _mm_insert_epi32(x, y[index + 2][z], 2);    \
           ^
rawSHA256_ng_fmt_plug.c:242:32: note: in expansion of macro 'GATHER'
         for (i=0; i < 16; i++) GATHER(w[i], saved_key, i);
                                ^
rawSHA256_ng_fmt_plug.c:88:11: error: incompatible types when assigning to type 'vtype' from type 'int'
         x = _mm_insert_epi32(x, y[index + 3][z], 3);    \
           ^
rawSHA256_ng_fmt_plug.c:242:32: note: in expansion of macro 'GATHER'
         for (i=0; i < 16; i++) GATHER(w[i], saved_key, i);
                                ^
rawSHA256_ng_fmt_plug.c:243:9: warning: implicit declaration of function '_mm_shuffle_epi8' [-Wimplicit-function-declaration]
         for (i=0; i < 15; i++) vswap32(w[i]);
         ^
In file included from rawSHA256_ng_fmt_plug.c:40:0:
pseudo_intrinsics.h:390:8: error: incompatible types when assigning to type 'vtype' from type 'int'
     (n = vshuffle_epi8(n, swap_endian_mask))
        ^
rawSHA256_ng_fmt_plug.c:243:32: note: in expansion of macro 'vswap32'
         for (i=0; i < 15; i++) vswap32(w[i]);
                                ^
Makefile:1328: recipe for target 'rawSHA256_ng_fmt_plug.o' failed
magnumripper commented 9 years ago

OK I see the problem now. You omitted a detail from your first report. Will look into it, thanks.

magnumripper commented 9 years ago

Please verify that 92295a5 solves it. Thanks!

askovpen commented 9 years ago

yes. compile ok.

askovpen commented 9 years ago

PS:

model name      : Intel(R) Core(TM)2 Quad CPU    Q9550  @ 2.83GHz
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx lm constant_tsc arch_perfmon pebs bts rep_good nopl aperfmperf pni dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm sse4_1 xsave lahf_lm dtherm tpr_shadow vnmi flexpriority