#define DGST_R3 3
#include "include/kernel_functions.c"
-#include "types_ocl.c"
-#include "common.c"
+#include "OpenCL/types_ocl.c"
+#include "OpenCL/common.c"
-#ifdef VECT_SIZE1
-#define COMPARE_M "check_multi_vect1_comp4.c"
-#endif
-
-#ifdef VECT_SIZE2
-#define COMPARE_M "check_multi_vect2_comp4.c"
-#endif
-
-#ifdef VECT_SIZE4
-#define COMPARE_M "check_multi_vect4_comp4.c"
-#endif
+#define COMPARE_S "OpenCL/check_single_comp4.c"
+#define COMPARE_M "OpenCL/check_multi_comp4.c"
__constant u32 k_sha256[64] =
{
SHA256C3c, SHA256C3d, SHA256C3e, SHA256C3f,
};
-static void sha256_transform (const u32 w0[4], const u32 w1[4], const u32 w2[4], const u32 w3[4], u32 digest[8])
+void sha256_transform (const u32 w0[4], const u32 w1[4], const u32 w2[4], const u32 w3[4], u32 digest[8])
{
u32 a = digest[0];
u32 b = digest[1];
ROUND_STEP (0);
+ #ifdef _unroll
#pragma unroll
+ #endif
for (int i = 16; i < 64; i += 16)
{
ROUND_EXPAND (); ROUND_STEP (i);
digest[7] += h;
}
-static void hmac_sha256_pad (u32 w0[4], u32 w1[4], u32 w2[4], u32 w3[4], u32 ipad[8], u32 opad[8])
+void hmac_sha256_pad (u32 w0[4], u32 w1[4], u32 w2[4], u32 w3[4], u32 ipad[8], u32 opad[8])
{
w0[0] = w0[0] ^ 0x36363636;
w0[1] = w0[1] ^ 0x36363636;
sha256_transform (w0, w1, w2, w3, opad);
}
-static void hmac_sha256_run (u32 w0[4], u32 w1[4], u32 w2[4], u32 w3[4], u32 ipad[8], u32 opad[8], u32 digest[8])
+void hmac_sha256_run (u32 w0[4], u32 w1[4], u32 w2[4], u32 w3[4], u32 ipad[8], u32 opad[8], u32 digest[8])
{
digest[0] = ipad[0];
digest[1] = ipad[1];
sha256_transform (w0, w1, w2, w3, digest);
}
-__kernel void __attribute__((reqd_work_group_size (64, 1, 1))) m06400_init (__global pw_t *pws, __global gpu_rule_t *rules_buf, __global comb_t *combs_buf, __global bf_t *bfs_buf, __global sha256aix_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 wpa_t *wpa_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 m06400_init (__global pw_t *pws, __global kernel_rule_t *rules_buf, __global comb_t *combs_buf, __global bf_t *bfs_buf, __global sha256aix_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 wpa_t *wpa_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
* pads
*/
- w0[0] = swap_workaround (w0[0]);
- w0[1] = swap_workaround (w0[1]);
- w0[2] = swap_workaround (w0[2]);
- w0[3] = swap_workaround (w0[3]);
- w1[0] = swap_workaround (w1[0]);
- w1[1] = swap_workaround (w1[1]);
- w1[2] = swap_workaround (w1[2]);
- w1[3] = swap_workaround (w1[3]);
- w2[0] = swap_workaround (w2[0]);
- w2[1] = swap_workaround (w2[1]);
- w2[2] = swap_workaround (w2[2]);
- w2[3] = swap_workaround (w2[3]);
- w3[0] = swap_workaround (w3[0]);
- w3[1] = swap_workaround (w3[1]);
- w3[2] = swap_workaround (w3[2]);
- w3[3] = swap_workaround (w3[3]);
+ w0[0] = swap32 (w0[0]);
+ w0[1] = swap32 (w0[1]);
+ w0[2] = swap32 (w0[2]);
+ w0[3] = swap32 (w0[3]);
+ w1[0] = swap32 (w1[0]);
+ w1[1] = swap32 (w1[1]);
+ w1[2] = swap32 (w1[2]);
+ w1[3] = swap32 (w1[3]);
+ w2[0] = swap32 (w2[0]);
+ w2[1] = swap32 (w2[1]);
+ w2[2] = swap32 (w2[2]);
+ w2[3] = swap32 (w2[3]);
+ w3[0] = swap32 (w3[0]);
+ w3[1] = swap32 (w3[1]);
+ w3[2] = swap32 (w3[2]);
+ w3[3] = swap32 (w3[3]);
u32 ipad[8];
u32 opad[8];
w3[2] = salt_buf3[2];
// w3[3] = salt_buf3[3];
- w0[0] = swap_workaround (w0[0]);
- w0[1] = swap_workaround (w0[1]);
- w0[2] = swap_workaround (w0[2]);
- w0[3] = swap_workaround (w0[3]);
- w1[0] = swap_workaround (w1[0]);
- w1[1] = swap_workaround (w1[1]);
- w1[2] = swap_workaround (w1[2]);
- w1[3] = swap_workaround (w1[3]);
- w2[0] = swap_workaround (w2[0]);
- w2[1] = swap_workaround (w2[1]);
- w2[2] = swap_workaround (w2[2]);
- w2[3] = swap_workaround (w2[3]);
- w3[0] = swap_workaround (w3[0]);
- w3[1] = swap_workaround (w3[1]);
- w3[2] = swap_workaround (w3[2]);
+ w0[0] = swap32 (w0[0]);
+ w0[1] = swap32 (w0[1]);
+ w0[2] = swap32 (w0[2]);
+ w0[3] = swap32 (w0[3]);
+ w1[0] = swap32 (w1[0]);
+ w1[1] = swap32 (w1[1]);
+ w1[2] = swap32 (w1[2]);
+ w1[3] = swap32 (w1[3]);
+ w2[0] = swap32 (w2[0]);
+ w2[1] = swap32 (w2[1]);
+ w2[2] = swap32 (w2[2]);
+ w2[3] = swap32 (w2[3]);
+ w3[0] = swap32 (w3[0]);
+ w3[1] = swap32 (w3[1]);
+ w3[2] = swap32 (w3[2]);
w3[3] = (64 + salt_len + 4) * 8;
u32 dgst[8];
tmps[gid].out[7] = dgst[7];
}
-__kernel void __attribute__((reqd_work_group_size (64, 1, 1))) m06400_loop (__global pw_t *pws, __global gpu_rule_t *rules_buf, __global comb_t *combs_buf, __global bf_t *bfs_buf, __global sha256aix_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 wpa_t *wpa_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 m06400_loop (__global pw_t *pws, __global kernel_rule_t *rules_buf, __global comb_t *combs_buf, __global bf_t *bfs_buf, __global sha256aix_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 wpa_t *wpa_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 gid = get_global_id (0);
tmps[gid].out[7] = out[7];
}
-__kernel void __attribute__((reqd_work_group_size (64, 1, 1))) m06400_comp (__global pw_t *pws, __global gpu_rule_t *rules_buf, __global comb_t *combs_buf, __global bf_t *bfs_buf, __global sha256aix_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 wpa_t *wpa_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 m06400_comp (__global pw_t *pws, __global kernel_rule_t *rules_buf, __global comb_t *combs_buf, __global bf_t *bfs_buf, __global sha256aix_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 wpa_t *wpa_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