Move macros DGST_R0 - DGST_R3 to host, define dgst_size for opencl kernel from host...
[hashcat.git] / OpenCL / m02500.cl
index d36993a..1501034 100644 (file)
@@ -7,21 +7,15 @@
 
 #define NEW_SIMD_CODE
 
-#include "include/constants.h"
-#include "include/kernel_vendor.h"
+#include "inc_vendor.cl"
+#include "inc_hash_constants.h"
+#include "inc_hash_functions.cl"
+#include "inc_types.cl"
+#include "inc_common.cl"
+#include "inc_simd.cl"
 
-#define DGST_R0 0
-#define DGST_R1 1
-#define DGST_R2 2
-#define DGST_R3 3
-
-#include "include/kernel_functions.c"
-#include "OpenCL/types_ocl.c"
-#include "OpenCL/common.c"
-#include "OpenCL/simd.c"
-
-#define COMPARE_S "OpenCL/check_single_comp4.c"
-#define COMPARE_M "OpenCL/check_multi_comp4.c"
+#define COMPARE_S "inc_comp_single.cl"
+#define COMPARE_M "inc_comp_multi.cl"
 
 void md5_transform_S (const u32 w0[4], const u32 w1[4], const u32 w2[4], const u32 w3[4], u32 digest[4])
 {
@@ -768,17 +762,17 @@ __kernel void m02500_loop (__global pw_t *pws, __global kernel_rule_t *rules_buf
     u32x dgst[5];
     u32x out[5];
 
-    dgst[0] = packv (tmps, dgst, gid, 0);
-    dgst[1] = packv (tmps, dgst, gid, 1);
-    dgst[2] = packv (tmps, dgst, gid, 2);
-    dgst[3] = packv (tmps, dgst, gid, 3);
-    dgst[4] = packv (tmps, dgst, gid, 4);
+    dgst[0] = packv (tmps, dgst, gid, i + 0);
+    dgst[1] = packv (tmps, dgst, gid, i + 1);
+    dgst[2] = packv (tmps, dgst, gid, i + 2);
+    dgst[3] = packv (tmps, dgst, gid, i + 3);
+    dgst[4] = packv (tmps, dgst, gid, i + 4);
 
-    out[0] = packv (tmps, out, gid, 0);
-    out[1] = packv (tmps, out, gid, 1);
-    out[2] = packv (tmps, out, gid, 2);
-    out[3] = packv (tmps, out, gid, 3);
-    out[4] = packv (tmps, out, gid, 4);
+    out[0] = packv (tmps, out, gid, i + 0);
+    out[1] = packv (tmps, out, gid, i + 1);
+    out[2] = packv (tmps, out, gid, i + 2);
+    out[3] = packv (tmps, out, gid, i + 3);
+    out[4] = packv (tmps, out, gid, i + 4);
 
     for (u32 j = 0; j < loop_cnt; j++)
     {
@@ -813,17 +807,17 @@ __kernel void m02500_loop (__global pw_t *pws, __global kernel_rule_t *rules_buf
       out[4] ^= dgst[4];
     }
 
-    unpackv (tmps, dgst, gid, 0, dgst[0]);
-    unpackv (tmps, dgst, gid, 1, dgst[1]);
-    unpackv (tmps, dgst, gid, 2, dgst[2]);
-    unpackv (tmps, dgst, gid, 3, dgst[3]);
-    unpackv (tmps, dgst, gid, 4, dgst[4]);
-
-    unpackv (tmps, out, gid, 0, out[0]);
-    unpackv (tmps, out, gid, 1, out[1]);
-    unpackv (tmps, out, gid, 2, out[2]);
-    unpackv (tmps, out, gid, 3, out[3]);
-    unpackv (tmps, out, gid, 4, out[4]);
+    unpackv (tmps, dgst, gid, i + 0, dgst[0]);
+    unpackv (tmps, dgst, gid, i + 1, dgst[1]);
+    unpackv (tmps, dgst, gid, i + 2, dgst[2]);
+    unpackv (tmps, dgst, gid, i + 3, dgst[3]);
+    unpackv (tmps, dgst, gid, i + 4, dgst[4]);
+
+    unpackv (tmps, out, gid, i + 0, out[0]);
+    unpackv (tmps, out, gid, i + 1, out[1]);
+    unpackv (tmps, out, gid, i + 2, out[2]);
+    unpackv (tmps, out, gid, i + 3, out[3]);
+    unpackv (tmps, out, gid, i + 4, out[4]);
   }
 }