Some fixes for rare kernels
[hashcat.git] / OpenCL / m06221.cl
index 60bdf54..477db80 100644 (file)
@@ -115,10 +115,7 @@ void sha512_transform (const u64 w[16], u64 dgst[8])
 
   ROUND_STEP (0);
 
-  #ifdef IS_AMD
-  // #pragma unroll
-  // breaks compiler
-  #else
+  #ifdef _unroll
   #pragma unroll
   #endif
   for (int i = 16; i < 80; i += 16)
@@ -567,6 +564,8 @@ __kernel void m06221_comp (__global pw_t *pws, __global kernel_rule_t *rules_buf
   data[2] = esalt_bufs[0].data_buf[2];
   data[3] = esalt_bufs[0].data_buf[3];
 
+  const u32 signature = esalt_bufs[0].signature;
+
   u32 tmp[4];
 
   {
@@ -577,9 +576,9 @@ __kernel void m06221_comp (__global pw_t *pws, __global kernel_rule_t *rules_buf
 
     aes256_decrypt_xts (ukey1, ukey2, tmp, tmp);
 
-    if (((tmp[0] == 0x45555254) && (tmp[3] == 0)) || ((tmp[0] == 0x45555254) && ((tmp[1] >> 16) <= 5)))
+    if (((tmp[0] == signature) && (tmp[3] == 0)) || ((tmp[0] == signature) && ((tmp[1] >> 16) <= 5)))
     {
-      mark_hash (plains_buf, hashes_shown, 0, gid, 0);
+      mark_hash (plains_buf, d_return_buf, salt_pos, 0, 0, gid, 0);
 
       d_return_buf[lid] = 1;
     }
@@ -593,9 +592,9 @@ __kernel void m06221_comp (__global pw_t *pws, __global kernel_rule_t *rules_buf
 
     serpent256_decrypt_xts (ukey1, ukey2, tmp, tmp);
 
-    if (((tmp[0] == 0x45555254) && (tmp[3] == 0)) || ((tmp[0] == 0x45555254) && ((tmp[1] >> 16) <= 5)))
+    if (((tmp[0] == signature) && (tmp[3] == 0)) || ((tmp[0] == signature) && ((tmp[1] >> 16) <= 5)))
     {
-      mark_hash (plains_buf, hashes_shown, 0, gid, 0);
+      mark_hash (plains_buf, d_return_buf, salt_pos, 0, 0, gid, 0);
 
       d_return_buf[lid] = 1;
     }
@@ -609,9 +608,9 @@ __kernel void m06221_comp (__global pw_t *pws, __global kernel_rule_t *rules_buf
 
     twofish256_decrypt_xts (ukey1, ukey2, tmp, tmp);
 
-    if (((tmp[0] == 0x45555254) && (tmp[3] == 0)) || ((tmp[0] == 0x45555254) && ((tmp[1] >> 16) <= 5)))
+    if (((tmp[0] == signature) && (tmp[3] == 0)) || ((tmp[0] == signature) && ((tmp[1] >> 16) <= 5)))
     {
-      mark_hash (plains_buf, hashes_shown, 0, gid, 0);
+      mark_hash (plains_buf, d_return_buf, salt_pos, 0, 0, gid, 0);
 
       d_return_buf[lid] = 1;
     }