Blame john-1.8.0.local.patch

Lucio Andrés Illanes Albornoz (arab, vxp) a5962b
diff -ru a/src/DES_bs.c b/src/DES_bs.c
Lucio Andrés Illanes Albornoz (arab, vxp) a5962b
--- a/src/DES_bs.c	2012-07-14 09:36:44.000000000 -0400
Lucio Andrés Illanes Albornoz (arab, vxp) a5962b
+++ b/src/DES_bs.c	2016-08-07 15:08:48.011369100 -0400
Lucio Andrés Illanes Albornoz (arab, vxp) a5962b
@@ -52,7 +52,7 @@
Lucio Andrés Illanes Albornoz (arab, vxp) a5962b
 };
Lucio Andrés Illanes Albornoz (arab, vxp) a5962b
 
Lucio Andrés Illanes Albornoz (arab, vxp) a5962b
 #if DES_BS_ASM
Lucio Andrés Illanes Albornoz (arab, vxp) a5962b
-extern void DES_bs_init_asm(void);
Lucio Andrés Illanes Albornoz (arab, vxp) a5962b
+extern void DES_INTERNAL_CALL DES_bs_init_asm(void);
Lucio Andrés Illanes Albornoz (arab, vxp) a5962b
 #endif
Lucio Andrés Illanes Albornoz (arab, vxp) a5962b
 
Lucio Andrés Illanes Albornoz (arab, vxp) a5962b
 void DES_bs_init(int LM, int cpt)
Lucio Andrés Illanes Albornoz (arab, vxp) a5962b
diff -ru a/src/DES_bs.h b/src/DES_bs.h
Lucio Andrés Illanes Albornoz (arab, vxp) a5962b
--- a/src/DES_bs.h	2013-05-06 02:19:49.000000000 -0400
Lucio Andrés Illanes Albornoz (arab, vxp) a5962b
+++ b/src/DES_bs.h	2016-08-07 15:09:17.512056400 -0400
Lucio Andrés Illanes Albornoz (arab, vxp) a5962b
@@ -35,6 +35,16 @@
Lucio Andrés Illanes Albornoz (arab, vxp) a5962b
 #define DES_bs_vector			ARCH_WORD
Lucio Andrés Illanes Albornoz (arab, vxp) a5962b
 #endif
Lucio Andrés Illanes Albornoz (arab, vxp) a5962b
 
Lucio Andrés Illanes Albornoz (arab, vxp) a5962b
+#ifndef HAVE_INTERNAL_ATTR
Lucio Andrés Illanes Albornoz (arab, vxp) a5962b
+#define HAVE_INTERNAL_ATTR 0
Lucio Andrés Illanes Albornoz (arab, vxp) a5962b
+#endif
Lucio Andrés Illanes Albornoz (arab, vxp) a5962b
+
Lucio Andrés Illanes Albornoz (arab, vxp) a5962b
+#if     HAVE_INTERNAL_ATTR
Lucio Andrés Illanes Albornoz (arab, vxp) a5962b
+#define DES_INTERNAL_CALL  __attribute__((visibility("internal")))
Lucio Andrés Illanes Albornoz (arab, vxp) a5962b
+#else
Lucio Andrés Illanes Albornoz (arab, vxp) a5962b
+#define DES_INTERNAL_CALL
Lucio Andrés Illanes Albornoz (arab, vxp) a5962b
+#endif
Lucio Andrés Illanes Albornoz (arab, vxp) a5962b
+
Lucio Andrés Illanes Albornoz (arab, vxp) a5962b
 /*
Lucio Andrés Illanes Albornoz (arab, vxp) a5962b
  * All bitslice DES parameters combined into one struct for more efficient
Lucio Andrés Illanes Albornoz (arab, vxp) a5962b
  * cache usage. Don't re-order unless you know what you're doing, as there
Lucio Andrés Illanes Albornoz (arab, vxp) a5962b
@@ -112,7 +122,7 @@
Lucio Andrés Illanes Albornoz (arab, vxp) a5962b
 #else
Lucio Andrés Illanes Albornoz (arab, vxp) a5962b
 #define DES_bs_mt			0
Lucio Andrés Illanes Albornoz (arab, vxp) a5962b
 #define DES_bs_cpt			1
Lucio Andrés Illanes Albornoz (arab, vxp) a5962b
-extern DES_bs_combined DES_bs_all;
Lucio Andrés Illanes Albornoz (arab, vxp) a5962b
+extern  DES_INTERNAL_CALL DES_bs_combined DES_bs_all;
Lucio Andrés Illanes Albornoz (arab, vxp) a5962b
 #define for_each_t(n)
Lucio Andrés Illanes Albornoz (arab, vxp) a5962b
 #define init_t()
Lucio Andrés Illanes Albornoz (arab, vxp) a5962b
 #endif
Lucio Andrés Illanes Albornoz (arab, vxp) a5962b
@@ -120,7 +130,7 @@
Lucio Andrés Illanes Albornoz (arab, vxp) a5962b
 /*
Lucio Andrés Illanes Albornoz (arab, vxp) a5962b
  * Initializes the internal structures.
Lucio Andrés Illanes Albornoz (arab, vxp) a5962b
  */
Lucio Andrés Illanes Albornoz (arab, vxp) a5962b
-extern void DES_bs_init(int LM, int cpt);
Lucio Andrés Illanes Albornoz (arab, vxp) a5962b
+extern void DES_INTERNAL_CALL DES_bs_init(int LM, int cpt);
Lucio Andrés Illanes Albornoz (arab, vxp) a5962b
 
Lucio Andrés Illanes Albornoz (arab, vxp) a5962b
 /*
Lucio Andrés Illanes Albornoz (arab, vxp) a5962b
  * Sets a salt for DES_bs_crypt().
Lucio Andrés Illanes Albornoz (arab, vxp) a5962b
@@ -139,12 +149,12 @@
Lucio Andrés Illanes Albornoz (arab, vxp) a5962b
 /*
Lucio Andrés Illanes Albornoz (arab, vxp) a5962b
  * Almost generic implementation: 24-bit salts, variable iteration count.
Lucio Andrés Illanes Albornoz (arab, vxp) a5962b
  */
Lucio Andrés Illanes Albornoz (arab, vxp) a5962b
-extern void DES_bs_crypt(int count, int keys_count);
Lucio Andrés Illanes Albornoz (arab, vxp) a5962b
+extern void DES_INTERNAL_CALL DES_bs_crypt(int count, int keys_count);
Lucio Andrés Illanes Albornoz (arab, vxp) a5962b
 
Lucio Andrés Illanes Albornoz (arab, vxp) a5962b
 /*
Lucio Andrés Illanes Albornoz (arab, vxp) a5962b
  * A simplified special-case implementation: 12-bit salts, 25 iterations.
Lucio Andrés Illanes Albornoz (arab, vxp) a5962b
  */
Lucio Andrés Illanes Albornoz (arab, vxp) a5962b
-extern void DES_bs_crypt_25(int keys_count);
Lucio Andrés Illanes Albornoz (arab, vxp) a5962b
+extern void DES_INTERNAL_CALL DES_bs_crypt_25(int keys_count);
Lucio Andrés Illanes Albornoz (arab, vxp) a5962b
 
Lucio Andrés Illanes Albornoz (arab, vxp) a5962b
 /*
Lucio Andrés Illanes Albornoz (arab, vxp) a5962b
  * Another special-case version: a non-zero IV, no salts, no iterations.
Lucio Andrés Illanes Albornoz (arab, vxp) a5962b
diff -ru a/src/Makefile b/src/Makefile
Lucio Andrés Illanes Albornoz (arab, vxp) a5962b
--- a/src/Makefile	2013-05-29 19:21:25.000000000 -0400
Lucio Andrés Illanes Albornoz (arab, vxp) a5962b
+++ b/src/Makefile	2016-08-07 16:23:07.246422700 -0400
Lucio Andrés Illanes Albornoz (arab, vxp) cd059d
@@ -104,6 +104,8 @@
Lucio Andrés Illanes Albornoz (arab, vxp) cd059d
 #	@echo "linux-ppc64-altivec      Linux, PowerPC 64-bit w/AltiVec"
Lucio Andrés Illanes Albornoz (arab, vxp) cd059d
 	@echo "linux-ppc64              Linux, PowerPC 64-bit"
Lucio Andrés Illanes Albornoz (arab, vxp) cd059d
 	@echo "linux-ia64               Linux, IA-64"
Lucio Andrés Illanes Albornoz (arab, vxp) a5962b
+	@echo "midipix-x86-64-avx       Midipix, x86-64 with AVX (2011+ Intel CPUs)"
Lucio Andrés Illanes Albornoz (arab, vxp) a5962b
+	@echo "midipix-x86-64           Midipix, x86-64 with SSE2 (most common)"
Lucio Andrés Illanes Albornoz (arab, vxp) cd059d
 	@echo "freebsd-x86-64           FreeBSD, x86-64 with SSE2 (best)"
Lucio Andrés Illanes Albornoz (arab, vxp) cd059d
 	@echo "freebsd-x86-sse2         FreeBSD, x86 with SSE2 (best if 32-bit)"
Lucio Andrés Illanes Albornoz (arab, vxp) cd059d
 	@echo "freebsd-x86-mmx          FreeBSD, x86 with MMX"
Lucio Andrés Illanes Albornoz (arab, vxp) a5962b
@@ -306,6 +308,22 @@
Lucio Andrés Illanes Albornoz (arab, vxp) cd059d
 		CFLAGS="$(CFLAGS) -DHAVE_CRYPT" \
Lucio Andrés Illanes Albornoz (arab, vxp) cd059d
 		LDFLAGS="$(LDFLAGS) -lcrypt"
Lucio Andrés Illanes Albornoz (arab, vxp) cd059d
 
Lucio Andrés Illanes Albornoz (arab, vxp) a5962b
+midipix-x86-64-avx:
Lucio Andrés Illanes Albornoz (arab, vxp) cd059d
+	$(LN) x86-64.h arch.h
Lucio Andrés Illanes Albornoz (arab, vxp) cd059d
+	$(MAKE) $(PROJ) \
Lucio Andrés Illanes Albornoz (arab, vxp) cd059d
+		JOHN_OBJS="$(JOHN_OBJS) c3_fmt.o x86-64.o" \
Lucio Andrés Illanes Albornoz (arab, vxp) a5962b
+		CFLAGS_MAIN="$(CFLAGS) -DJOHN_AVX -DHAVE_CRYPT" \
Lucio Andrés Illanes Albornoz (arab, vxp) a5962b
+		CFLAGS="$(CFLAGS) -mavx -DHAVE_CRYPT -DHAVE_INTERNAL_ATTR" \
Lucio Andrés Illanes Albornoz (arab, vxp) a5962b
+		ASFLAGS="$(ASFLAGS) -mavx" \
Lucio Andrés Illanes Albornoz (arab, vxp) cd059d
+		LDFLAGS="$(LDFLAGS) -lcrypt"
Lucio Andrés Illanes Albornoz (arab, vxp) cd059d
+
Lucio Andrés Illanes Albornoz (arab, vxp) a5962b
+midipix-x86-64:
Lucio Andrés Illanes Albornoz (arab, vxp) a5962b
+	$(LN) x86-64.h arch.h
Lucio Andrés Illanes Albornoz (arab, vxp) cd059d
+	$(MAKE) $(PROJ) \
Lucio Andrés Illanes Albornoz (arab, vxp) a5962b
+		JOHN_OBJS="$(JOHN_OBJS) c3_fmt.o x86-64.o" \
Lucio Andrés Illanes Albornoz (arab, vxp) a5962b
+		CFLAGS="$(CFLAGS) -DHAVE_CRYPT -DHAVE_INTERNAL_ATTR" \
Lucio Andrés Illanes Albornoz (arab, vxp) cd059d
+		LDFLAGS="$(LDFLAGS) -lcrypt"
Lucio Andrés Illanes Albornoz (arab, vxp) cd059d
+
Lucio Andrés Illanes Albornoz (arab, vxp) cd059d
 freebsd-x86-64:
Lucio Andrés Illanes Albornoz (arab, vxp) cd059d
 	$(LN) x86-64.h arch.h
Lucio Andrés Illanes Albornoz (arab, vxp) cd059d
 	$(MAKE) $(PROJ) \
Lucio Andrés Illanes Albornoz (arab, vxp) a5962b