Merge pull request #167 from gm4tr1x/issue84
authorJens Steube <jens.steube@gmail.com>
Wed, 27 Jan 2016 17:43:18 +0000 (18:43 +0100)
committerJens Steube <jens.steube@gmail.com>
Wed, 27 Jan 2016 17:43:18 +0000 (18:43 +0100)
Issue84

24 files changed:
OpenCL/m00000_a3.cl
OpenCL/m00010_a3.cl
OpenCL/m00020_a3.cl
OpenCL/m00400.cl
OpenCL/m00500.cl
OpenCL/m01600.cl
OpenCL/m02400_a3.cl
OpenCL/m02410_a3.cl
OpenCL/m02500.cl
OpenCL/m06300.cl
OpenCL/m07700_a3.cl
OpenCL/m07800_a3.cl
OpenCL/m10100_a3.cl
OpenCL/m10500.cl
OpenCL/m11900.cl
OpenCL/m12900.cl
OpenCL/m13000.cl
OpenCL/rp.c
include/shared.h
include/types.h
src/Makefile
src/oclHashcat.c
src/rp_kernel_on_cpu.c
src/shared.c

index cedf592..0f6ef0d 100644 (file)
@@ -130,7 +130,7 @@ static void m00000m (u32 w[16], const u32 pw_len, __global pw_t *pws, __global k
 
     const u32x w0 = w0l | w0r;
 
-    u32x tmp2;
+    //u32x tmp2;
 
     u32x a = MD5M_A;
     u32x b = MD5M_B;
@@ -350,7 +350,7 @@ static void m00000s (u32 w[16], const u32 pw_len, __global pw_t *pws, __global k
     const u32x pre_b = b_rev - (pre_a ^ pre_cd);
     const u32x pre_c = c_rev - (pre_a ^ pre_b ^ pre_d);
 
-    u32x tmp2;
+    //u32x tmp2;
 
     u32x a = MD5M_A;
     u32x b = MD5M_B;
index 677fc5a..8374a99 100644 (file)
@@ -187,7 +187,7 @@ static void m00010m (u32 w[16], const u32 pw_len, __global pw_t *pws, __global k
 
     const u32x w0 = w0l | w0r;
 
-    u32x tmp2;
+    //u32x tmp2;
 
     u32x a = MD5M_A;
     u32x b = MD5M_B;
@@ -407,7 +407,7 @@ static void m00010s (u32 w[16], const u32 pw_len, __global pw_t *pws, __global k
     const u32x pre_b = b_rev - (pre_a ^ pre_cd);
     const u32x pre_c = c_rev - (pre_a ^ pre_b ^ pre_d);
 
-    u32x tmp2;
+    //u32x tmp2;
 
     u32x a = MD5M_A;
     u32x b = MD5M_B;
index 0efc98a..cae883f 100644 (file)
@@ -169,7 +169,7 @@ static void m00020m (u32 w0[4], u32 w1[4], u32 w2[4], u32 w3[4], const u32 pw_le
      * md5
      */
 
-    u32x tmp2;
+    //u32x tmp2;
 
     u32x a = MD5M_A;
     u32x b = MD5M_B;
@@ -409,7 +409,7 @@ static void m00020s (u32 w0[4], u32 w1[4], u32 w2[4], u32 w3[4], const u32 pw_le
      * md5
      */
 
-    u32x tmp2;
+    //u32x tmp2;
 
     u32x a = MD5M_A;
     u32x b = MD5M_B;
index b69a816..f4dc23c 100644 (file)
@@ -44,7 +44,7 @@ static void md5_transform (const u32 w0[4], const u32 w1[4], const u32 w2[4], co
   u32 we_t = w3[2];
   u32 wf_t = 0;
 
-  u32 tmp2;
+  //u32 tmp2;
 
   MD5_STEP (MD5_Fo, a, b, c, d, w0_t, MD5C00, MD5S00);
   MD5_STEP (MD5_Fo, d, a, b, c, w1_t, MD5C01, MD5S01);
index 8b2a821..5bd5d90 100644 (file)
@@ -46,7 +46,7 @@ static void md5_transform (const u32 w0[4], const u32 w1[4], const u32 w2[4], co
   u32 we_t = w3[2];
   u32 wf_t = 0;
 
-  u32 tmp2;
+  //u32 tmp2;
 
   MD5_STEP (MD5_Fo, a, b, c, d, w0_t, MD5C00, MD5S00);
   MD5_STEP (MD5_Fo, d, a, b, c, w1_t, MD5C01, MD5S01);
index 9fb95b0..d0b3036 100644 (file)
@@ -47,7 +47,7 @@ static void md5_transform (const u32 w0[4], const u32 w1[4], const u32 w2[4], co
   u32 we_t = w3[2];
   u32 wf_t = 0;
 
-  u32 tmp2;
+  //u32 tmp2;
 
   MD5_STEP (MD5_Fo, a, b, c, d, w0_t, MD5C00, MD5S00);
   MD5_STEP (MD5_Fo, d, a, b, c, w1_t, MD5C01, MD5S01);
index 62cc114..b734ecc 100644 (file)
@@ -120,7 +120,7 @@ static void m02400m (u32 w[16], const u32 pw_len, __global pw_t *pws, __global k
 
     const u32x w0 = w0l | w0r;
 
-    u32x tmp2;
+    //u32x tmp2;
 
     u32x a = MD5M_A;
     u32x b = MD5M_B;
@@ -316,7 +316,7 @@ static void m02400s (u32 w[16], const u32 pw_len, __global pw_t *pws, __global k
 
     const u32x w0 = w0l | w0r;
 
-    u32x tmp2;
+    //u32x tmp2;
 
     u32x a = MD5M_A;
     u32x b = MD5M_B;
index 20edd68..8f12d1e 100644 (file)
@@ -165,7 +165,7 @@ static void m02410m (u32 w[16], const u32 pw_len, __global pw_t *pws, __global k
 
     const u32x w0 = w0l | w0r;
 
-    u32x tmp2;
+    //u32x tmp2;
 
     u32x a = MD5M_A;
     u32x b = MD5M_B;
@@ -406,7 +406,7 @@ static void m02410s (u32 w[16], const u32 pw_len, __global pw_t *pws, __global k
 
     const u32x w0 = w0l | w0r;
 
-    u32x tmp2;
+    //u32x tmp2;
 
     u32x a = MD5M_A;
     u32x b = MD5M_B;
index 9128f29..d75ad78 100644 (file)
@@ -44,7 +44,7 @@ static void md5_transform (const u32 w0[4], const u32 w1[4], const u32 w2[4], co
   u32 we_t = w3[2];
   u32 wf_t = w3[3];
 
-  u32 tmp2;
+  //u32 tmp2;
 
   MD5_STEP (MD5_Fo, a, b, c, d, w0_t, MD5C00, MD5S00);
   MD5_STEP (MD5_Fo, d, a, b, c, w1_t, MD5C01, MD5S01);
index 34457de..f83abff 100644 (file)
@@ -44,7 +44,7 @@ static void md5_transform (const u32 w0[4], const u32 w1[4], const u32 w2[4], co
   u32 we_t = w3[2];
   u32 wf_t = 0;
 
-  u32 tmp2;
+  //u32 tmp2;
 
   MD5_STEP (MD5_Fo, a, b, c, d, w0_t, MD5C00, MD5S00);
   MD5_STEP (MD5_Fo, d, a, b, c, w1_t, MD5C01, MD5S01);
index 0bc3b13..566f77c 100644 (file)
@@ -784,7 +784,7 @@ __kernel void m07700_m04 (__global pw_t *pws, __global kernel_rule_t *rules_buf,
    * modifier
    */
 
-  const u32 lid = get_local_id (0);
+  //const u32 lid = get_local_id (0);
 
   u32 w0[4];
 
@@ -837,7 +837,7 @@ __kernel void m07700_m08 (__global pw_t *pws, __global kernel_rule_t *rules_buf,
    * modifier
    */
 
-  const u32 lid = get_local_id (0);
+  //const u32 lid = get_local_id (0);
 
   u32 w0[4];
 
@@ -894,7 +894,7 @@ __kernel void m07700_s04 (__global pw_t *pws, __global kernel_rule_t *rules_buf,
    * modifier
    */
 
-  const u32 lid = get_local_id (0);
+  //const u32 lid = get_local_id (0);
 
   u32 w0[4];
 
@@ -947,7 +947,7 @@ __kernel void m07700_s08 (__global pw_t *pws, __global kernel_rule_t *rules_buf,
    * modifier
    */
 
-  const u32 lid = get_local_id (0);
+  //const u32 lid = get_local_id (0);
 
   u32 w0[4];
 
index ad5144a..f8afa5e 100644 (file)
@@ -351,7 +351,7 @@ static void m07800m (u32 w0[4], u32 w1[4], u32 w2[4], u32 w3[4], const u32 pw_le
 
     u32 final_len = pw_len;
 
-    int i;
+    u32 i;
 
     // append MagicArray
 
@@ -582,7 +582,7 @@ static void m07800s (u32 w0[4], u32 w1[4], u32 w2[4], u32 w3[4], const u32 pw_le
 
     u32 final_len = pw_len;
 
-    int i;
+    u32 i;
 
     // append MagicArray
 
@@ -654,7 +654,7 @@ __kernel void m07800_m04 (__global pw_t *pws, __global kernel_rule_t *rules_buf,
    * modifier
    */
 
-  const u32 lid = get_local_id (0);
+  //const u32 lid = get_local_id (0);
 
   u32 w0[4];
 
@@ -707,7 +707,7 @@ __kernel void m07800_m08 (__global pw_t *pws, __global kernel_rule_t *rules_buf,
    * modifier
    */
 
-  const u32 lid = get_local_id (0);
+  //const u32 lid = get_local_id (0);
 
   u32 w0[4];
 
@@ -764,7 +764,7 @@ __kernel void m07800_s04 (__global pw_t *pws, __global kernel_rule_t *rules_buf,
    * modifier
    */
 
-  const u32 lid = get_local_id (0);
+  //const u32 lid = get_local_id (0);
 
   u32 w0[4];
 
@@ -817,7 +817,7 @@ __kernel void m07800_s08 (__global pw_t *pws, __global kernel_rule_t *rules_buf,
    * modifier
    */
 
-  const u32 lid = get_local_id (0);
+  //const u32 lid = get_local_id (0);
 
   u32 w0[4];
 
index 076615c..d32e959 100644 (file)
@@ -89,7 +89,7 @@ static void m10100m (u32 w[16], const u32 pw_len, __global pw_t *pws, __global k
 
     v0 ^= m;
 
-    int i;
+    u32 i;
     int j;
 
     for (i = 8, j = 2; i <= pw_len; i += 8, j += 2)
@@ -187,7 +187,7 @@ static void m10100s (u32 w[16], const u32 pw_len, __global pw_t *pws, __global k
 
     v0 ^= m;
 
-    int i;
+    u32 i;
     int j;
 
     for (i = 8, j = 2; i <= pw_len; i += 8, j += 2)
index 4f6f1fe..2b51321 100644 (file)
@@ -176,7 +176,7 @@ static void md5_transform (const u32 w0[4], const u32 w1[4], const u32 w2[4], co
   u32 we_t = w3[2];
   u32 wf_t = w3[3];
 
-  u32 tmp2;
+  //u32 tmp2;
 
   MD5_STEP (MD5_Fo, a, b, c, d, w0_t, MD5C00, MD5S00);
   MD5_STEP (MD5_Fo, d, a, b, c, w1_t, MD5C01, MD5S01);
@@ -259,7 +259,7 @@ __kernel void m10500_init (__global pw_t *pws, __global kernel_rule_t *rules_buf
    */
 
   const u32 gid = get_global_id (0);
-  const u32 lid = get_local_id (0);
+  //const u32 lid = get_local_id (0);
 
   if (gid >= gid_max) return;
 
@@ -290,9 +290,8 @@ __kernel void m10500_init (__global pw_t *pws, __global kernel_rule_t *rules_buf
    * shared
    */
 
-  __local RC4_KEY rc4_keys[64];
-
-  __local RC4_KEY *rc4_key = &rc4_keys[lid];
+  //__local RC4_KEY rc4_keys[64];
+  //__local RC4_KEY *rc4_key = &rc4_keys[lid];
 
   /**
    * U_buf
index f87cfd0..466a035 100644 (file)
@@ -45,7 +45,7 @@ static void md5_transform (const u32 w0[4], const u32 w1[4], const u32 w2[4], co
   u32 we_t = w3[2];
   u32 wf_t = w3[3];
 
-  u32 tmp2;
+  //u32 tmp2;
 
   MD5_STEP (MD5_Fo, a, b, c, d, w0_t, MD5C00, MD5S00);
   MD5_STEP (MD5_Fo, d, a, b, c, w1_t, MD5C01, MD5S01);
index 386b7a2..a2232af 100644 (file)
@@ -235,7 +235,7 @@ __kernel void m12900_init (__global pw_t *pws, __global kernel_rule_t *rules_buf
    */
 
   const u32 gid = get_global_id (0);
-  const u32 lid = get_local_id (0);
+  //const u32 lid = get_local_id (0);
 
   if (gid >= gid_max) return;
 
@@ -271,7 +271,7 @@ __kernel void m12900_init (__global pw_t *pws, __global kernel_rule_t *rules_buf
   w3[2] = pws[gid].i[14];
   w3[3] = pws[gid].i[15];
 
-  const u32 pw_len = pws[gid].pw_len;
+  //const u32 pw_len = pws[gid].pw_len;
 
   w0[0] = swap32 (w0[0]);
   w0[1] = swap32 (w0[1]);
index 39d864b..dce6e9f 100644 (file)
@@ -235,7 +235,7 @@ __kernel void m13000_init (__global pw_t *pws, __global kernel_rule_t *rules_buf
    */
 
   const u32 gid = get_global_id (0);
-  const u32 lid = get_local_id (0);
+  //const u32 lid = get_local_id (0);
 
   if (gid >= gid_max) return;
 
@@ -271,7 +271,7 @@ __kernel void m13000_init (__global pw_t *pws, __global kernel_rule_t *rules_buf
   w3[2] = pws[gid].i[14];
   w3[3] = pws[gid].i[15];
 
-  const u32 pw_len = pws[gid].pw_len;
+  //const u32 pw_len = pws[gid].pw_len;
 
   w0[0] = swap32 (w0[0]);
   w0[1] = swap32 (w0[1]);
index 4abd26d..4c29dcd 100644 (file)
@@ -3,6 +3,10 @@
  * License.....: MIT
  */
 
+u32 apply_rule (const u32 name, const u32 p0, const u32 p1, u32 buf0[4], u32 buf1[4], const u32 in_len);
+u32 apply_rules (const __global u32 *cmds, u32 buf0[4], u32 buf1[4], const u32 len);
+u32 apply_rules_vect (const u32 pw_buf0[4], const u32 pw_buf1[4], const u32 pw_len, const __global kernel_rule_t *rules_buf, const u32 il_pos, u32x w0[4], u32x w1[4]);
+
 static u32 generate_cmask (u32 buf)
 {
   const u32 rmask = ((buf & 0x40404040) >> 1)
index 2ce9727..e92abe4 100644 (file)
@@ -1,5 +1,7 @@
 /**
- * Author......: Jens Steube <jens.steube@gmail.com>
+ * Authors.....: Jens Steube <jens.steube@gmail.com>
+ *               Gabriele Gristina <matrix@hashcat.net>
+ *
  * License.....: MIT
  */
 
 
 #define CL_VENDOR_NV          "NVIDIA Corporation"
 #define CL_VENDOR_AMD         "Advanced Micro Devices, Inc."
+#define CL_VENDOR_APPLE       "Apple"
 #define CL_VENDOR_POCL        "The pocl project"
 
 #define VENDOR_ID_AMD         4098
 #define VENDOR_ID_NV          4318
+#define VENDOR_ID_APPLE       16925952
 #define VENDOR_ID_GENERIC     9999
 
 #define BLOCK_SIZE            64
@@ -179,9 +183,49 @@ extern hc_thread_mutex_t mux_display;
 #define PW_LENGTH_MAX_7400    15
 
 /**
- * device accel / loops macro
+ * device accel macro
  */
 
+#ifdef OSX
+#define KERNEL_ACCEL_5000    16
+#define KERNEL_ACCEL_6100    1
+#define KERNEL_ACCEL_6211    4
+#define KERNEL_ACCEL_6231    1
+#define KERNEL_ACCEL_6241    4
+#define KERNEL_ACCEL_8200    1
+#define KERNEL_ACCEL_8700    2
+#define KERNEL_ACCEL_9500    1
+#define KERNEL_ACCEL_9600    1
+#define KERNEL_ACCEL_10500   4
+#define KERNEL_ACCEL_11300   1
+#define KERNEL_ACCEL_11600   1
+#define KERNEL_ACCEL_11700   1
+#define KERNEL_ACCEL_11800   1
+#define KERNEL_ACCEL_12200   1
+#define KERNEL_ACCEL_12400   1
+#define KERNEL_ACCEL_12500   1
+#define KERNEL_ACCEL_13000   1
+#else
+#define KERNEL_ACCEL_5000    64
+#define KERNEL_ACCEL_6100    8
+#define KERNEL_ACCEL_6211    16
+#define KERNEL_ACCEL_6231    4
+#define KERNEL_ACCEL_6241    32
+#define KERNEL_ACCEL_8200    2
+#define KERNEL_ACCEL_8700    8
+#define KERNEL_ACCEL_9500    8
+#define KERNEL_ACCEL_9600    2
+#define KERNEL_ACCEL_10500   64
+#define KERNEL_ACCEL_11300   2
+#define KERNEL_ACCEL_11600   2
+#define KERNEL_ACCEL_11700   4
+#define KERNEL_ACCEL_11800   4
+#define KERNEL_ACCEL_12200   2
+#define KERNEL_ACCEL_12400   64
+#define KERNEL_ACCEL_12500   8
+#define KERNEL_ACCEL_13000   8
+#endif // OSX
+
 #define KERNEL_ACCEL_0       128
 #define KERNEL_ACCEL_10      128
 #define KERNEL_ACCEL_11      128
@@ -264,7 +308,6 @@ extern hc_thread_mutex_t mux_display;
 #define KERNEL_ACCEL_4700    64
 #define KERNEL_ACCEL_4800    128
 #define KERNEL_ACCEL_4900    64
-#define KERNEL_ACCEL_5000    64
 #define KERNEL_ACCEL_5100    64
 #define KERNEL_ACCEL_5200    8
 #define KERNEL_ACCEL_5300    32
@@ -274,17 +317,13 @@ extern hc_thread_mutex_t mux_display;
 #define KERNEL_ACCEL_5700    64
 #define KERNEL_ACCEL_5800    8
 #define KERNEL_ACCEL_6000    64
-#define KERNEL_ACCEL_6100    8
-#define KERNEL_ACCEL_6211    16
 #define KERNEL_ACCEL_6212    8
 #define KERNEL_ACCEL_6213    8
 #define KERNEL_ACCEL_6221    4
 #define KERNEL_ACCEL_6222    4
 #define KERNEL_ACCEL_6223    4
-#define KERNEL_ACCEL_6231    4
 #define KERNEL_ACCEL_6232    4
 #define KERNEL_ACCEL_6233    4
-#define KERNEL_ACCEL_6241    32
 #define KERNEL_ACCEL_6242    16
 #define KERNEL_ACCEL_6243    16
 #define KERNEL_ACCEL_6300    8
@@ -305,12 +344,10 @@ extern hc_thread_mutex_t mux_display;
 #define KERNEL_ACCEL_7900    2
 #define KERNEL_ACCEL_8000    8
 #define KERNEL_ACCEL_8100    64
-#define KERNEL_ACCEL_8200    2
 #define KERNEL_ACCEL_8300    64
 #define KERNEL_ACCEL_8400    64
 #define KERNEL_ACCEL_8500    64
 #define KERNEL_ACCEL_8600    8
-#define KERNEL_ACCEL_8700    8
 #define KERNEL_ACCEL_8800    8
 #define KERNEL_ACCEL_8900    16
 #define KERNEL_ACCEL_9000    2
@@ -318,8 +355,6 @@ extern hc_thread_mutex_t mux_display;
 #define KERNEL_ACCEL_9200    2
 #define KERNEL_ACCEL_9300    2
 #define KERNEL_ACCEL_9400    8
-#define KERNEL_ACCEL_9500    8
-#define KERNEL_ACCEL_9600    2
 #define KERNEL_ACCEL_9700    8
 #define KERNEL_ACCEL_9710    8
 #define KERNEL_ACCEL_9720    8
@@ -334,7 +369,6 @@ extern hc_thread_mutex_t mux_display;
 #define KERNEL_ACCEL_10400   8
 #define KERNEL_ACCEL_10410   8
 #define KERNEL_ACCEL_10420   8
-#define KERNEL_ACCEL_10500   64
 #define KERNEL_ACCEL_10600   64
 #define KERNEL_ACCEL_10700   1
 #define KERNEL_ACCEL_10800   64
@@ -342,25 +376,143 @@ extern hc_thread_mutex_t mux_display;
 #define KERNEL_ACCEL_11000   64
 #define KERNEL_ACCEL_11100   64
 #define KERNEL_ACCEL_11200   64
-#define KERNEL_ACCEL_11300   2
 #define KERNEL_ACCEL_11400   8
 #define KERNEL_ACCEL_11500   128
-#define KERNEL_ACCEL_11600   2
-#define KERNEL_ACCEL_11700   4
-#define KERNEL_ACCEL_11800   4
 #define KERNEL_ACCEL_11900   2
 #define KERNEL_ACCEL_12000   2
 #define KERNEL_ACCEL_12100   2
-#define KERNEL_ACCEL_12200   2
 #define KERNEL_ACCEL_12300   2
-#define KERNEL_ACCEL_12400   64
-#define KERNEL_ACCEL_12500   8
 #define KERNEL_ACCEL_12600   32
 #define KERNEL_ACCEL_12700   64
 #define KERNEL_ACCEL_12800   64
 #define KERNEL_ACCEL_12900   8
-#define KERNEL_ACCEL_13000   8
 
+/**
+ * device loops macro
+ */
+
+#ifdef OSX
+#define KERNEL_LOOPS_0       2
+#define KERNEL_LOOPS_10      2
+#define KERNEL_LOOPS_11      2
+#define KERNEL_LOOPS_12      2
+#define KERNEL_LOOPS_20      2
+#define KERNEL_LOOPS_21      2
+#define KERNEL_LOOPS_22      2
+#define KERNEL_LOOPS_23      2
+#define KERNEL_LOOPS_30      2
+#define KERNEL_LOOPS_40      2
+#define KERNEL_LOOPS_50      2
+#define KERNEL_LOOPS_60      2
+#define KERNEL_LOOPS_100     2
+#define KERNEL_LOOPS_101     2
+#define KERNEL_LOOPS_110     2
+#define KERNEL_LOOPS_111     2
+#define KERNEL_LOOPS_112     2
+#define KERNEL_LOOPS_120     2
+#define KERNEL_LOOPS_121     2
+#define KERNEL_LOOPS_122     2
+#define KERNEL_LOOPS_124     2
+#define KERNEL_LOOPS_130     2
+#define KERNEL_LOOPS_131     2
+#define KERNEL_LOOPS_132     2
+#define KERNEL_LOOPS_133     2
+#define KERNEL_LOOPS_140     2
+#define KERNEL_LOOPS_141     2
+#define KERNEL_LOOPS_150     2
+#define KERNEL_LOOPS_160     2
+#define KERNEL_LOOPS_190     2
+#define KERNEL_LOOPS_200     2
+#define KERNEL_LOOPS_300     2
+#define KERNEL_LOOPS_900     2
+#define KERNEL_LOOPS_1000    2
+#define KERNEL_LOOPS_1100    2
+#define KERNEL_LOOPS_1400    2
+#define KERNEL_LOOPS_1410    2
+#define KERNEL_LOOPS_1420    2
+#define KERNEL_LOOPS_1421    2
+#define KERNEL_LOOPS_1430    2
+#define KERNEL_LOOPS_1440    2
+#define KERNEL_LOOPS_1441    2
+#define KERNEL_LOOPS_1450    2
+#define KERNEL_LOOPS_1460    2
+#define KERNEL_LOOPS_1700    2
+#define KERNEL_LOOPS_1710    2
+#define KERNEL_LOOPS_1711    2
+#define KERNEL_LOOPS_1720    2
+#define KERNEL_LOOPS_1722    2
+#define KERNEL_LOOPS_1730    2
+#define KERNEL_LOOPS_1731    2
+#define KERNEL_LOOPS_1740    2
+#define KERNEL_LOOPS_1750    2
+#define KERNEL_LOOPS_1760    2
+#define KERNEL_LOOPS_2400    2
+#define KERNEL_LOOPS_2410    2
+#define KERNEL_LOOPS_2600    2
+#define KERNEL_LOOPS_2611    2
+#define KERNEL_LOOPS_2612    2
+#define KERNEL_LOOPS_2711    2
+#define KERNEL_LOOPS_2811    2
+#define KERNEL_LOOPS_3100    2
+#define KERNEL_LOOPS_3200    4
+#define KERNEL_LOOPS_3710    2
+#define KERNEL_LOOPS_3711    2
+#define KERNEL_LOOPS_3800    2
+#define KERNEL_LOOPS_4300    2
+#define KERNEL_LOOPS_4400    2
+#define KERNEL_LOOPS_4500    2
+#define KERNEL_LOOPS_4700    2
+#define KERNEL_LOOPS_4800    2
+#define KERNEL_LOOPS_4900    2
+#define KERNEL_LOOPS_5000    2
+#define KERNEL_LOOPS_5100    2
+#define KERNEL_LOOPS_5300    2
+#define KERNEL_LOOPS_5400    2
+#define KERNEL_LOOPS_5500    2
+#define KERNEL_LOOPS_5600    2
+#define KERNEL_LOOPS_5700    2
+#define KERNEL_LOOPS_6000    2
+#define KERNEL_LOOPS_6100    2
+#define KERNEL_LOOPS_6231    2
+#define KERNEL_LOOPS_6232    2
+#define KERNEL_LOOPS_6233    2
+#define KERNEL_LOOPS_6900    2
+#define KERNEL_LOOPS_7300    2
+#define KERNEL_LOOPS_7500    2
+#define KERNEL_LOOPS_7600    2
+#define KERNEL_LOOPS_7700    2
+#define KERNEL_LOOPS_7800    2
+#define KERNEL_LOOPS_8000    2
+#define KERNEL_LOOPS_8100    2
+#define KERNEL_LOOPS_8300    2
+#define KERNEL_LOOPS_8400    2
+#define KERNEL_LOOPS_8500    2
+#define KERNEL_LOOPS_8600    2
+#define KERNEL_LOOPS_8700    4
+#define KERNEL_LOOPS_9700    2
+#define KERNEL_LOOPS_9710    8
+#define KERNEL_LOOPS_9720    8
+#define KERNEL_LOOPS_9800    2
+#define KERNEL_LOOPS_9810    2
+#define KERNEL_LOOPS_9820    2
+#define KERNEL_LOOPS_9900    2
+#define KERNEL_LOOPS_10100   2
+#define KERNEL_LOOPS_10200   2
+#define KERNEL_LOOPS_10400   2
+#define KERNEL_LOOPS_10410   2
+#define KERNEL_LOOPS_10420   2
+#define KERNEL_LOOPS_10600   2
+#define KERNEL_LOOPS_10700   2
+#define KERNEL_LOOPS_10800   2
+#define KERNEL_LOOPS_11000   2
+#define KERNEL_LOOPS_11100   2
+#define KERNEL_LOOPS_11200   2
+#define KERNEL_LOOPS_11400   2
+#define KERNEL_LOOPS_11500   2
+#define KERNEL_LOOPS_11700   8
+#define KERNEL_LOOPS_11800   8
+#define KERNEL_LOOPS_12600   2
+#else
 #define KERNEL_LOOPS_0       256
 #define KERNEL_LOOPS_10      256
 #define KERNEL_LOOPS_11      256
@@ -393,11 +545,7 @@ extern hc_thread_mutex_t mux_display;
 #define KERNEL_LOOPS_190     128
 #define KERNEL_LOOPS_200     128
 #define KERNEL_LOOPS_300     64
-#define KERNEL_LOOPS_400     256
-#define KERNEL_LOOPS_500     256
-#define KERNEL_LOOPS_501     256
 #define KERNEL_LOOPS_900     256
-#define KERNEL_LOOPS_910     256
 #define KERNEL_LOOPS_1000    256
 #define KERNEL_LOOPS_1100    128
 #define KERNEL_LOOPS_1400    64
@@ -409,8 +557,6 @@ extern hc_thread_mutex_t mux_display;
 #define KERNEL_LOOPS_1441    64
 #define KERNEL_LOOPS_1450    32
 #define KERNEL_LOOPS_1460    32
-#define KERNEL_LOOPS_1500    256
-#define KERNEL_LOOPS_1600    256
 #define KERNEL_LOOPS_1700    32
 #define KERNEL_LOOPS_1710    32
 #define KERNEL_LOOPS_1711    32
@@ -421,17 +567,13 @@ extern hc_thread_mutex_t mux_display;
 #define KERNEL_LOOPS_1740    32
 #define KERNEL_LOOPS_1750    16
 #define KERNEL_LOOPS_1760    16
-#define KERNEL_LOOPS_1800    16
-#define KERNEL_LOOPS_2100    256
 #define KERNEL_LOOPS_2400    256
 #define KERNEL_LOOPS_2410    256
-#define KERNEL_LOOPS_2500    256
 #define KERNEL_LOOPS_2600    128
 #define KERNEL_LOOPS_2611    128
 #define KERNEL_LOOPS_2612    128
 #define KERNEL_LOOPS_2711    64
 #define KERNEL_LOOPS_2811    64
-#define KERNEL_LOOPS_3000    256
 #define KERNEL_LOOPS_3100    16
 #define KERNEL_LOOPS_3200    16
 #define KERNEL_LOOPS_3710    128
@@ -445,88 +587,101 @@ extern hc_thread_mutex_t mux_display;
 #define KERNEL_LOOPS_4900    128
 #define KERNEL_LOOPS_5000    64
 #define KERNEL_LOOPS_5100    256
-#define KERNEL_LOOPS_5200    256
 #define KERNEL_LOOPS_5300    32
 #define KERNEL_LOOPS_5400    32
 #define KERNEL_LOOPS_5500    128
 #define KERNEL_LOOPS_5600    64
 #define KERNEL_LOOPS_5700    64
-#define KERNEL_LOOPS_5800    256
 #define KERNEL_LOOPS_6000    64
 #define KERNEL_LOOPS_6100    64
-#define KERNEL_LOOPS_6211    200
-#define KERNEL_LOOPS_6212    200
-#define KERNEL_LOOPS_6213    200
-#define KERNEL_LOOPS_6221    200
-#define KERNEL_LOOPS_6222    200
-#define KERNEL_LOOPS_6223    200
 #define KERNEL_LOOPS_6231    200
 #define KERNEL_LOOPS_6232    200
 #define KERNEL_LOOPS_6233    200
-#define KERNEL_LOOPS_6241    200
-#define KERNEL_LOOPS_6242    200
-#define KERNEL_LOOPS_6243    200
-#define KERNEL_LOOPS_6300    256
-#define KERNEL_LOOPS_6400    256
-#define KERNEL_LOOPS_6500    256
-#define KERNEL_LOOPS_6600    200
-#define KERNEL_LOOPS_6700    256
-#define KERNEL_LOOPS_6800    200
 #define KERNEL_LOOPS_6900    64
-#define KERNEL_LOOPS_7100    256
-#define KERNEL_LOOPS_7200    200
 #define KERNEL_LOOPS_7300    64
-#define KERNEL_LOOPS_7400    200
 #define KERNEL_LOOPS_7500    16
 #define KERNEL_LOOPS_7600    128
 #define KERNEL_LOOPS_7700    128
 #define KERNEL_LOOPS_7800    64
-#define KERNEL_LOOPS_7900    256
 #define KERNEL_LOOPS_8000    64
 #define KERNEL_LOOPS_8100    128
-#define KERNEL_LOOPS_8200    200
 #define KERNEL_LOOPS_8300    64
 #define KERNEL_LOOPS_8400    64
 #define KERNEL_LOOPS_8500    16
 #define KERNEL_LOOPS_8600    16
 #define KERNEL_LOOPS_8700    16
-#define KERNEL_LOOPS_8800    256
-#define KERNEL_LOOPS_8900    1
-#define KERNEL_LOOPS_9000    16
-#define KERNEL_LOOPS_9100    256
-#define KERNEL_LOOPS_9200    200
-#define KERNEL_LOOPS_9300    1
-#define KERNEL_LOOPS_9400    200
-#define KERNEL_LOOPS_9500    200
-#define KERNEL_LOOPS_9600    200
 #define KERNEL_LOOPS_9700    200
 #define KERNEL_LOOPS_9710    200
 #define KERNEL_LOOPS_9720    200
 #define KERNEL_LOOPS_9800    200
-#define KERNEL_LOOPS_9810    200
 #define KERNEL_LOOPS_9820    200
+#define KERNEL_LOOPS_9810    200
 #define KERNEL_LOOPS_9900    256
-#define KERNEL_LOOPS_10000   200
 #define KERNEL_LOOPS_10100   512
 #define KERNEL_LOOPS_10200   64
-#define KERNEL_LOOPS_10300   128
 #define KERNEL_LOOPS_10400   256
 #define KERNEL_LOOPS_10410   256
 #define KERNEL_LOOPS_10420   256
-#define KERNEL_LOOPS_10500   64
 #define KERNEL_LOOPS_10600   64
 #define KERNEL_LOOPS_10700   64
 #define KERNEL_LOOPS_10800   32
-#define KERNEL_LOOPS_10900   200
 #define KERNEL_LOOPS_11000   256
 #define KERNEL_LOOPS_11100   128
 #define KERNEL_LOOPS_11200   128
-#define KERNEL_LOOPS_11300   256
 #define KERNEL_LOOPS_11400   128
 #define KERNEL_LOOPS_11500   256
-#define KERNEL_LOOPS_11600   512
 #define KERNEL_LOOPS_11700   64
 #define KERNEL_LOOPS_11800   64
+#define KERNEL_LOOPS_12600   32
+#endif // OSX
+
+#define KERNEL_LOOPS_400     256
+#define KERNEL_LOOPS_500     256
+#define KERNEL_LOOPS_501     256
+#define KERNEL_LOOPS_910     256
+#define KERNEL_LOOPS_1500    256
+#define KERNEL_LOOPS_1600    256
+#define KERNEL_LOOPS_1800    16
+#define KERNEL_LOOPS_2100    256
+#define KERNEL_LOOPS_2500    256
+#define KERNEL_LOOPS_3000    256
+#define KERNEL_LOOPS_5200    256
+#define KERNEL_LOOPS_5800    256
+#define KERNEL_LOOPS_6211    200
+#define KERNEL_LOOPS_6212    200
+#define KERNEL_LOOPS_6213    200
+#define KERNEL_LOOPS_6221    200
+#define KERNEL_LOOPS_6222    200
+#define KERNEL_LOOPS_6223    200
+#define KERNEL_LOOPS_6241    200
+#define KERNEL_LOOPS_6242    200
+#define KERNEL_LOOPS_6243    200
+#define KERNEL_LOOPS_6300    256
+#define KERNEL_LOOPS_6400    256
+#define KERNEL_LOOPS_6500    256
+#define KERNEL_LOOPS_6600    200
+#define KERNEL_LOOPS_6700    256
+#define KERNEL_LOOPS_6800    200
+#define KERNEL_LOOPS_7100    256
+#define KERNEL_LOOPS_7200    200
+#define KERNEL_LOOPS_7400    200
+#define KERNEL_LOOPS_7900    256
+#define KERNEL_LOOPS_8200    200
+#define KERNEL_LOOPS_8800    256
+#define KERNEL_LOOPS_8900    1
+#define KERNEL_LOOPS_9000    16
+#define KERNEL_LOOPS_9100    256
+#define KERNEL_LOOPS_9200    200
+#define KERNEL_LOOPS_9300    1
+#define KERNEL_LOOPS_9400    200
+#define KERNEL_LOOPS_9500    200
+#define KERNEL_LOOPS_9600    200
+#define KERNEL_LOOPS_10000   200
+#define KERNEL_LOOPS_10300   128
+#define KERNEL_LOOPS_10500   64
+#define KERNEL_LOOPS_10900   200
+#define KERNEL_LOOPS_11300   256
+#define KERNEL_LOOPS_11600   512
 #define KERNEL_LOOPS_11900   200
 #define KERNEL_LOOPS_12000   200
 #define KERNEL_LOOPS_12100   200
@@ -534,7 +689,6 @@ extern hc_thread_mutex_t mux_display;
 #define KERNEL_LOOPS_12300   256
 #define KERNEL_LOOPS_12400   256
 #define KERNEL_LOOPS_12500   256
-#define KERNEL_LOOPS_12600   32
 #define KERNEL_LOOPS_12700   10
 #define KERNEL_LOOPS_12800   100
 #define KERNEL_LOOPS_12900   64
@@ -1483,14 +1637,14 @@ extern hc_thread_mutex_t mux_display;
  */
 
 #define DGST_SIZE_0                 0
-#define DGST_SIZE_4_2               (2  * sizeof (uint))        // 8
-#define DGST_SIZE_4_4               (4  * sizeof (uint))        // 16
-#define DGST_SIZE_4_5               (5  * sizeof (uint))        // 20
-#define DGST_SIZE_4_6               (6  * sizeof (uint))        // 24
-#define DGST_SIZE_4_8               (8  * sizeof (uint))        // 32
-#define DGST_SIZE_4_16              (16 * sizeof (uint))        // 64 !!!
-#define DGST_SIZE_4_32              (32 * sizeof (uint))        // 128 !!!
-#define DGST_SIZE_4_64              (64 * sizeof (uint))        // 256
+#define DGST_SIZE_4_2               (2  * sizeof (uint))   // 8
+#define DGST_SIZE_4_4               (4  * sizeof (uint))   // 16
+#define DGST_SIZE_4_5               (5  * sizeof (uint))   // 20
+#define DGST_SIZE_4_6               (6  * sizeof (uint))   // 24
+#define DGST_SIZE_4_8               (8  * sizeof (uint))   // 32
+#define DGST_SIZE_4_16              (16 * sizeof (uint))   // 64 !!!
+#define DGST_SIZE_4_32              (32 * sizeof (uint))   // 128 !!!
+#define DGST_SIZE_4_64              (64 * sizeof (uint))   // 256
 #define DGST_SIZE_8_8               (8  * sizeof (u64))    // 64 !!!
 #define DGST_SIZE_8_16              (16 * sizeof (u64))    // 128 !!!
 #define DGST_SIZE_8_25              (25 * sizeof (u64))    // 200
index cff1e02..ac7611a 100644 (file)
@@ -39,22 +39,22 @@ typedef struct
 
 typedef struct
 {
-  int   V;
-  int   R;
-  int   P;
+  int  V;
+  int  R;
+  int  P;
 
-  int   enc_md;
+  int  enc_md;
 
-  uint  id_buf[8];
-  uint  u_buf[32];
-  uint  o_buf[32];
+  uint id_buf[8];
+  uint u_buf[32];
+  uint o_buf[32];
 
-  int   id_len;
-  int   o_len;
-  int   u_len;
+  int  id_len;
+  int  o_len;
+  int  u_len;
 
-  uint  rc4key[2];
-  uint  rc4data[2];
+  uint rc4key[2];
+  uint rc4data[2];
 
 } pdf_t;
 
@@ -161,7 +161,7 @@ typedef struct
 
 typedef struct
 {
-  u8 cipher[1040];
+  u8   cipher[1040];
 
 } agilekey_t;
 
@@ -239,10 +239,10 @@ typedef struct
   {
     uint dgst32[16];
     u64  dgst64[8];
-  };
+  } d;
 
-  uint  dgst_len;
-  uint  W_len;
+  uint dgst_len;
+  uint W_len;
 
 } pdf17l8_tmp_t;
 
@@ -260,10 +260,10 @@ typedef struct
 
 typedef struct
 {
-  u64 l_alt_result[8];
+  u64  l_alt_result[8];
 
-  u64 l_p_bytes[2];
-  u64 l_s_bytes[2];
+  u64  l_p_bytes[2];
+  u64  l_s_bytes[2];
 
 } sha512crypt_tmp_t;
 
@@ -288,7 +288,7 @@ typedef struct
 
 typedef struct
 {
-  u64 dgst[8];
+  u64  dgst[8];
 
 } bitcoin_wallet_tmp_t;
 
@@ -362,11 +362,11 @@ typedef struct
 
 typedef struct
 {
-  u64 ipad[8];
-  u64 opad[8];
+  u64  ipad[8];
+  u64  opad[8];
 
-  u64 dgst[32];
-  u64 out[32];
+  u64  dgst[32];
+  u64  out[32];
 
 } tc64_tmp_t;
 
@@ -415,11 +415,11 @@ typedef struct
 
 typedef struct
 {
-  u64 ipad[8];
-  u64 opad[8];
+  u64  ipad[8];
+  u64  opad[8];
 
-  u64 dgst[8];
-  u64 out[8];
+  u64  dgst[8];
+  u64  out[8];
 
 } sha512aix_tmp_t;
 
@@ -435,7 +435,7 @@ typedef struct
 
 typedef struct
 {
-  u64 digest_buf[8];
+  u64  digest_buf[8];
 
 } drupal7_tmp_t;
 
@@ -463,7 +463,7 @@ typedef struct
 
 typedef struct
 {
-  u64 out[8];
+  u64  out[8];
 
 } office2013_tmp_t;
 
@@ -475,57 +475,57 @@ typedef struct
 
 typedef struct
 {
-  u32 ipad[4];
-  u32 opad[4];
+  u32  ipad[4];
+  u32  opad[4];
 
-  u32 dgst[32];
-  u32 out[32];
+  u32  dgst[32];
+  u32  out[32];
 
 } pbkdf2_md5_tmp_t;
 
 typedef struct
 {
-  u32 ipad[5];
-  u32 opad[5];
+  u32  ipad[5];
+  u32  opad[5];
 
-  u32 dgst[32];
-  u32 out[32];
+  u32  dgst[32];
+  u32  out[32];
 
 } pbkdf2_sha1_tmp_t;
 
 typedef struct
 {
-  u32 ipad[8];
-  u32 opad[8];
+  u32  ipad[8];
+  u32  opad[8];
 
-  u32 dgst[32];
-  u32 out[32];
+  u32  dgst[32];
+  u32  out[32];
 
 } pbkdf2_sha256_tmp_t;
 
 typedef struct
 {
-  u64 ipad[8];
-  u64 opad[8];
+  u64  ipad[8];
+  u64  opad[8];
 
-  u64 dgst[16];
-  u64 out[16];
+  u64  dgst[16];
+  u64  out[16];
 
 } pbkdf2_sha512_tmp_t;
 
 typedef struct
 {
-  u64 out[8];
+  u64  out[8];
 
 } ecryptfs_tmp_t;
 
 typedef struct
 {
-  u64 ipad[8];
-  u64 opad[8];
+  u64  ipad[8];
+  u64  opad[8];
 
-  u64 dgst[16];
-  u64 out[16];
+  u64  dgst[16];
+  u64  out[16];
 
 } oraclet_tmp_t;
 
@@ -613,8 +613,8 @@ typedef struct
 
 typedef struct
 {
-  uint     key;
-  u64 val;
+  uint key;
+  u64  val;
 
 } hcstat_table_t;
 
@@ -662,7 +662,7 @@ typedef struct
 
 typedef struct
 {
-  u64 cnt;
+  u64    cnt;
 
   #ifdef _POSIX
   struct stat stat;
@@ -703,7 +703,7 @@ typedef struct
     u8   hc1[1][256];
     u32  hi1[1][ 64];
     u64  hl1[1][ 32];
-  };
+  } h;
 
   uint pw_len;
   uint alignment_placeholder_1;
@@ -742,31 +742,31 @@ typedef struct
 
 typedef struct
 {
-  u32    version_bin;
-  char        cwd[256];
-  u32    pid;
+  u32  version_bin;
+  char cwd[1024];
+  u32  pid;
 
-  u32    dictpos;
-  u32    maskpos;
+  u32  dictpos;
+  u32  maskpos;
 
-  u64    words_cur;
+  u64  words_cur;
 
-  u32    argc;
-  char      **argv;
+  u32  argc;
+  char **argv;
 
 } restore_data_t;
 
 typedef struct
 {
-  char     *file_name;
-  long      seek;
-  time_t    ctime;
+  char   *file_name;
+  long   seek;
+  time_t ctime;
 
 } outfile_data_t;
 
 typedef struct
 {
-  char     *buf;
+  char *buf;
   u32  incr;
   u32  avail;
   u32  cnt;
@@ -824,165 +824,165 @@ typedef struct
 #define PW_MAX1     (PW_MAX + 1)
 #define PW_DICTMAX  31
 #define PW_DICTMAX1 (PW_DICTMAX + 1)
+#define PARAMCNT    32
 
 struct __hc_device_param
 {
   cl_device_id      device;
   cl_device_type    device_type;
 
-  uint              device_id;
-  uint              platform_devices_id;    // for mapping with hms devices
+  uint    device_id;
+  uint    platform_devices_id;   // for mapping with hms devices
+
+  uint    skipped;
 
-  uint              skipped;
+  uint    sm_major;
+  uint    sm_minor;
+  uint    kernel_exec_timeout;
 
-  uint              sm_major;
-  uint              sm_minor;
-  uint              kernel_exec_timeout;
+  uint    device_processors;
+  uint    device_processor_cores;
+  u64     device_maxmem_alloc;
+  u64     device_global_mem;
+  u32     device_maxclock_frequency;
 
-  uint              device_processors;
-  uint              device_processor_cores;
-  u64               device_maxmem_alloc;
-  u64               device_global_mem;
-  u32               device_maxclock_frequency;
+  uint    vector_width;
 
-  uint              vector_width;
+  uint    kernel_threads;
+  uint    kernel_accel;
+  uint    kernel_power;          // these both are based on their _user counterpart
+  uint    kernel_blocks;         // but are modified by autotuner and used inside crack loops
+  uint    kernel_power_user;
+  uint    kernel_blocks_user;
 
-  uint              kernel_threads;
-  uint              kernel_accel;
-  uint              kernel_power;          // these both are based on their _user counterpart
-  uint              kernel_blocks;         // but are modified by autotuner and used inside crack loops
-  uint              kernel_power_user;
-  uint              kernel_blocks_user;
+  uint    size_pws;
+  uint    size_tmps;
+  uint    size_hooks;
+  uint    size_root_css;
+  uint    size_markov_css;
+  uint    size_digests;
+  uint    size_salts;
+  uint    size_shown;
+  uint    size_results;
+  uint    size_plains;
 
-  uint              size_pws;
-  uint              size_tmps;
-  uint              size_hooks;
-  uint              size_root_css;
-  uint              size_markov_css;
-  uint              size_digests;
-  uint              size_salts;
-  uint              size_shown;
-  uint              size_results;
-  uint              size_plains;
+  uint  (*pw_add)       (struct __hc_device_param *, const u8 *, const uint);
 
-  uint (*pw_add)    (struct __hc_device_param *, const u8 *, const uint);
+  void  (*pw_transpose) (const pw_t *, pw_t *);
 
-  void (*pw_transpose) (const pw_t *, pw_t *);
+  FILE   *combs_fp;
+  comb_t *combs_buf;
 
-  FILE             *combs_fp;
-  comb_t           *combs_buf;
+  void   *hooks_buf;
 
-  void             *hooks_buf;
+  pw_cache_t *pw_caches;
 
-  pw_cache_t       *pw_caches;
+  pw_t   *pws_buf;
+  uint    pws_cnt;
+  u64     pw_cnt;
 
-  pw_t             *pws_buf;
-  uint              pws_cnt;
-  u64               pw_cnt;
+  u64     words_off;
+  u64     words_done;
 
-  u64               words_off;
-  u64               words_done;
+  uint   *result;
 
-  uint             *result;
+  uint    outerloop_pos;
+  uint    outerloop_left;
 
-  uint              outerloop_pos;
-  uint              outerloop_left;
+  uint    innerloop_pos;
+  uint    innerloop_left;
 
-  uint              innerloop_pos;
-  uint              innerloop_left;
+  uint    speed_pos;
+  u64     speed_cnt[SPEED_CACHE];
+  float   speed_ms[SPEED_CACHE];
 
-  uint              speed_pos;
-  u64               speed_cnt[SPEED_CACHE];
-  float             speed_ms[SPEED_CACHE];
-  hc_timer_t        speed_rec[SPEED_CACHE];
+  hc_timer_t speed_rec[SPEED_CACHE];
 
-  hc_timer_t        timer_speed;
+  hc_timer_t timer_speed;
 
   // device specific attributes starting
 
-  char             *device_name;
-  char             *device_name_chksum;
-  char             *device_version;
-  char             *driver_version;
-
-  cl_uint           vendor_id;
-
-  cl_kernel         kernel1;
-  cl_kernel         kernel12;
-  cl_kernel         kernel2;
-  cl_kernel         kernel23;
-  cl_kernel         kernel3;
-  cl_kernel         kernel_mp;
-  cl_kernel         kernel_mp_l;
-  cl_kernel         kernel_mp_r;
-  cl_kernel         kernel_amp;
-  cl_kernel         kernel_tb;
-  cl_kernel         kernel_tm;
-  cl_kernel         kernel_weak;
-
-  cl_context        context;
-
-  cl_program        program;
-  cl_program        program_mp;
-  cl_program        program_amp;
-  cl_program        program_weak;
-
-  cl_command_queue  command_queue;
-
-  cl_mem            d_pws_buf;
-  cl_mem            d_pws_amp_buf;
-  cl_mem            d_words_buf_l;
-  cl_mem            d_words_buf_r;
-  cl_mem            d_rules;
-  cl_mem            d_rules_c;
-  cl_mem            d_combs;
-  cl_mem            d_combs_c;
-  cl_mem            d_bfs;
-  cl_mem            d_bfs_c;
-  cl_mem            d_tm_c;
-  cl_mem            d_bitmap_s1_a;
-  cl_mem            d_bitmap_s1_b;
-  cl_mem            d_bitmap_s1_c;
-  cl_mem            d_bitmap_s1_d;
-  cl_mem            d_bitmap_s2_a;
-  cl_mem            d_bitmap_s2_b;
-  cl_mem            d_bitmap_s2_c;
-  cl_mem            d_bitmap_s2_d;
-  cl_mem            d_plain_bufs;
-  cl_mem            d_digests_buf;
-  cl_mem            d_digests_shown;
-  cl_mem            d_salt_bufs;
-  cl_mem            d_esalt_bufs;
-  cl_mem            d_bcrypt_bufs;
-  cl_mem            d_tmps;
-  cl_mem            d_hooks;
-  cl_mem            d_result;
-  cl_mem            d_scryptV_buf;
-  cl_mem            d_root_css_buf;
-  cl_mem            d_markov_css_buf;
-
-  #define PARAMCNT 32
-
-  void             *kernel_params[PARAMCNT];
-  void             *kernel_params_mp[PARAMCNT];
-  void             *kernel_params_mp_r[PARAMCNT];
-  void             *kernel_params_mp_l[PARAMCNT];
-  void             *kernel_params_amp[PARAMCNT];
-  void             *kernel_params_tb[PARAMCNT];
-  void             *kernel_params_tm[PARAMCNT];
-
-  u32          kernel_params_buf32[PARAMCNT];
-
-  u32          kernel_params_mp_buf32[PARAMCNT];
-  u64          kernel_params_mp_buf64[PARAMCNT];
-
-  u32          kernel_params_mp_r_buf32[PARAMCNT];
-  u64          kernel_params_mp_r_buf64[PARAMCNT];
-
-  u32          kernel_params_mp_l_buf32[PARAMCNT];
-  u64          kernel_params_mp_l_buf64[PARAMCNT];
-
-  u32          kernel_params_amp_buf32[PARAMCNT];
+  char   *device_name;
+  char   *device_name_chksum;
+  char   *device_version;
+  char   *driver_version;
+
+  cl_uint vendor_id;
+
+  cl_kernel  kernel1;
+  cl_kernel  kernel12;
+  cl_kernel  kernel2;
+  cl_kernel  kernel23;
+  cl_kernel  kernel3;
+  cl_kernel  kernel_mp;
+  cl_kernel  kernel_mp_l;
+  cl_kernel  kernel_mp_r;
+  cl_kernel  kernel_amp;
+  cl_kernel  kernel_tb;
+  cl_kernel  kernel_tm;
+  cl_kernel  kernel_weak;
+
+  cl_context context;
+
+  cl_program program;
+  cl_program program_mp;
+  cl_program program_amp;
+  cl_program program_weak;
+
+  cl_command_queue command_queue;
+
+  cl_mem  d_pws_buf;
+  cl_mem  d_pws_amp_buf;
+  cl_mem  d_words_buf_l;
+  cl_mem  d_words_buf_r;
+  cl_mem  d_rules;
+  cl_mem  d_rules_c;
+  cl_mem  d_combs;
+  cl_mem  d_combs_c;
+  cl_mem  d_bfs;
+  cl_mem  d_bfs_c;
+  cl_mem  d_tm_c;
+  cl_mem  d_bitmap_s1_a;
+  cl_mem  d_bitmap_s1_b;
+  cl_mem  d_bitmap_s1_c;
+  cl_mem  d_bitmap_s1_d;
+  cl_mem  d_bitmap_s2_a;
+  cl_mem  d_bitmap_s2_b;
+  cl_mem  d_bitmap_s2_c;
+  cl_mem  d_bitmap_s2_d;
+  cl_mem  d_plain_bufs;
+  cl_mem  d_digests_buf;
+  cl_mem  d_digests_shown;
+  cl_mem  d_salt_bufs;
+  cl_mem  d_esalt_bufs;
+  cl_mem  d_bcrypt_bufs;
+  cl_mem  d_tmps;
+  cl_mem  d_hooks;
+  cl_mem  d_result;
+  cl_mem  d_scryptV_buf;
+  cl_mem  d_root_css_buf;
+  cl_mem  d_markov_css_buf;
+
+  void   *kernel_params[PARAMCNT];
+  void   *kernel_params_mp[PARAMCNT];
+  void   *kernel_params_mp_r[PARAMCNT];
+  void   *kernel_params_mp_l[PARAMCNT];
+  void   *kernel_params_amp[PARAMCNT];
+  void   *kernel_params_tb[PARAMCNT];
+  void   *kernel_params_tm[PARAMCNT];
+
+  u32     kernel_params_buf32[PARAMCNT];
+
+  u32     kernel_params_mp_buf32[PARAMCNT];
+  u64     kernel_params_mp_buf64[PARAMCNT];
+
+  u32     kernel_params_mp_r_buf32[PARAMCNT];
+  u64     kernel_params_mp_r_buf64[PARAMCNT];
+
+  u32     kernel_params_mp_l_buf32[PARAMCNT];
+  u64     kernel_params_mp_l_buf64[PARAMCNT];
+
+  u32     kernel_params_amp_buf32[PARAMCNT];
 };
 
 typedef struct __hc_device_param hc_device_param_t;
@@ -1002,12 +1002,11 @@ typedef struct
 
   } adapter_index;
 
-  int od_version;
+  int     od_version;
+  int     fan_supported;
 
-  int fan_supported;
-
-  // int busid; // used for CL_DEVICE_TOPOLOGY_AMD but broken for dual GPUs
-  // int devid; // used for CL_DEVICE_TOPOLOGY_AMD but broken for dual GPUs
+  // int     busid; // used for CL_DEVICE_TOPOLOGY_AMD but broken for dual GPUs
+  // int     devid; // used for CL_DEVICE_TOPOLOGY_AMD but broken for dual GPUs
 
 } hm_attrs_t;
 #endif // HAVE_HWMON
@@ -1018,43 +1017,45 @@ typedef struct
    * threads
    */
 
-  uint                devices_status;
-  uint                devices_cnt;
-  uint                devices_active;
-  hc_device_param_t  *devices_param;
+  uint    devices_status;
+  uint    devices_cnt;
+  uint    devices_active;
+
+  hc_device_param_t *devices_param;
 
-  uint                kernel_blocks_all;
+  uint    kernel_blocks_all;
 
   /**
    * attack specific
    */
 
-  uint                wordlist_mode;
-  uint                hashlist_mode;
-  uint                hashlist_format;
+  uint    wordlist_mode;
+  uint    hashlist_mode;
+  uint    hashlist_format;
+
+  uint    attack_mode;
+  uint    attack_kern;
+  uint    attack_exec;
 
-  uint                attack_mode;
-  uint                attack_kern;
-  uint                attack_exec;
+  uint    kernel_rules_cnt;
 
-  uint                kernel_rules_cnt;
-  kernel_rule_t      *kernel_rules_buf;
+  kernel_rule_t *kernel_rules_buf;
 
-  uint                combs_mode;
-  uint                combs_cnt;
+  uint    combs_mode;
+  uint    combs_cnt;
 
-  uint                bfs_cnt;
+  uint    bfs_cnt;
 
-  uint                css_cnt;
-  cs_t               *css_buf;
+  uint    css_cnt;
+  cs_t   *css_buf;
 
-  cs_t               *root_css_buf;
-  cs_t               *markov_css_buf;
+  cs_t   *root_css_buf;
+  cs_t   *markov_css_buf;
 
-  char               *rule_buf_l;
-  char               *rule_buf_r;
-  int                 rule_len_l;
-  int                 rule_len_r;
+  char   *rule_buf_l;
+  char   *rule_buf_r;
+  int     rule_len_l;
+  int     rule_len_r;
 
   /**
    * opencl
@@ -1067,30 +1068,30 @@ typedef struct
    */
 
   #ifdef HAVE_HWMON
-  HM_LIB              hm_dll_nv;
-  HM_LIB              hm_dll_amd;
-  hm_attrs_t          hm_device[DEVICES_MAX];
+  HM_LIB  hm_dll_nv;
+  HM_LIB  hm_dll_amd;
+  hm_attrs_t hm_device[DEVICES_MAX];
   #endif
 
   /**
    * hashes
    */
 
-  uint                digests_cnt;
-  uint                digests_done;
-  uint                digests_saved;
+  uint    digests_cnt;
+  uint    digests_done;
+  uint    digests_saved;
 
-  void               *digests_buf;
-  uint               *digests_shown;
-  uint               *digests_shown_tmp;
+  void   *digests_buf;
+  uint   *digests_shown;
+  uint   *digests_shown_tmp;
 
-  uint                salts_cnt;
-  uint                salts_done;
+  uint    salts_cnt;
+  uint    salts_done;
 
-  salt_t             *salts_buf;
-  uint               *salts_shown;
+  salt_t *salts_buf;
+  uint   *salts_shown;
 
-  void               *esalts_buf;
+  void   *esalts_buf;
 
   /**
    * logging
@@ -1105,10 +1106,10 @@ typedef struct
    * crack-per-time
    */
 
-  cpt_t  cpt_buf[CPT_BUF];
-  int    cpt_pos;
-  time_t cpt_start;
-  u64 cpt_total;
+  cpt_t   cpt_buf[CPT_BUF];
+  int     cpt_pos;
+  time_t  cpt_start;
+  u64     cpt_total;
 
   /**
    * user
@@ -1195,42 +1196,42 @@ typedef struct
    * used for restore
    */
 
-  u64 skip;
-  u64 limit;
+  u64     skip;
+  u64     limit;
 
   restore_data_t *rd;
 
-  u64 checkpoint_cur_words;  // used for the "stop at next checkpoint" feature
+  u64     checkpoint_cur_words;     // used for the "stop at next checkpoint" feature
 
   /**
    * status, timer
    */
 
-  time_t     runtime_start;
-  time_t     runtime_stop;
+  time_t  runtime_start;
+  time_t  runtime_stop;
 
-  time_t     proc_start;
-  time_t     proc_stop;
+  time_t  proc_start;
+  time_t  proc_stop;
 
-  u64   words_cnt;
-  u64   words_cur;
-  u64   words_base;
+  u64     words_cnt;
+  u64     words_cur;
+  u64     words_base;
 
-  u64  *words_progress_done;      // progress number of words done     per salt
-  u64  *words_progress_rejected;  // progress number of words rejected per salt
-  u64  *words_progress_restored;  // progress number of words restored per salt
+  u64    *words_progress_done;      // progress number of words done     per salt
+  u64    *words_progress_rejected;  // progress number of words rejected per salt
+  u64    *words_progress_restored;  // progress number of words restored per salt
 
   hc_timer_t timer_running;         // timer on current dict
   hc_timer_t timer_paused;          // timer on current dict
 
-  float      ms_paused;             // timer on current dict
+  float   ms_paused;                // timer on current dict
 
   /**
     * hash_info and username
     */
 
   hashinfo_t **hash_info;
-  uint         username;
+  uint    username;
 
   int (*sort_by_digest) (const void *, const void *);
 
index b33adc5..b92dee9 100644 (file)
@@ -125,7 +125,7 @@ VERSION_SUM              := $(shell git describe --tags --dirty=+ | cut -d- -f3)
 CFLAGS                   := -O2 -pipe -W -Wall -std=c99 -Iinclude/
 
 ifeq ($(DEBUG),1)
-CFLAGS                   += -g -ggdb -fsanitize=address -fno-omit-frame-pointer
+CFLAGS                   += -DDEBUG -g -ggdb -fsanitize=address -fno-omit-frame-pointer
 endif
 
 ##
index da3732c..5ba2c99 100644 (file)
@@ -162,10 +162,10 @@ static uint default_benchmark_algorithms[NUM_DEFAULT_BENCHMARK_ALGORITHMS] =
   5000,
   10100,
   6000,
-  6100,
-  6900,
-  11700,
-  11800,
+  6100, // broken in osx
+  6900, // broken in osx
+  11700, // broken in osx
+  11800, // broken in osx
   400,
   8900,
   11900,
@@ -174,55 +174,55 @@ static uint default_benchmark_algorithms[NUM_DEFAULT_BENCHMARK_ALGORITHMS] =
   12100,
   23,
   2500,
-  5300,
-  5400,
-  5500,
-  5600,
+  5300, // broken in osx
+  5400, // broken in osx
+  5500, // broken in osx
+  5600, // broken in osx
   7300,
-  7500,
+  7500, // broken in osx
   8300,
-  11100,
+  11100, // broken in osx
   11200,
-  11400,
+  11400, // broken in osx
   121,
-  2611,
-  2711,
-  2811,
-  8400,
+  2611, // broken in osx
+  2711, // broken in osx
+  2811, // broken in osx
+  8400, // broken in osx
   11,
-  2612,
+  2612, // broken in osx
   7900,
   21,
   11000,
   124,
   10000,
-  3711,
-  7600,
+  3711, // broken in osx
+  7600, // broken in osx
   12,
   131,
   132,
   1731,
   200,
   300,
-  3100,
+  3100, // broken in osx
   112,
   12300,
-  8000,
+  8000, // broken in osx
   141,
   1441,
   1600,
-  12600,
+  12600, // broken in osx
   1421,
   101,
   111,
   1711,
-  3000,
+  3000, // broken in osx
   1000,
   1100,
   2100,
   12800,
-  1500,
-  12400,
+  1500, // broken in osx
+  12400, // broken in osx
   500,
   3200,
   7400,
@@ -243,45 +243,45 @@ static uint default_benchmark_algorithms[NUM_DEFAULT_BENCHMARK_ALGORITHMS] =
   501,
   5800,
   8100,
-  8500,
+  8500, // broken in osx
   7200,
   9900,
   7700,
   7800,
   10300,
-  8600,
-  8700,
-  9100,
+  8600, // broken in osx
+  8700, // broken in osx
+  9100, // broken in osx
   133,
-  11600,
-  12500,
+  11600, // broken in osx
+  12500, // broken in osx
   13000,
   6211,
   6221,
-  6231,
+  6231, // broken in osx
   6241,
-  8800,
+  8800, // broken in osx
   12900,
   12200,
-  9700,
-  9710,
-  9800,
-  9810,
-  9400,
-  9500,
-  9600,
-  10400,
-  10410,
+  9700, // broken in osx
+  9710, // broken in osx
+  9800, // broken in osx
+  9810, // broken in osx
+  9400, // broken in osx
+  9500, // broken in osx
+  9600, // broken in osx
+  10400, // broken in osx
+  10410, // broken in osx
   10500,
   10600,
-  10700,
+  10700, // broken in osx
   9000,
   5200,
-  6800,
-  6600,
+  6800, // broken in osx
+  6600, // broken in osx
   8200,
-  11300,
-  12700
+  11300, // broken in osx
+  12700 // broken in osx
 };
 
 /**
@@ -1883,7 +1883,7 @@ static void check_hash (hc_device_param_t *device_param, const uint salt_pos, co
 
     for (int i = 0, j = gidm; i < 16; i++, j++)
     {
-      plain_buf[i] = pw.hi1[0][j];
+      plain_buf[i] = pw.h.hi1[0][j];
     }
 
     plain_len = pw.pw_len;
@@ -1932,7 +1932,7 @@ static void check_hash (hc_device_param_t *device_param, const uint salt_pos, co
 
     for (int i = 0, j = gidm; i < 16; i++, j++)
     {
-      plain_buf[i] = pw.hi1[0][j];
+      plain_buf[i] = pw.h.hi1[0][j];
     }
 
     plain_len = pw.pw_len;
@@ -1993,7 +1993,7 @@ static void check_hash (hc_device_param_t *device_param, const uint salt_pos, co
 
     for (int i = 0, j = gidm; i < 16; i++, j++)
     {
-      plain_buf[i] = pw.hi1[0][j];
+      plain_buf[i] = pw.h.hi1[0][j];
     }
 
     plain_len = pw.pw_len;
@@ -2027,7 +2027,7 @@ static void check_hash (hc_device_param_t *device_param, const uint salt_pos, co
 
     for (int i = 0, j = gidm; i < 16; i++, j++)
     {
-      plain_buf[i] = pw.hi1[0][j];
+      plain_buf[i] = pw.h.hi1[0][j];
     }
 
     plain_len = pw.pw_len;
@@ -3341,7 +3341,7 @@ static u64 count_words (wl_data_t *wl_data, FILE *fd, char *dictfile, dictstat_t
 
 static void pw_transpose_to_hi1 (const pw_t *p1, pw_t *p2)
 {
-  memcpy (p2->hi1, p1->hi1, 64 * sizeof (uint));
+  memcpy (p2->h.hi1, p1->h.hi1, 64 * sizeof (uint));
 }
 
 static uint pw_add_to_hc1 (hc_device_param_t *device_param, const u8 *pw_buf, const uint pw_len)
@@ -3352,7 +3352,7 @@ static uint pw_add_to_hc1 (hc_device_param_t *device_param, const u8 *pw_buf, co
 
   uint cache_cnt = pw_cache->cnt;
 
-  u8 *pw_hc1 = pw_cache->pw_buf.hc1[cache_cnt];
+  u8 *pw_hc1 = pw_cache->pw_buf.h.hc1[cache_cnt];
 
   memcpy (pw_hc1, pw_buf, pw_len);
 
@@ -11399,7 +11399,9 @@ int main (int argc, char **argv)
                        kernel_accel = 16;
                        break;
           case  6211:  kernel_loops = ROUNDS_TRUECRYPT_2K;
+                       #ifndef OSX
                        kernel_accel = 64;
+                       #endif
                        break;
           case  6212:  kernel_loops = ROUNDS_TRUECRYPT_2K;
                        kernel_accel = 32;
@@ -11426,7 +11428,9 @@ int main (int argc, char **argv)
                        kernel_accel = 8;
                        break;
           case  6241:  kernel_loops = ROUNDS_TRUECRYPT_1K;
+                       #ifndef OSX
                        kernel_accel = 128;
+                       #endif
                        break;
           case  6242:  kernel_loops = ROUNDS_TRUECRYPT_1K;
                        kernel_accel = 64;
@@ -11456,7 +11460,9 @@ int main (int argc, char **argv)
                        kernel_accel = 8;
                        break;
           case  7200:  kernel_loops = ROUNDS_GRUB;
+                       #ifndef OSX
                        kernel_accel = 16;
+                       #endif
                        break;
           case  7400:  kernel_loops = ROUNDS_SHA256CRYPT;
                        kernel_accel = 8;
@@ -13209,6 +13215,37 @@ int main (int argc, char **argv)
     #endif // HAVE_ADK
     #endif // HAVE_HWMON
 
+    #ifdef OSX
+    /*
+     * List of OSX kernel to fix
+     */
+    if ((hash_mode == 6100)  || (hash_mode == 6900)  || (hash_mode == 11700) || (hash_mode == 11800) || (hash_mode == 5300)  || \
+        (hash_mode == 5400)  || (hash_mode == 5500)  || (hash_mode == 5600)  || (hash_mode == 7500)  || (hash_mode == 11100) || \
+        (hash_mode == 11400) || (hash_mode == 2611)  || (hash_mode == 2711)  || (hash_mode == 2811)  || (hash_mode == 8400)  || \
+        (hash_mode == 2612)  || (hash_mode == 3711)  || (hash_mode == 7600)  || (hash_mode == 3100)  || (hash_mode == 8000)  || \
+        (hash_mode == 12600) || (hash_mode == 3000)  || (hash_mode == 1500)  || (hash_mode == 12400) || (hash_mode == 8500)  || \
+        (hash_mode == 8600)  || (hash_mode == 8700)  || (hash_mode == 9100)  || (hash_mode == 11600) || (hash_mode == 12500) || \
+        (hash_mode == 6231)  || (hash_mode == 8800)  || (hash_mode == 9700)  || (hash_mode == 9710)  || (hash_mode == 9800)  || \
+        (hash_mode == 9810)  || (hash_mode == 9400)  || (hash_mode == 9500)  || (hash_mode == 9600)  || (hash_mode == 10400) || \
+        (hash_mode == 10410) || (hash_mode == 10700) || (hash_mode == 6800)  || (hash_mode == 6600)  || (hash_mode == 11300) || \
+        (hash_mode == 12700))
+    {
+      if (force == 0)
+      {
+        log_info ("");
+        log_info ("Warning: Hash mode %d is not stable in OSX.", hash_mode);
+        log_info ("You can use --force to override this but do not post error reports if you do so");
+        log_info ("");
+
+        continue;
+      }
+    }
+    #endif
+
+    #ifdef DEBUG
+    if (benchmark == 1) log_info ("Hashmode: %d", data.hash_mode);
+    #endif
+
     uint kernel_blocks_all = 0;
 
     for (uint device_id = 0; device_id < devices_cnt; device_id++)
@@ -15640,9 +15677,9 @@ int main (int argc, char **argv)
 
           // some more resets:
 
-          memset (device_param->pw_caches, 0, 64 * sizeof (pw_cache_t));
+          if (device_param->pw_caches) memset (device_param->pw_caches, 0, 64 * sizeof (pw_cache_t));
 
-          memset (device_param->pws_buf, 0, device_param->size_pws);
+          if (device_param->pws_buf) memset (device_param->pws_buf, 0, device_param->size_pws);
 
           device_param->pw_cnt  = 0;
           device_param->pws_cnt = 0;
index 862cba5..3cc869c 100644 (file)
@@ -1663,6 +1663,7 @@ static u32 rule_op_mangle_replace (const u32 p0, const u32 p1, u32 buf0[4], u32
   return in_len;
 }
 
+/*
 static u32 rule_op_mangle_purgechar (const u32 p0, const u32 p1, u32 buf0[4], u32 buf1[4], const u32 in_len)
 {
   // TODO
@@ -1674,6 +1675,7 @@ static u32 rule_op_mangle_togglecase_rec (const u32 p0, const u32 p1, u32 buf0[4
   // TODO
   return in_len;
 }
+*/
 
 static u32 rule_op_mangle_dupechar_first (const u32 p0, const u32 p1, u32 buf0[4], u32 buf1[4], const u32 in_len)
 {
index a259c79..111f547 100644 (file)
@@ -8628,9 +8628,9 @@ void myquit ()
 
 void load_kernel (const char *kernel_file, int num_devices, size_t *kernel_lengths, const u8 **kernel_sources)
 {
-  FILE *fp;
+  FILE *fp = fopen (kernel_file, "rb");
 
-  if ((fp = fopen (kernel_file, "rb")) != NULL)
+  if (fp != NULL)
   {
     struct stat st;