- Added inline declaration to functions from simd.c, common.c, rp.c and types_ocl...
[hashcat.git] / OpenCL / m03000_a0.cl
index fcd45f5..5be3695 100644 (file)
@@ -356,7 +356,7 @@ __constant u32 c_skb[8][64] =
 #define BOX(i,n,S) (u32x) ((S)[(n)][(i).s0], (S)[(n)][(i).s1], (S)[(n)][(i).s2], (S)[(n)][(i).s3], (S)[(n)][(i).s4], (S)[(n)][(i).s5], (S)[(n)][(i).s6], (S)[(n)][(i).s7], (S)[(n)][(i).s8], (S)[(n)][(i).s9], (S)[(n)][(i).sa], (S)[(n)][(i).sb], (S)[(n)][(i).sc], (S)[(n)][(i).sd], (S)[(n)][(i).se], (S)[(n)][(i).sf])
 #endif
 
-static void _des_crypt_encrypt (u32x iv[2], u32x data[2], u32x Kc[16], u32x Kd[16], __local u32 (*s_SPtrans)[64])
+void _des_crypt_encrypt (u32x iv[2], u32x data[2], u32x Kc[16], u32x Kd[16], __local u32 (*s_SPtrans)[64])
 {
   u32x r = data[0];
   u32x l = data[1];
@@ -396,7 +396,7 @@ static void _des_crypt_encrypt (u32x iv[2], u32x data[2], u32x Kc[16], u32x Kd[1
   iv[1] = rotl32 (r, 29);
 }
 
-static void _des_crypt_keysetup (u32x c, u32x d, u32x Kc[16], u32x Kd[16], __local u32 (*s_skb)[64])
+void _des_crypt_keysetup (u32x c, u32x d, u32x Kc[16], u32x Kd[16], __local u32 (*s_skb)[64])
 {
   u32x tt;
 
@@ -463,7 +463,7 @@ static void _des_crypt_keysetup (u32x c, u32x d, u32x Kc[16], u32x Kd[16], __loc
   }
 }
 
-static void transform_netntlmv1_key (const u32x w0, const u32x w1, u32x out[2])
+void transform_netntlmv1_key (const u32x w0, const u32x w1, u32x out[2])
 {
   u32x t[8];
 
@@ -508,26 +508,6 @@ __kernel void m03000_m04 (__global pw_t *pws, __global kernel_rule_t *  rules_bu
   const u32 lid = get_local_id (0);
   const u32 lsz = get_local_size (0);
 
-  /**
-   * base
-   */
-
-  u32 pw_buf0[4];
-
-  pw_buf0[0] = pws[gid].i[ 0];
-  pw_buf0[1] = pws[gid].i[ 1];
-  pw_buf0[2] = 0;
-  pw_buf0[3] = 0;
-
-  u32 pw_buf1[4];
-
-  pw_buf1[0] = 0;
-  pw_buf1[1] = 0;
-  pw_buf1[2] = 0;
-  pw_buf1[3] = 0;
-
-  const u32 pw_len = pws[gid].pw_len;
-
   /**
    * sbox, kbox
    */
@@ -560,6 +540,24 @@ __kernel void m03000_m04 (__global pw_t *pws, __global kernel_rule_t *  rules_bu
 
   if (gid >= gid_max) return;
 
+  /**
+   * base
+   */
+
+  u32 pw_buf0[4];
+  u32 pw_buf1[4];
+
+  pw_buf0[0] = pws[gid].i[0];
+  pw_buf0[1] = pws[gid].i[1];
+  pw_buf0[2] = pws[gid].i[2];
+  pw_buf0[3] = pws[gid].i[3];
+  pw_buf1[0] = pws[gid].i[4];
+  pw_buf1[1] = pws[gid].i[5];
+  pw_buf1[2] = pws[gid].i[6];
+  pw_buf1[3] = pws[gid].i[7];
+
+  const u32 pw_len = pws[gid].pw_len;
+
   /**
    * main
    */
@@ -571,9 +569,7 @@ __kernel void m03000_m04 (__global pw_t *pws, __global kernel_rule_t *  rules_bu
     u32x w2[4] = { 0 };
     u32x w3[4] = { 0 };
 
-    u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1);
-
-    out_len &= 7; // bug
+    const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1);
 
     u32x key[2];
 
@@ -623,26 +619,6 @@ __kernel void m03000_s04 (__global pw_t *pws, __global kernel_rule_t *  rules_bu
   const u32 lid = get_local_id (0);
   const u32 lsz = get_local_size (0);
 
-  /**
-   * base
-   */
-
-  u32 pw_buf0[4];
-
-  pw_buf0[0] = pws[gid].i[ 0];
-  pw_buf0[1] = pws[gid].i[ 1];
-  pw_buf0[2] = 0;
-  pw_buf0[3] = 0;
-
-  u32 pw_buf1[4];
-
-  pw_buf1[0] = 0;
-  pw_buf1[1] = 0;
-  pw_buf1[2] = 0;
-  pw_buf1[3] = 0;
-
-  const u32 pw_len = pws[gid].pw_len;
-
   /**
    * sbox, kbox
    */
@@ -675,6 +651,24 @@ __kernel void m03000_s04 (__global pw_t *pws, __global kernel_rule_t *  rules_bu
 
   if (gid >= gid_max) return;
 
+  /**
+   * base
+   */
+
+  u32 pw_buf0[4];
+  u32 pw_buf1[4];
+
+  pw_buf0[0] = pws[gid].i[0];
+  pw_buf0[1] = pws[gid].i[1];
+  pw_buf0[2] = pws[gid].i[2];
+  pw_buf0[3] = pws[gid].i[3];
+  pw_buf1[0] = pws[gid].i[4];
+  pw_buf1[1] = pws[gid].i[5];
+  pw_buf1[2] = pws[gid].i[6];
+  pw_buf1[3] = pws[gid].i[7];
+
+  const u32 pw_len = pws[gid].pw_len;
+
   /**
    * digest
    */
@@ -698,9 +692,7 @@ __kernel void m03000_s04 (__global pw_t *pws, __global kernel_rule_t *  rules_bu
     u32x w2[4] = { 0 };
     u32x w3[4] = { 0 };
 
-    u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1);
-
-    out_len &= 7; // bug
+    const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1);
 
     u32x key[2];