Move macros DGST_R0 - DGST_R3 to host, define dgst_size for opencl kernel from host...
[hashcat.git] / OpenCL / m01500_a3.cl
index 6b29a9a..2a73789 100644 (file)
@@ -7,20 +7,14 @@
 
 #define _DES_
 
-#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"
 
-#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"
-
-#define COMPARE_S "OpenCL/check_single_comp4_bs.c"
-#define COMPARE_M "OpenCL/check_multi_comp4_bs.c"
+#define COMPARE_S "inc_comp_single_bs.cl"
+#define COMPARE_M "inc_comp_multi_bs.cl"
 
 #define myselx(a,b,c) ((c) ? (b) : (a))
 
@@ -1569,17 +1563,9 @@ void DESCrypt (const u32 SALT, const u32 K00, const u32 K01, const u32 K02, cons
 
   for (u32 ii = 0; ii < 25; ii++)
   {
-    #ifdef IS_NV
-    #if CUDA_ARCH >= 500
-    #else
+    #ifdef _unroll
     #pragma unroll
     #endif
-    #endif
-
-    #ifdef IS_AMD
-    #pragma unroll
-    #endif
-
     for (u32 i = 0; i < 2; i++)
     {
       if (i) KEYSET10 else KEYSET00
@@ -1705,17 +1691,9 @@ void DESCrypt (const u32 SALT, const u32 K00, const u32 K01, const u32 K02, cons
 
   for (u32 ii = 0; ii < 25; ii++)
   {
-    #ifdef IS_NV
-    #if CUDA_ARCH >= 500
-    #else
+    #ifdef _unroll
     #pragma unroll
     #endif
-    #endif
-
-    #ifdef IS_AMD
-    #pragma unroll
-    #endif
-
     for (u32 i = 0; i < 2; i++)
     {
       if (i) KEYSET10 else KEYSET00
@@ -2222,7 +2200,9 @@ void m01500m (__global pw_t *pws, __global kernel_rule_t *rules_buf, __global co
 
       u32 tmpResult = 0;
 
+      #ifdef _unroll
       #pragma unroll
+      #endif
       for (int i = 0; i < 32; i++)
       {
         const u32 b0 = -((search[0] >> i) & 1);
@@ -2249,7 +2229,9 @@ void m01500m (__global pw_t *pws, __global kernel_rule_t *rules_buf, __global co
     u32 out0[32];
     u32 out1[32];
 
+    #ifdef _unroll
     #pragma unroll
+    #endif
     for (int i = 0; i < 32; i++)
     {
       out0[i] = out[ 0 + 31 - i];
@@ -2259,7 +2241,9 @@ void m01500m (__global pw_t *pws, __global kernel_rule_t *rules_buf, __global co
     transpose32c (out0);
     transpose32c (out1);
 
+    #ifdef _unroll
     #pragma unroll
+    #endif
     for (int slice = 0; slice < 32; slice++)
     {
       const u32 r0 = out0[31 - slice];
@@ -2676,7 +2660,9 @@ __kernel void m01500_tm (__global u32 *mod, __global bs_word_t *words_buf_r)
 
   const u32 w0s = (w0 << 1) & 0xfefefefe;
 
+  #ifdef _unroll
   #pragma unroll
+  #endif
   for (int i = 0, j = 0; i < 32; i += 8, j += 7)
   {
     atomic_or (&words_buf_r[block].b[j + 0], (((w0s >> (i + 7)) & 1) << slice));