X-Git-Url: https://www.flypig.org.uk/git/?a=blobdiff_plain;f=OpenCL%2Fm06223.cl;h=a10579228b7926f3ac83aadf6e20dbfc079db358;hb=161a6eb4bc643d8e636e96eda613f5137d30da59;hp=670cf9431e5f7e39c4400e88cfcc20f68334febe;hpb=0bf4e3c34a6a799ccc34f403bed70119574ca9c8;p=hashcat.git diff --git a/OpenCL/m06223.cl b/OpenCL/m06223.cl index 670cf94..a105792 100644 --- a/OpenCL/m06223.cl +++ b/OpenCL/m06223.cl @@ -5,21 +5,15 @@ #define _SHA512_ -#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 "types_ocl.c" -#include "common.c" - -#include "gpu_aes256_amd.c" -#include "gpu_twofish256_amd.c" -#include "gpu_serpent256_amd.c" +#include "inc_cipher_aes256.cl" +#include "inc_cipher_twofish256.cl" +#include "inc_cipher_serpent256.cl" __constant u64 k_sha512[80] = { @@ -45,7 +39,7 @@ __constant u64 k_sha512[80] = SHA512C4c, SHA512C4d, SHA512C4e, SHA512C4f, }; -static void sha512_transform (const u64 w[16], u64 dgst[8]) +void sha512_transform (const u64 w[16], u64 dgst[8]) { u64 a = dgst[0]; u64 b = dgst[1]; @@ -115,7 +109,9 @@ static void sha512_transform (const u64 w[16], u64 dgst[8]) ROUND_STEP (0); - //#pragma unroll + #ifdef _unroll + #pragma unroll + #endif for (int i = 16; i < 80; i += 16) { ROUND_EXPAND (); ROUND_STEP (i); @@ -131,7 +127,7 @@ static void sha512_transform (const u64 w[16], u64 dgst[8]) dgst[7] += h; } -static void hmac_run (const u64 w1[16], const u64 ipad[8], const u64 opad[8], u64 dgst[8]) +void hmac_run (const u64 w1[16], const u64 ipad[8], const u64 opad[8], u64 dgst[8]) { dgst[0] = ipad[0]; dgst[1] = ipad[1]; @@ -175,7 +171,7 @@ static void hmac_run (const u64 w1[16], const u64 ipad[8], const u64 opad[8], u6 sha512_transform (w, dgst); } -static void hmac_init (u64 w[16], u64 ipad[8], u64 opad[8]) +void hmac_init (u64 w[16], u64 ipad[8], u64 opad[8]) { w[ 0] ^= 0x3636363636363636; w[ 1] ^= 0x3636363636363636; @@ -234,7 +230,7 @@ static void hmac_init (u64 w[16], u64 ipad[8], u64 opad[8]) sha512_transform (w, opad); } -static u32 u8add (const u32 a, const u32 b) +u32 u8add (const u32 a, const u32 b) { const u32 a1 = (a >> 0) & 0xff; const u32 a2 = (a >> 8) & 0xff; @@ -259,7 +255,7 @@ static u32 u8add (const u32 a, const u32 b) return r; } -__kernel void __attribute__((reqd_work_group_size (64, 1, 1))) m06223_init (__global pw_t *pws, __global gpu_rule_t *rules_buf, __global comb_t *combs_buf, __global bf_t *bfs_buf, __global tc64_tmp_t *tmps, __global void *hooks, __global u32 *bitmaps_buf_s1_a, __global u32 *bitmaps_buf_s1_b, __global u32 *bitmaps_buf_s1_c, __global u32 *bitmaps_buf_s1_d, __global u32 *bitmaps_buf_s2_a, __global u32 *bitmaps_buf_s2_b, __global u32 *bitmaps_buf_s2_c, __global u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global digest_t *digests_buf, __global u32 *hashes_shown, __global salt_t *salt_bufs, __global tc_t *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 rules_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max) +__kernel void m06223_init (__global pw_t *pws, __global kernel_rule_t *rules_buf, __global comb_t *combs_buf, __global bf_t *bfs_buf, __global tc64_tmp_t *tmps, __global void *hooks, __global u32 *bitmaps_buf_s1_a, __global u32 *bitmaps_buf_s1_b, __global u32 *bitmaps_buf_s1_c, __global u32 *bitmaps_buf_s1_d, __global u32 *bitmaps_buf_s2_a, __global u32 *bitmaps_buf_s2_b, __global u32 *bitmaps_buf_s2_c, __global u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global digest_t *digests_buf, __global u32 *hashes_shown, __global salt_t *salt_bufs, __global tc_t *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV0_buf, __global u32 *d_scryptV1_buf, __global u32 *d_scryptV2_buf, __global u32 *d_scryptV3_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max) { /** * base @@ -326,14 +322,14 @@ __kernel void __attribute__((reqd_work_group_size (64, 1, 1))) m06223_init (__gl // swap fehlt - salt_buf[ 0] = ((u64) swap_workaround (esalt_bufs[salt_pos].salt_buf[ 0])) << 32 | (u64) swap_workaround (esalt_bufs[salt_pos].salt_buf[ 1]); - salt_buf[ 1] = ((u64) swap_workaround (esalt_bufs[salt_pos].salt_buf[ 2])) << 32 | (u64) swap_workaround (esalt_bufs[salt_pos].salt_buf[ 3]); - salt_buf[ 2] = ((u64) swap_workaround (esalt_bufs[salt_pos].salt_buf[ 4])) << 32 | (u64) swap_workaround (esalt_bufs[salt_pos].salt_buf[ 5]); - salt_buf[ 3] = ((u64) swap_workaround (esalt_bufs[salt_pos].salt_buf[ 6])) << 32 | (u64) swap_workaround (esalt_bufs[salt_pos].salt_buf[ 7]); - salt_buf[ 4] = ((u64) swap_workaround (esalt_bufs[salt_pos].salt_buf[ 8])) << 32 | (u64) swap_workaround (esalt_bufs[salt_pos].salt_buf[ 9]); - salt_buf[ 5] = ((u64) swap_workaround (esalt_bufs[salt_pos].salt_buf[10])) << 32 | (u64) swap_workaround (esalt_bufs[salt_pos].salt_buf[11]); - salt_buf[ 6] = ((u64) swap_workaround (esalt_bufs[salt_pos].salt_buf[12])) << 32 | (u64) swap_workaround (esalt_bufs[salt_pos].salt_buf[13]); - salt_buf[ 7] = ((u64) swap_workaround (esalt_bufs[salt_pos].salt_buf[14])) << 32 | (u64) swap_workaround (esalt_bufs[salt_pos].salt_buf[15]); + salt_buf[ 0] = ((u64) swap32 (esalt_bufs[salt_pos].salt_buf[ 0])) << 32 | (u64) swap32 (esalt_bufs[salt_pos].salt_buf[ 1]); + salt_buf[ 1] = ((u64) swap32 (esalt_bufs[salt_pos].salt_buf[ 2])) << 32 | (u64) swap32 (esalt_bufs[salt_pos].salt_buf[ 3]); + salt_buf[ 2] = ((u64) swap32 (esalt_bufs[salt_pos].salt_buf[ 4])) << 32 | (u64) swap32 (esalt_bufs[salt_pos].salt_buf[ 5]); + salt_buf[ 3] = ((u64) swap32 (esalt_bufs[salt_pos].salt_buf[ 6])) << 32 | (u64) swap32 (esalt_bufs[salt_pos].salt_buf[ 7]); + salt_buf[ 4] = ((u64) swap32 (esalt_bufs[salt_pos].salt_buf[ 8])) << 32 | (u64) swap32 (esalt_bufs[salt_pos].salt_buf[ 9]); + salt_buf[ 5] = ((u64) swap32 (esalt_bufs[salt_pos].salt_buf[10])) << 32 | (u64) swap32 (esalt_bufs[salt_pos].salt_buf[11]); + salt_buf[ 6] = ((u64) swap32 (esalt_bufs[salt_pos].salt_buf[12])) << 32 | (u64) swap32 (esalt_bufs[salt_pos].salt_buf[13]); + salt_buf[ 7] = ((u64) swap32 (esalt_bufs[salt_pos].salt_buf[14])) << 32 | (u64) swap32 (esalt_bufs[salt_pos].salt_buf[15]); salt_buf[ 8] = 0; salt_buf[ 9] = 0; salt_buf[10] = 0; @@ -347,14 +343,14 @@ __kernel void __attribute__((reqd_work_group_size (64, 1, 1))) m06223_init (__gl u64 w[16]; - w[ 0] = ((u64) swap_workaround (w0[0])) << 32 | (u64) swap_workaround (w0[1]); - w[ 1] = ((u64) swap_workaround (w0[2])) << 32 | (u64) swap_workaround (w0[3]); - w[ 2] = ((u64) swap_workaround (w1[0])) << 32 | (u64) swap_workaround (w1[1]); - w[ 3] = ((u64) swap_workaround (w1[2])) << 32 | (u64) swap_workaround (w1[3]); - w[ 4] = ((u64) swap_workaround (w2[0])) << 32 | (u64) swap_workaround (w2[1]); - w[ 5] = ((u64) swap_workaround (w2[2])) << 32 | (u64) swap_workaround (w2[3]); - w[ 6] = ((u64) swap_workaround (w3[0])) << 32 | (u64) swap_workaround (w3[1]); - w[ 7] = ((u64) swap_workaround (w3[2])) << 32 | (u64) swap_workaround (w3[3]); + w[ 0] = ((u64) swap32 (w0[0])) << 32 | (u64) swap32 (w0[1]); + w[ 1] = ((u64) swap32 (w0[2])) << 32 | (u64) swap32 (w0[3]); + w[ 2] = ((u64) swap32 (w1[0])) << 32 | (u64) swap32 (w1[1]); + w[ 3] = ((u64) swap32 (w1[2])) << 32 | (u64) swap32 (w1[3]); + w[ 4] = ((u64) swap32 (w2[0])) << 32 | (u64) swap32 (w2[1]); + w[ 5] = ((u64) swap32 (w2[2])) << 32 | (u64) swap32 (w2[3]); + w[ 6] = ((u64) swap32 (w3[0])) << 32 | (u64) swap32 (w3[1]); + w[ 7] = ((u64) swap32 (w3[2])) << 32 | (u64) swap32 (w3[3]); w[ 8] = 0; w[ 9] = 0; w[10] = 0; @@ -415,7 +411,7 @@ __kernel void __attribute__((reqd_work_group_size (64, 1, 1))) m06223_init (__gl } } -__kernel void __attribute__((reqd_work_group_size (64, 1, 1))) m06223_loop (__global pw_t *pws, __global gpu_rule_t *rules_buf, __global comb_t *combs_buf, __global bf_t *bfs_buf, __global tc64_tmp_t *tmps, __global void *hooks, __global u32 *bitmaps_buf_s1_a, __global u32 *bitmaps_buf_s1_b, __global u32 *bitmaps_buf_s1_c, __global u32 *bitmaps_buf_s1_d, __global u32 *bitmaps_buf_s2_a, __global u32 *bitmaps_buf_s2_b, __global u32 *bitmaps_buf_s2_c, __global u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global digest_t *digests_buf, __global u32 *hashes_shown, __global salt_t *salt_bufs, __global tc_t *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 rules_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max) +__kernel void m06223_loop (__global pw_t *pws, __global kernel_rule_t *rules_buf, __global comb_t *combs_buf, __global bf_t *bfs_buf, __global tc64_tmp_t *tmps, __global void *hooks, __global u32 *bitmaps_buf_s1_a, __global u32 *bitmaps_buf_s1_b, __global u32 *bitmaps_buf_s1_c, __global u32 *bitmaps_buf_s1_d, __global u32 *bitmaps_buf_s2_a, __global u32 *bitmaps_buf_s2_b, __global u32 *bitmaps_buf_s2_c, __global u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global digest_t *digests_buf, __global u32 *hashes_shown, __global salt_t *salt_bufs, __global tc_t *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV0_buf, __global u32 *d_scryptV1_buf, __global u32 *d_scryptV2_buf, __global u32 *d_scryptV3_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max) { const u32 truecrypt_mdlen = salt_bufs[0].truecrypt_mdlen; @@ -522,7 +518,7 @@ __kernel void __attribute__((reqd_work_group_size (64, 1, 1))) m06223_loop (__gl } } -__kernel void __attribute__((reqd_work_group_size (64, 1, 1))) m06223_comp (__global pw_t *pws, __global gpu_rule_t *rules_buf, __global comb_t *combs_buf, __global bf_t *bfs_buf, __global tc64_tmp_t *tmps, __global void *hooks, __global u32 *bitmaps_buf_s1_a, __global u32 *bitmaps_buf_s1_b, __global u32 *bitmaps_buf_s1_c, __global u32 *bitmaps_buf_s1_d, __global u32 *bitmaps_buf_s2_a, __global u32 *bitmaps_buf_s2_b, __global u32 *bitmaps_buf_s2_c, __global u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global digest_t *digests_buf, __global u32 *hashes_shown, __global salt_t *salt_bufs, __global tc_t *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 rules_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max) +__kernel void m06223_comp (__global pw_t *pws, __global kernel_rule_t *rules_buf, __global comb_t *combs_buf, __global bf_t *bfs_buf, __global tc64_tmp_t *tmps, __global void *hooks, __global u32 *bitmaps_buf_s1_a, __global u32 *bitmaps_buf_s1_b, __global u32 *bitmaps_buf_s1_c, __global u32 *bitmaps_buf_s1_d, __global u32 *bitmaps_buf_s2_a, __global u32 *bitmaps_buf_s2_b, __global u32 *bitmaps_buf_s2_c, __global u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global digest_t *digests_buf, __global u32 *hashes_shown, __global salt_t *salt_bufs, __global tc_t *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV0_buf, __global u32 *d_scryptV1_buf, __global u32 *d_scryptV2_buf, __global u32 *d_scryptV3_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max) { /** * base @@ -535,25 +531,25 @@ __kernel void __attribute__((reqd_work_group_size (64, 1, 1))) m06223_comp (__gl u32 ukey1[8]; - ukey1[0] = swap_workaround (h32_from_64 (tmps[gid].out[ 0])); - ukey1[1] = swap_workaround (l32_from_64 (tmps[gid].out[ 0])); - ukey1[2] = swap_workaround (h32_from_64 (tmps[gid].out[ 1])); - ukey1[3] = swap_workaround (l32_from_64 (tmps[gid].out[ 1])); - ukey1[4] = swap_workaround (h32_from_64 (tmps[gid].out[ 2])); - ukey1[5] = swap_workaround (l32_from_64 (tmps[gid].out[ 2])); - ukey1[6] = swap_workaround (h32_from_64 (tmps[gid].out[ 3])); - ukey1[7] = swap_workaround (l32_from_64 (tmps[gid].out[ 3])); + ukey1[0] = swap32 (h32_from_64 (tmps[gid].out[ 0])); + ukey1[1] = swap32 (l32_from_64 (tmps[gid].out[ 0])); + ukey1[2] = swap32 (h32_from_64 (tmps[gid].out[ 1])); + ukey1[3] = swap32 (l32_from_64 (tmps[gid].out[ 1])); + ukey1[4] = swap32 (h32_from_64 (tmps[gid].out[ 2])); + ukey1[5] = swap32 (l32_from_64 (tmps[gid].out[ 2])); + ukey1[6] = swap32 (h32_from_64 (tmps[gid].out[ 3])); + ukey1[7] = swap32 (l32_from_64 (tmps[gid].out[ 3])); u32 ukey2[8]; - ukey2[0] = swap_workaround (h32_from_64 (tmps[gid].out[ 4])); - ukey2[1] = swap_workaround (l32_from_64 (tmps[gid].out[ 4])); - ukey2[2] = swap_workaround (h32_from_64 (tmps[gid].out[ 5])); - ukey2[3] = swap_workaround (l32_from_64 (tmps[gid].out[ 5])); - ukey2[4] = swap_workaround (h32_from_64 (tmps[gid].out[ 6])); - ukey2[5] = swap_workaround (l32_from_64 (tmps[gid].out[ 6])); - ukey2[6] = swap_workaround (h32_from_64 (tmps[gid].out[ 7])); - ukey2[7] = swap_workaround (l32_from_64 (tmps[gid].out[ 7])); + ukey2[0] = swap32 (h32_from_64 (tmps[gid].out[ 4])); + ukey2[1] = swap32 (l32_from_64 (tmps[gid].out[ 4])); + ukey2[2] = swap32 (h32_from_64 (tmps[gid].out[ 5])); + ukey2[3] = swap32 (l32_from_64 (tmps[gid].out[ 5])); + ukey2[4] = swap32 (h32_from_64 (tmps[gid].out[ 6])); + ukey2[5] = swap32 (l32_from_64 (tmps[gid].out[ 6])); + ukey2[6] = swap32 (h32_from_64 (tmps[gid].out[ 7])); + ukey2[7] = swap32 (l32_from_64 (tmps[gid].out[ 7])); u32 data[4]; @@ -562,6 +558,8 @@ __kernel void __attribute__((reqd_work_group_size (64, 1, 1))) m06223_comp (__gl 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]; { @@ -572,11 +570,9 @@ __kernel void __attribute__((reqd_work_group_size (64, 1, 1))) m06223_comp (__gl 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); - - d_return_buf[lid] = 1; + mark_hash (plains_buf, d_return_buf, salt_pos, 0, 0, gid, 0); } } @@ -588,11 +584,9 @@ __kernel void __attribute__((reqd_work_group_size (64, 1, 1))) m06223_comp (__gl 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); - - d_return_buf[lid] = 1; + mark_hash (plains_buf, d_return_buf, salt_pos, 0, 0, gid, 0); } } @@ -604,35 +598,33 @@ __kernel void __attribute__((reqd_work_group_size (64, 1, 1))) m06223_comp (__gl 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); - - d_return_buf[lid] = 1; + mark_hash (plains_buf, d_return_buf, salt_pos, 0, 0, gid, 0); } } u32 ukey3[8]; - ukey3[0] = swap_workaround (h32_from_64 (tmps[gid].out[ 8])); - ukey3[1] = swap_workaround (l32_from_64 (tmps[gid].out[ 8])); - ukey3[2] = swap_workaround (h32_from_64 (tmps[gid].out[ 9])); - ukey3[3] = swap_workaround (l32_from_64 (tmps[gid].out[ 9])); - ukey3[4] = swap_workaround (h32_from_64 (tmps[gid].out[10])); - ukey3[5] = swap_workaround (l32_from_64 (tmps[gid].out[10])); - ukey3[6] = swap_workaround (h32_from_64 (tmps[gid].out[11])); - ukey3[7] = swap_workaround (l32_from_64 (tmps[gid].out[11])); + ukey3[0] = swap32 (h32_from_64 (tmps[gid].out[ 8])); + ukey3[1] = swap32 (l32_from_64 (tmps[gid].out[ 8])); + ukey3[2] = swap32 (h32_from_64 (tmps[gid].out[ 9])); + ukey3[3] = swap32 (l32_from_64 (tmps[gid].out[ 9])); + ukey3[4] = swap32 (h32_from_64 (tmps[gid].out[10])); + ukey3[5] = swap32 (l32_from_64 (tmps[gid].out[10])); + ukey3[6] = swap32 (h32_from_64 (tmps[gid].out[11])); + ukey3[7] = swap32 (l32_from_64 (tmps[gid].out[11])); u32 ukey4[8]; - ukey4[0] = swap_workaround (h32_from_64 (tmps[gid].out[12])); - ukey4[1] = swap_workaround (l32_from_64 (tmps[gid].out[12])); - ukey4[2] = swap_workaround (h32_from_64 (tmps[gid].out[13])); - ukey4[3] = swap_workaround (l32_from_64 (tmps[gid].out[13])); - ukey4[4] = swap_workaround (h32_from_64 (tmps[gid].out[14])); - ukey4[5] = swap_workaround (l32_from_64 (tmps[gid].out[14])); - ukey4[6] = swap_workaround (h32_from_64 (tmps[gid].out[15])); - ukey4[7] = swap_workaround (l32_from_64 (tmps[gid].out[15])); + ukey4[0] = swap32 (h32_from_64 (tmps[gid].out[12])); + ukey4[1] = swap32 (l32_from_64 (tmps[gid].out[12])); + ukey4[2] = swap32 (h32_from_64 (tmps[gid].out[13])); + ukey4[3] = swap32 (l32_from_64 (tmps[gid].out[13])); + ukey4[4] = swap32 (h32_from_64 (tmps[gid].out[14])); + ukey4[5] = swap32 (l32_from_64 (tmps[gid].out[14])); + ukey4[6] = swap32 (h32_from_64 (tmps[gid].out[15])); + ukey4[7] = swap32 (l32_from_64 (tmps[gid].out[15])); { tmp[0] = data[0]; @@ -643,11 +635,9 @@ __kernel void __attribute__((reqd_work_group_size (64, 1, 1))) m06223_comp (__gl aes256_decrypt_xts (ukey2, ukey4, tmp, tmp); twofish256_decrypt_xts (ukey1, ukey3, 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); - - d_return_buf[lid] = 1; + mark_hash (plains_buf, d_return_buf, salt_pos, 0, 0, gid, 0); } } @@ -660,11 +650,9 @@ __kernel void __attribute__((reqd_work_group_size (64, 1, 1))) m06223_comp (__gl serpent256_decrypt_xts (ukey2, ukey4, tmp, tmp); aes256_decrypt_xts (ukey1, ukey3, 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); - - d_return_buf[lid] = 1; + mark_hash (plains_buf, d_return_buf, salt_pos, 0, 0, gid, 0); } } @@ -677,35 +665,33 @@ __kernel void __attribute__((reqd_work_group_size (64, 1, 1))) m06223_comp (__gl twofish256_decrypt_xts (ukey2, ukey4, tmp, tmp); serpent256_decrypt_xts (ukey1, ukey3, 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); - - d_return_buf[lid] = 1; + mark_hash (plains_buf, d_return_buf, salt_pos, 0, 0, gid, 0); } } u32 ukey5[8]; - ukey5[0] = swap_workaround (h32_from_64 (tmps[gid].out[16])); - ukey5[1] = swap_workaround (l32_from_64 (tmps[gid].out[16])); - ukey5[2] = swap_workaround (h32_from_64 (tmps[gid].out[17])); - ukey5[3] = swap_workaround (l32_from_64 (tmps[gid].out[17])); - ukey5[4] = swap_workaround (h32_from_64 (tmps[gid].out[18])); - ukey5[5] = swap_workaround (l32_from_64 (tmps[gid].out[18])); - ukey5[6] = swap_workaround (h32_from_64 (tmps[gid].out[19])); - ukey5[7] = swap_workaround (l32_from_64 (tmps[gid].out[19])); + ukey5[0] = swap32 (h32_from_64 (tmps[gid].out[16])); + ukey5[1] = swap32 (l32_from_64 (tmps[gid].out[16])); + ukey5[2] = swap32 (h32_from_64 (tmps[gid].out[17])); + ukey5[3] = swap32 (l32_from_64 (tmps[gid].out[17])); + ukey5[4] = swap32 (h32_from_64 (tmps[gid].out[18])); + ukey5[5] = swap32 (l32_from_64 (tmps[gid].out[18])); + ukey5[6] = swap32 (h32_from_64 (tmps[gid].out[19])); + ukey5[7] = swap32 (l32_from_64 (tmps[gid].out[19])); u32 ukey6[8]; - ukey6[0] = swap_workaround (h32_from_64 (tmps[gid].out[20])); - ukey6[1] = swap_workaround (l32_from_64 (tmps[gid].out[20])); - ukey6[2] = swap_workaround (h32_from_64 (tmps[gid].out[21])); - ukey6[3] = swap_workaround (l32_from_64 (tmps[gid].out[21])); - ukey6[4] = swap_workaround (h32_from_64 (tmps[gid].out[22])); - ukey6[5] = swap_workaround (l32_from_64 (tmps[gid].out[22])); - ukey6[6] = swap_workaround (h32_from_64 (tmps[gid].out[23])); - ukey6[7] = swap_workaround (l32_from_64 (tmps[gid].out[23])); + ukey6[0] = swap32 (h32_from_64 (tmps[gid].out[20])); + ukey6[1] = swap32 (l32_from_64 (tmps[gid].out[20])); + ukey6[2] = swap32 (h32_from_64 (tmps[gid].out[21])); + ukey6[3] = swap32 (l32_from_64 (tmps[gid].out[21])); + ukey6[4] = swap32 (h32_from_64 (tmps[gid].out[22])); + ukey6[5] = swap32 (l32_from_64 (tmps[gid].out[22])); + ukey6[6] = swap32 (h32_from_64 (tmps[gid].out[23])); + ukey6[7] = swap32 (l32_from_64 (tmps[gid].out[23])); { tmp[0] = data[0]; @@ -717,11 +703,9 @@ __kernel void __attribute__((reqd_work_group_size (64, 1, 1))) m06223_comp (__gl twofish256_decrypt_xts (ukey2, ukey5, tmp, tmp); serpent256_decrypt_xts (ukey1, ukey4, 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); - - d_return_buf[lid] = 1; + mark_hash (plains_buf, d_return_buf, salt_pos, 0, 0, gid, 0); } } @@ -735,11 +719,9 @@ __kernel void __attribute__((reqd_work_group_size (64, 1, 1))) m06223_comp (__gl twofish256_decrypt_xts (ukey2, ukey5, tmp, tmp); aes256_decrypt_xts (ukey1, ukey4, 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); - - d_return_buf[lid] = 1; + mark_hash (plains_buf, d_return_buf, salt_pos, 0, 0, gid, 0); } } }