X-Git-Url: https://www.flypig.org.uk/git/?a=blobdiff_plain;f=OpenCL%2Fm06211.cl;h=79b5e64532eda3f8424b48c8b6c854915ad3f4fa;hb=ed1863c2630bc8194d38587d753dde71a315402a;hp=0b20e127bbfe1b59b835ef932f170c58e6cf24f6;hpb=faf18601f9ecda03d3b6b1b4ded8c09b0d612a5a;p=hashcat.git diff --git a/OpenCL/m06211.cl b/OpenCL/m06211.cl index 0b20e12..79b5e64 100644 --- a/OpenCL/m06211.cl +++ b/OpenCL/m06211.cl @@ -5,23 +5,17 @@ #define _RIPEMD160_ -#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 "inc_cipher_aes256.cl" +#include "inc_cipher_twofish256.cl" +#include "inc_cipher_serpent256.cl" -#include "include/kernel_functions.c" -#include "OpenCL/types_ocl.c" -#include "OpenCL/common.c" - -#include "OpenCL/gpu_aes256_amd.c" -#include "OpenCL/gpu_twofish256_amd.c" -#include "OpenCL/gpu_serpent256_amd.c" - -static void ripemd160_transform (const u32 w[16], u32 dgst[5]) +void ripemd160_transform (const u32 w[16], u32 dgst[5]) { u32 a1 = dgst[0]; u32 b1 = dgst[1]; @@ -218,7 +212,7 @@ static void ripemd160_transform (const u32 w[16], u32 dgst[5]) dgst[4] = e; } -static void hmac_run2 (const u32 w1[16], const u32 w2[16], const u32 ipad[5], const u32 opad[5], u32 dgst[5]) +void hmac_run2 (const u32 w1[16], const u32 w2[16], const u32 ipad[5], const u32 opad[5], u32 dgst[5]) { dgst[0] = ipad[0]; dgst[1] = ipad[1]; @@ -257,7 +251,7 @@ static void hmac_run2 (const u32 w1[16], const u32 w2[16], const u32 ipad[5], co ripemd160_transform (w, dgst); } -static void hmac_run (u32 w[16], const u32 ipad[5], const u32 opad[5], u32 dgst[5]) +void hmac_run (u32 w[16], const u32 ipad[5], const u32 opad[5], u32 dgst[5]) { dgst[0] = ipad[0]; dgst[1] = ipad[1]; @@ -293,7 +287,7 @@ static void hmac_run (u32 w[16], const u32 ipad[5], const u32 opad[5], u32 dgst[ ripemd160_transform (w, dgst); } -static void hmac_init (u32 w[16], u32 ipad[5], u32 opad[5]) +void hmac_init (u32 w[16], u32 ipad[5], u32 opad[5]) { w[ 0] ^= 0x36363636; w[ 1] ^= 0x36363636; @@ -346,7 +340,7 @@ static void hmac_init (u32 w[16], u32 ipad[5], u32 opad[5]) ripemd160_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; @@ -371,7 +365,7 @@ static u32 u8add (const u32 a, const u32 b) return r; } -__kernel void __attribute__((reqd_work_group_size (64, 1, 1))) m06211_init (__global pw_t *pws, __global gpu_rule_t *rules_buf, __global comb_t *combs_buf, __global bf_t *bfs_buf, __global tc_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 m06211_init (__global pw_t *pws, __global kernel_rule_t *rules_buf, __global comb_t *combs_buf, __global bf_t *bfs_buf, __global tc_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 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max) { /** * base @@ -532,7 +526,7 @@ __kernel void __attribute__((reqd_work_group_size (64, 1, 1))) m06211_init (__gl } } -__kernel void __attribute__((reqd_work_group_size (64, 1, 1))) m06211_loop (__global pw_t *pws, __global gpu_rule_t *rules_buf, __global comb_t *combs_buf, __global bf_t *bfs_buf, __global tc_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 m06211_loop (__global pw_t *pws, __global kernel_rule_t *rules_buf, __global comb_t *combs_buf, __global bf_t *bfs_buf, __global tc_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 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; @@ -616,7 +610,7 @@ __kernel void __attribute__((reqd_work_group_size (64, 1, 1))) m06211_loop (__gl } } -__kernel void __attribute__((reqd_work_group_size (64, 1, 1))) m06211_comp (__global pw_t *pws, __global gpu_rule_t *rules_buf, __global comb_t *combs_buf, __global bf_t *bfs_buf, __global tc_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 m06211_comp (__global pw_t *pws, __global kernel_rule_t *rules_buf, __global comb_t *combs_buf, __global bf_t *bfs_buf, __global tc_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 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max) { /** * base @@ -656,6 +650,8 @@ __kernel void __attribute__((reqd_work_group_size (64, 1, 1))) m06211_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]; { @@ -666,11 +662,9 @@ __kernel void __attribute__((reqd_work_group_size (64, 1, 1))) m06211_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); } } @@ -682,11 +676,9 @@ __kernel void __attribute__((reqd_work_group_size (64, 1, 1))) m06211_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); } } @@ -698,11 +690,9 @@ __kernel void __attribute__((reqd_work_group_size (64, 1, 1))) m06211_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); } } }