mirror of
https://github.com/hashcat/hashcat.git
synced 2024-12-26 16:38:35 +00:00
Add -L support for all SHA512 based generic hashes
This commit is contained in:
parent
7205f450dd
commit
8434e451ef
@ -38,7 +38,7 @@ __kernel void m01700_mxx (__global pw_t *pws, __global const kernel_rule_t *rule
|
||||
|
||||
for (int idx = 0; idx < pw_lenv; idx++)
|
||||
{
|
||||
w[idx] = swap32_S (pws[gid].i[idx]);
|
||||
w[idx] = pws[gid].i[idx];
|
||||
|
||||
barrier (CLK_GLOBAL_MEM_FENCE);
|
||||
}
|
||||
@ -55,14 +55,14 @@ __kernel void m01700_mxx (__global pw_t *pws, __global const kernel_rule_t *rule
|
||||
|
||||
sha512_init (&ctx);
|
||||
|
||||
sha512_update (&ctx, w, pw_len);
|
||||
sha512_update_swap (&ctx, w, pw_len);
|
||||
|
||||
sha512_final (&ctx);
|
||||
|
||||
const u32x r0 = l32_from_64 (ctx.h[7]);
|
||||
const u32x r1 = h32_from_64 (ctx.h[7]);
|
||||
const u32x r2 = l32_from_64 (ctx.h[3]);
|
||||
const u32x r3 = h32_from_64 (ctx.h[3]);
|
||||
const u32 r0 = l32_from_64_S (ctx.h[7]);
|
||||
const u32 r1 = h32_from_64_S (ctx.h[7]);
|
||||
const u32 r2 = l32_from_64_S (ctx.h[3]);
|
||||
const u32 r3 = h32_from_64_S (ctx.h[3]);
|
||||
|
||||
COMPARE_M_SCALAR (r0, r1, r2, r3);
|
||||
}
|
||||
@ -103,7 +103,7 @@ __kernel void m01700_sxx (__global pw_t *pws, __global const kernel_rule_t *rule
|
||||
|
||||
for (int idx = 0; idx < pw_lenv; idx++)
|
||||
{
|
||||
w[idx] = swap32_S (pws[gid].i[idx]);
|
||||
w[idx] = pws[gid].i[idx];
|
||||
|
||||
barrier (CLK_GLOBAL_MEM_FENCE);
|
||||
}
|
||||
@ -120,14 +120,14 @@ __kernel void m01700_sxx (__global pw_t *pws, __global const kernel_rule_t *rule
|
||||
|
||||
sha512_init (&ctx);
|
||||
|
||||
sha512_update (&ctx, w, pw_len);
|
||||
sha512_update_swap (&ctx, w, pw_len);
|
||||
|
||||
sha512_final (&ctx);
|
||||
|
||||
const u32x r0 = l32_from_64 (ctx.h[7]);
|
||||
const u32x r1 = h32_from_64 (ctx.h[7]);
|
||||
const u32x r2 = l32_from_64 (ctx.h[3]);
|
||||
const u32x r3 = h32_from_64 (ctx.h[3]);
|
||||
const u32 r0 = l32_from_64_S (ctx.h[7]);
|
||||
const u32 r1 = h32_from_64_S (ctx.h[7]);
|
||||
const u32 r2 = l32_from_64_S (ctx.h[3]);
|
||||
const u32 r3 = h32_from_64_S (ctx.h[3]);
|
||||
|
||||
COMPARE_S_SCALAR (r0, r1, r2, r3);
|
||||
}
|
||||
|
@ -46,10 +46,10 @@ __kernel void m01700_mxx (__global pw_t *pws, __global const kernel_rule_t *rule
|
||||
|
||||
sha512_final (&ctx);
|
||||
|
||||
const u32x r0 = l32_from_64 (ctx.h[7]);
|
||||
const u32x r1 = h32_from_64 (ctx.h[7]);
|
||||
const u32x r2 = l32_from_64 (ctx.h[3]);
|
||||
const u32x r3 = h32_from_64 (ctx.h[3]);
|
||||
const u32 r0 = l32_from_64_S (ctx.h[7]);
|
||||
const u32 r1 = h32_from_64_S (ctx.h[7]);
|
||||
const u32 r2 = l32_from_64_S (ctx.h[3]);
|
||||
const u32 r3 = h32_from_64_S (ctx.h[3]);
|
||||
|
||||
COMPARE_M_SCALAR (r0, r1, r2, r3);
|
||||
}
|
||||
@ -100,10 +100,10 @@ __kernel void m01700_sxx (__global pw_t *pws, __global const kernel_rule_t *rule
|
||||
|
||||
sha512_final (&ctx);
|
||||
|
||||
const u32x r0 = l32_from_64 (ctx.h[7]);
|
||||
const u32x r1 = h32_from_64 (ctx.h[7]);
|
||||
const u32x r2 = l32_from_64 (ctx.h[3]);
|
||||
const u32x r3 = h32_from_64 (ctx.h[3]);
|
||||
const u32 r0 = l32_from_64_S (ctx.h[7]);
|
||||
const u32 r1 = h32_from_64_S (ctx.h[7]);
|
||||
const u32 r2 = l32_from_64_S (ctx.h[3]);
|
||||
const u32 r3 = h32_from_64_S (ctx.h[3]);
|
||||
|
||||
COMPARE_S_SCALAR (r0, r1, r2, r3);
|
||||
}
|
||||
|
164
OpenCL/m01710_a0-pure.cl
Normal file
164
OpenCL/m01710_a0-pure.cl
Normal file
@ -0,0 +1,164 @@
|
||||
/**
|
||||
* Author......: See docs/credits.txt
|
||||
* License.....: MIT
|
||||
*/
|
||||
|
||||
//#define NEW_SIMD_CODE
|
||||
|
||||
#include "inc_vendor.cl"
|
||||
#include "inc_hash_constants.h"
|
||||
#include "inc_hash_functions.cl"
|
||||
#include "inc_types.cl"
|
||||
#include "inc_common.cl"
|
||||
#include "inc_rp.h"
|
||||
#include "inc_rp.cl"
|
||||
#include "inc_scalar.cl"
|
||||
#include "inc_hash_sha512.cl"
|
||||
|
||||
__kernel void m01710_mxx (__global pw_t *pws, __global const kernel_rule_t *rules_buf, __global const pw_t *combs_buf, __global const bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global const u32 *bitmaps_buf_s1_a, __global const u32 *bitmaps_buf_s1_b, __global const u32 *bitmaps_buf_s1_c, __global const u32 *bitmaps_buf_s1_d, __global const u32 *bitmaps_buf_s2_a, __global const u32 *bitmaps_buf_s2_b, __global const u32 *bitmaps_buf_s2_c, __global const u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global const digest_t *digests_buf, __global u32 *hashes_shown, __global const salt_t *salt_bufs, __global const void *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)
|
||||
{
|
||||
/**
|
||||
* modifier
|
||||
*/
|
||||
|
||||
const u32 lid = get_local_id (0);
|
||||
const u32 gid = get_global_id (0);
|
||||
|
||||
if (gid >= gid_max) return;
|
||||
|
||||
/**
|
||||
* base
|
||||
*/
|
||||
|
||||
const u32 pw_len = pws[gid].pw_len;
|
||||
|
||||
const u32 pw_lenv = ceil ((float) pw_len / 4);
|
||||
|
||||
u32 w[64] = { 0 };
|
||||
|
||||
for (int idx = 0; idx < pw_lenv; idx++)
|
||||
{
|
||||
w[idx] = pws[gid].i[idx];
|
||||
|
||||
barrier (CLK_GLOBAL_MEM_FENCE);
|
||||
}
|
||||
|
||||
const u32 salt_len = salt_bufs[salt_pos].salt_len;
|
||||
|
||||
const u32 salt_lenv = ceil ((float) salt_len / 4);
|
||||
|
||||
u32 s[64] = { 0 };
|
||||
|
||||
for (int idx = 0; idx < salt_lenv; idx++)
|
||||
{
|
||||
s[idx] = swap32_S (salt_bufs[salt_pos].salt_buf[idx]);
|
||||
|
||||
barrier (CLK_GLOBAL_MEM_FENCE);
|
||||
}
|
||||
|
||||
/**
|
||||
* loop
|
||||
*/
|
||||
|
||||
for (u32 il_pos = 0; il_pos < il_cnt; il_pos++)
|
||||
{
|
||||
// todo: add rules engine
|
||||
|
||||
sha512_ctx_t ctx;
|
||||
|
||||
sha512_init (&ctx);
|
||||
|
||||
sha512_update_swap (&ctx, w, pw_len);
|
||||
|
||||
sha512_update (&ctx, s, salt_len);
|
||||
|
||||
sha512_final (&ctx);
|
||||
|
||||
const u32 r0 = l32_from_64_S (ctx.h[7]);
|
||||
const u32 r1 = h32_from_64_S (ctx.h[7]);
|
||||
const u32 r2 = l32_from_64_S (ctx.h[3]);
|
||||
const u32 r3 = h32_from_64_S (ctx.h[3]);
|
||||
|
||||
COMPARE_M_SCALAR (r0, r1, r2, r3);
|
||||
}
|
||||
}
|
||||
|
||||
__kernel void m01710_sxx (__global pw_t *pws, __global const kernel_rule_t *rules_buf, __global const pw_t *combs_buf, __global const bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global const u32 *bitmaps_buf_s1_a, __global const u32 *bitmaps_buf_s1_b, __global const u32 *bitmaps_buf_s1_c, __global const u32 *bitmaps_buf_s1_d, __global const u32 *bitmaps_buf_s2_a, __global const u32 *bitmaps_buf_s2_b, __global const u32 *bitmaps_buf_s2_c, __global const u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global const digest_t *digests_buf, __global u32 *hashes_shown, __global const salt_t *salt_bufs, __global const void *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)
|
||||
{
|
||||
/**
|
||||
* modifier
|
||||
*/
|
||||
|
||||
const u32 lid = get_local_id (0);
|
||||
const u32 gid = get_global_id (0);
|
||||
|
||||
if (gid >= gid_max) return;
|
||||
|
||||
/**
|
||||
* digest
|
||||
*/
|
||||
|
||||
const u32 search[4] =
|
||||
{
|
||||
digests_buf[digests_offset].digest_buf[DGST_R0],
|
||||
digests_buf[digests_offset].digest_buf[DGST_R1],
|
||||
digests_buf[digests_offset].digest_buf[DGST_R2],
|
||||
digests_buf[digests_offset].digest_buf[DGST_R3]
|
||||
};
|
||||
|
||||
/**
|
||||
* base
|
||||
*/
|
||||
|
||||
const u32 pw_len = pws[gid].pw_len;
|
||||
|
||||
const u32 pw_lenv = ceil ((float) pw_len / 4);
|
||||
|
||||
u32 w[64] = { 0 };
|
||||
|
||||
for (int idx = 0; idx < pw_lenv; idx++)
|
||||
{
|
||||
w[idx] = pws[gid].i[idx];
|
||||
|
||||
barrier (CLK_GLOBAL_MEM_FENCE);
|
||||
}
|
||||
|
||||
const u32 salt_len = salt_bufs[salt_pos].salt_len;
|
||||
|
||||
const u32 salt_lenv = ceil ((float) salt_len / 4);
|
||||
|
||||
u32 s[64] = { 0 };
|
||||
|
||||
for (int idx = 0; idx < salt_lenv; idx++)
|
||||
{
|
||||
s[idx] = swap32_S (salt_bufs[salt_pos].salt_buf[idx]);
|
||||
|
||||
barrier (CLK_GLOBAL_MEM_FENCE);
|
||||
}
|
||||
|
||||
/**
|
||||
* loop
|
||||
*/
|
||||
|
||||
for (u32 il_pos = 0; il_pos < il_cnt; il_pos++)
|
||||
{
|
||||
// todo: add rules engine
|
||||
|
||||
sha512_ctx_t ctx;
|
||||
|
||||
sha512_init (&ctx);
|
||||
|
||||
sha512_update_swap (&ctx, w, pw_len);
|
||||
|
||||
sha512_update (&ctx, s, salt_len);
|
||||
|
||||
sha512_final (&ctx);
|
||||
|
||||
const u32 r0 = l32_from_64_S (ctx.h[7]);
|
||||
const u32 r1 = h32_from_64_S (ctx.h[7]);
|
||||
const u32 r2 = l32_from_64_S (ctx.h[3]);
|
||||
const u32 r3 = h32_from_64_S (ctx.h[3]);
|
||||
|
||||
COMPARE_S_SCALAR (r0, r1, r2, r3);
|
||||
}
|
||||
}
|
140
OpenCL/m01710_a1-pure.cl
Normal file
140
OpenCL/m01710_a1-pure.cl
Normal file
@ -0,0 +1,140 @@
|
||||
/**
|
||||
* Author......: See docs/credits.txt
|
||||
* License.....: MIT
|
||||
*/
|
||||
|
||||
//#define NEW_SIMD_CODE
|
||||
|
||||
#include "inc_vendor.cl"
|
||||
#include "inc_hash_constants.h"
|
||||
#include "inc_hash_functions.cl"
|
||||
#include "inc_types.cl"
|
||||
#include "inc_common.cl"
|
||||
#include "inc_scalar.cl"
|
||||
#include "inc_hash_sha512.cl"
|
||||
|
||||
__kernel void m01710_mxx (__global pw_t *pws, __global const kernel_rule_t *rules_buf, __global const pw_t *combs_buf, __global const bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global const u32 *bitmaps_buf_s1_a, __global const u32 *bitmaps_buf_s1_b, __global const u32 *bitmaps_buf_s1_c, __global const u32 *bitmaps_buf_s1_d, __global const u32 *bitmaps_buf_s2_a, __global const u32 *bitmaps_buf_s2_b, __global const u32 *bitmaps_buf_s2_c, __global const u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global const digest_t *digests_buf, __global u32 *hashes_shown, __global const salt_t *salt_bufs, __global const void *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)
|
||||
{
|
||||
/**
|
||||
* modifier
|
||||
*/
|
||||
|
||||
const u32 lid = get_local_id (0);
|
||||
const u32 gid = get_global_id (0);
|
||||
|
||||
if (gid >= gid_max) return;
|
||||
|
||||
/**
|
||||
* base
|
||||
*/
|
||||
|
||||
const u32 salt_len = salt_bufs[salt_pos].salt_len;
|
||||
|
||||
const u32 salt_lenv = ceil ((float) salt_len / 4);
|
||||
|
||||
u32 s[64] = { 0 };
|
||||
|
||||
for (int idx = 0; idx < salt_lenv; idx++)
|
||||
{
|
||||
s[idx] = swap32_S (salt_bufs[salt_pos].salt_buf[idx]);
|
||||
|
||||
barrier (CLK_GLOBAL_MEM_FENCE);
|
||||
}
|
||||
|
||||
sha512_ctx_t ctx0;
|
||||
|
||||
sha512_init (&ctx0);
|
||||
|
||||
sha512_update_global_swap (&ctx0, pws[gid].i, pws[gid].pw_len);
|
||||
|
||||
/**
|
||||
* loop
|
||||
*/
|
||||
|
||||
for (u32 il_pos = 0; il_pos < il_cnt; il_pos++)
|
||||
{
|
||||
sha512_ctx_t ctx = ctx0;
|
||||
|
||||
sha512_update_global_swap (&ctx, combs_buf[il_pos].i, combs_buf[il_pos].pw_len);
|
||||
|
||||
sha512_update (&ctx, s, salt_len);
|
||||
|
||||
sha512_final (&ctx);
|
||||
|
||||
const u32 r0 = l32_from_64_S (ctx.h[7]);
|
||||
const u32 r1 = h32_from_64_S (ctx.h[7]);
|
||||
const u32 r2 = l32_from_64_S (ctx.h[3]);
|
||||
const u32 r3 = h32_from_64_S (ctx.h[3]);
|
||||
|
||||
COMPARE_M_SCALAR (r0, r1, r2, r3);
|
||||
}
|
||||
}
|
||||
|
||||
__kernel void m01710_sxx (__global pw_t *pws, __global const kernel_rule_t *rules_buf, __global const pw_t *combs_buf, __global const bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global const u32 *bitmaps_buf_s1_a, __global const u32 *bitmaps_buf_s1_b, __global const u32 *bitmaps_buf_s1_c, __global const u32 *bitmaps_buf_s1_d, __global const u32 *bitmaps_buf_s2_a, __global const u32 *bitmaps_buf_s2_b, __global const u32 *bitmaps_buf_s2_c, __global const u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global const digest_t *digests_buf, __global u32 *hashes_shown, __global const salt_t *salt_bufs, __global const void *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)
|
||||
{
|
||||
/**
|
||||
* modifier
|
||||
*/
|
||||
|
||||
const u32 lid = get_local_id (0);
|
||||
const u32 gid = get_global_id (0);
|
||||
|
||||
if (gid >= gid_max) return;
|
||||
|
||||
/**
|
||||
* digest
|
||||
*/
|
||||
|
||||
const u32 search[4] =
|
||||
{
|
||||
digests_buf[digests_offset].digest_buf[DGST_R0],
|
||||
digests_buf[digests_offset].digest_buf[DGST_R1],
|
||||
digests_buf[digests_offset].digest_buf[DGST_R2],
|
||||
digests_buf[digests_offset].digest_buf[DGST_R3]
|
||||
};
|
||||
|
||||
/**
|
||||
* base
|
||||
*/
|
||||
|
||||
const u32 salt_len = salt_bufs[salt_pos].salt_len;
|
||||
|
||||
const u32 salt_lenv = ceil ((float) salt_len / 4);
|
||||
|
||||
u32 s[64] = { 0 };
|
||||
|
||||
for (int idx = 0; idx < salt_lenv; idx++)
|
||||
{
|
||||
s[idx] = swap32_S (salt_bufs[salt_pos].salt_buf[idx]);
|
||||
|
||||
barrier (CLK_GLOBAL_MEM_FENCE);
|
||||
}
|
||||
|
||||
sha512_ctx_t ctx0;
|
||||
|
||||
sha512_init (&ctx0);
|
||||
|
||||
sha512_update_global_swap (&ctx0, pws[gid].i, pws[gid].pw_len);
|
||||
|
||||
/**
|
||||
* loop
|
||||
*/
|
||||
|
||||
for (u32 il_pos = 0; il_pos < il_cnt; il_pos++)
|
||||
{
|
||||
sha512_ctx_t ctx = ctx0;
|
||||
|
||||
sha512_update_global_swap (&ctx, combs_buf[il_pos].i, combs_buf[il_pos].pw_len);
|
||||
|
||||
sha512_update (&ctx, s, salt_len);
|
||||
|
||||
sha512_final (&ctx);
|
||||
|
||||
const u32 r0 = l32_from_64_S (ctx.h[7]);
|
||||
const u32 r1 = h32_from_64_S (ctx.h[7]);
|
||||
const u32 r2 = l32_from_64_S (ctx.h[3]);
|
||||
const u32 r3 = h32_from_64_S (ctx.h[3]);
|
||||
|
||||
COMPARE_S_SCALAR (r0, r1, r2, r3);
|
||||
}
|
||||
}
|
174
OpenCL/m01710_a3-pure.cl
Normal file
174
OpenCL/m01710_a3-pure.cl
Normal file
@ -0,0 +1,174 @@
|
||||
/**
|
||||
* Author......: See docs/credits.txt
|
||||
* License.....: MIT
|
||||
*/
|
||||
|
||||
#define NEW_SIMD_CODE
|
||||
|
||||
#include "inc_vendor.cl"
|
||||
#include "inc_hash_constants.h"
|
||||
#include "inc_hash_functions.cl"
|
||||
#include "inc_types.cl"
|
||||
#include "inc_common.cl"
|
||||
#include "inc_simd.cl"
|
||||
#include "inc_hash_sha512.cl"
|
||||
|
||||
__kernel void m01710_mxx (__global pw_t *pws, __global const kernel_rule_t *rules_buf, __global const pw_t *combs_buf, __global const u32x *words_buf_r, __global void *tmps, __global void *hooks, __global const u32 *bitmaps_buf_s1_a, __global const u32 *bitmaps_buf_s1_b, __global const u32 *bitmaps_buf_s1_c, __global const u32 *bitmaps_buf_s1_d, __global const u32 *bitmaps_buf_s2_a, __global const u32 *bitmaps_buf_s2_b, __global const u32 *bitmaps_buf_s2_c, __global const u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global const digest_t *digests_buf, __global u32 *hashes_shown, __global const salt_t *salt_bufs, __global const void *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)
|
||||
{
|
||||
/**
|
||||
* modifier
|
||||
*/
|
||||
|
||||
const u32 lid = get_local_id (0);
|
||||
const u32 gid = get_global_id (0);
|
||||
|
||||
if (gid >= gid_max) return;
|
||||
|
||||
/**
|
||||
* base
|
||||
*/
|
||||
|
||||
const u32 pw_len = pws[gid].pw_len;
|
||||
|
||||
const u32 pw_lenv = ceil ((float) pw_len / 4);
|
||||
|
||||
u32x w[64] = { 0 };
|
||||
|
||||
for (int idx = 0; idx < pw_lenv; idx++)
|
||||
{
|
||||
w[idx] = pws[gid].i[idx];
|
||||
|
||||
barrier (CLK_GLOBAL_MEM_FENCE);
|
||||
}
|
||||
|
||||
const u32 salt_len = salt_bufs[salt_pos].salt_len;
|
||||
|
||||
const u32 salt_lenv = ceil ((float) salt_len / 4);
|
||||
|
||||
u32x s[64] = { 0 };
|
||||
|
||||
for (int idx = 0; idx < salt_lenv; idx++)
|
||||
{
|
||||
s[idx] = swap32_S (salt_bufs[salt_pos].salt_buf[idx]);
|
||||
|
||||
barrier (CLK_GLOBAL_MEM_FENCE);
|
||||
}
|
||||
|
||||
/**
|
||||
* loop
|
||||
*/
|
||||
|
||||
u32x w0l = w[0];
|
||||
|
||||
for (u32 il_pos = 0; il_pos < il_cnt; il_pos += VECT_SIZE)
|
||||
{
|
||||
const u32x w0r = words_buf_r[il_pos / VECT_SIZE];
|
||||
|
||||
const u32x w0 = w0l | w0r;
|
||||
|
||||
w[0] = w0;
|
||||
|
||||
sha512_ctx_vector_t ctx;
|
||||
|
||||
sha512_init_vector (&ctx);
|
||||
|
||||
sha512_update_vector (&ctx, w, pw_len);
|
||||
|
||||
sha512_update_vector (&ctx, s, salt_len);
|
||||
|
||||
sha512_final_vector (&ctx);
|
||||
|
||||
const u32x r0 = l32_from_64 (ctx.h[7]);
|
||||
const u32x r1 = h32_from_64 (ctx.h[7]);
|
||||
const u32x r2 = l32_from_64 (ctx.h[3]);
|
||||
const u32x r3 = h32_from_64 (ctx.h[3]);
|
||||
|
||||
COMPARE_M_SIMD (r0, r1, r2, r3);
|
||||
}
|
||||
}
|
||||
|
||||
__kernel void m01710_sxx (__global pw_t *pws, __global const kernel_rule_t *rules_buf, __global const pw_t *combs_buf, __global const u32x *words_buf_r, __global void *tmps, __global void *hooks, __global const u32 *bitmaps_buf_s1_a, __global const u32 *bitmaps_buf_s1_b, __global const u32 *bitmaps_buf_s1_c, __global const u32 *bitmaps_buf_s1_d, __global const u32 *bitmaps_buf_s2_a, __global const u32 *bitmaps_buf_s2_b, __global const u32 *bitmaps_buf_s2_c, __global const u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global const digest_t *digests_buf, __global u32 *hashes_shown, __global const salt_t *salt_bufs, __global const void *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)
|
||||
{
|
||||
/**
|
||||
* modifier
|
||||
*/
|
||||
|
||||
const u32 lid = get_local_id (0);
|
||||
const u32 gid = get_global_id (0);
|
||||
|
||||
if (gid >= gid_max) return;
|
||||
|
||||
/**
|
||||
* digest
|
||||
*/
|
||||
|
||||
const u32 search[4] =
|
||||
{
|
||||
digests_buf[digests_offset].digest_buf[DGST_R0],
|
||||
digests_buf[digests_offset].digest_buf[DGST_R1],
|
||||
digests_buf[digests_offset].digest_buf[DGST_R2],
|
||||
digests_buf[digests_offset].digest_buf[DGST_R3]
|
||||
};
|
||||
|
||||
/**
|
||||
* base
|
||||
*/
|
||||
|
||||
const u32 pw_len = pws[gid].pw_len;
|
||||
|
||||
const u32 pw_lenv = ceil ((float) pw_len / 4);
|
||||
|
||||
u32x w[64] = { 0 };
|
||||
|
||||
for (int idx = 0; idx < pw_lenv; idx++)
|
||||
{
|
||||
w[idx] = pws[gid].i[idx];
|
||||
|
||||
barrier (CLK_GLOBAL_MEM_FENCE);
|
||||
}
|
||||
|
||||
const u32 salt_len = salt_bufs[salt_pos].salt_len;
|
||||
|
||||
const u32 salt_lenv = ceil ((float) salt_len / 4);
|
||||
|
||||
u32x s[64] = { 0 };
|
||||
|
||||
for (int idx = 0; idx < salt_lenv; idx++)
|
||||
{
|
||||
s[idx] = swap32_S (salt_bufs[salt_pos].salt_buf[idx]);
|
||||
|
||||
barrier (CLK_GLOBAL_MEM_FENCE);
|
||||
}
|
||||
|
||||
/**
|
||||
* loop
|
||||
*/
|
||||
|
||||
u32x w0l = w[0];
|
||||
|
||||
for (u32 il_pos = 0; il_pos < il_cnt; il_pos += VECT_SIZE)
|
||||
{
|
||||
const u32x w0r = words_buf_r[il_pos / VECT_SIZE];
|
||||
|
||||
const u32x w0 = w0l | w0r;
|
||||
|
||||
w[0] = w0;
|
||||
|
||||
sha512_ctx_vector_t ctx;
|
||||
|
||||
sha512_init_vector (&ctx);
|
||||
|
||||
sha512_update_vector (&ctx, w, pw_len);
|
||||
|
||||
sha512_update_vector (&ctx, s, salt_len);
|
||||
|
||||
sha512_final_vector (&ctx);
|
||||
|
||||
const u32x r0 = l32_from_64 (ctx.h[7]);
|
||||
const u32x r1 = h32_from_64 (ctx.h[7]);
|
||||
const u32x r2 = l32_from_64 (ctx.h[3]);
|
||||
const u32x r3 = h32_from_64 (ctx.h[3]);
|
||||
|
||||
COMPARE_S_SIMD (r0, r1, r2, r3);
|
||||
}
|
||||
}
|
142
OpenCL/m01720_a0-pure.cl
Normal file
142
OpenCL/m01720_a0-pure.cl
Normal file
@ -0,0 +1,142 @@
|
||||
/**
|
||||
* Author......: See docs/credits.txt
|
||||
* License.....: MIT
|
||||
*/
|
||||
|
||||
//#define NEW_SIMD_CODE
|
||||
|
||||
#include "inc_vendor.cl"
|
||||
#include "inc_hash_constants.h"
|
||||
#include "inc_hash_functions.cl"
|
||||
#include "inc_types.cl"
|
||||
#include "inc_common.cl"
|
||||
#include "inc_rp.h"
|
||||
#include "inc_rp.cl"
|
||||
#include "inc_scalar.cl"
|
||||
#include "inc_hash_sha512.cl"
|
||||
|
||||
__kernel void m01720_mxx (__global pw_t *pws, __global const kernel_rule_t *rules_buf, __global const pw_t *combs_buf, __global const bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global const u32 *bitmaps_buf_s1_a, __global const u32 *bitmaps_buf_s1_b, __global const u32 *bitmaps_buf_s1_c, __global const u32 *bitmaps_buf_s1_d, __global const u32 *bitmaps_buf_s2_a, __global const u32 *bitmaps_buf_s2_b, __global const u32 *bitmaps_buf_s2_c, __global const u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global const digest_t *digests_buf, __global u32 *hashes_shown, __global const salt_t *salt_bufs, __global const void *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)
|
||||
{
|
||||
/**
|
||||
* modifier
|
||||
*/
|
||||
|
||||
const u32 lid = get_local_id (0);
|
||||
const u32 gid = get_global_id (0);
|
||||
|
||||
if (gid >= gid_max) return;
|
||||
|
||||
/**
|
||||
* base
|
||||
*/
|
||||
|
||||
const u32 pw_len = pws[gid].pw_len;
|
||||
|
||||
const u32 pw_lenv = ceil ((float) pw_len / 4);
|
||||
|
||||
u32 w[64] = { 0 };
|
||||
|
||||
for (int idx = 0; idx < pw_lenv; idx++)
|
||||
{
|
||||
w[idx] = pws[gid].i[idx];
|
||||
|
||||
barrier (CLK_GLOBAL_MEM_FENCE);
|
||||
}
|
||||
|
||||
sha512_ctx_t ctx0;
|
||||
|
||||
sha512_init (&ctx0);
|
||||
|
||||
sha512_update_global_swap (&ctx0, salt_bufs[salt_pos].salt_buf, salt_bufs[salt_pos].salt_len);
|
||||
|
||||
/**
|
||||
* loop
|
||||
*/
|
||||
|
||||
for (u32 il_pos = 0; il_pos < il_cnt; il_pos++)
|
||||
{
|
||||
// todo: add rules engine
|
||||
|
||||
sha512_ctx_t ctx = ctx0;
|
||||
|
||||
sha512_update_swap (&ctx, w, pw_len);
|
||||
|
||||
sha512_final (&ctx);
|
||||
|
||||
const u32 r0 = l32_from_64_S (ctx.h[7]);
|
||||
const u32 r1 = h32_from_64_S (ctx.h[7]);
|
||||
const u32 r2 = l32_from_64_S (ctx.h[3]);
|
||||
const u32 r3 = h32_from_64_S (ctx.h[3]);
|
||||
|
||||
COMPARE_M_SCALAR (r0, r1, r2, r3);
|
||||
}
|
||||
}
|
||||
|
||||
__kernel void m01720_sxx (__global pw_t *pws, __global const kernel_rule_t *rules_buf, __global const pw_t *combs_buf, __global const bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global const u32 *bitmaps_buf_s1_a, __global const u32 *bitmaps_buf_s1_b, __global const u32 *bitmaps_buf_s1_c, __global const u32 *bitmaps_buf_s1_d, __global const u32 *bitmaps_buf_s2_a, __global const u32 *bitmaps_buf_s2_b, __global const u32 *bitmaps_buf_s2_c, __global const u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global const digest_t *digests_buf, __global u32 *hashes_shown, __global const salt_t *salt_bufs, __global const void *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)
|
||||
{
|
||||
/**
|
||||
* modifier
|
||||
*/
|
||||
|
||||
const u32 lid = get_local_id (0);
|
||||
const u32 gid = get_global_id (0);
|
||||
|
||||
if (gid >= gid_max) return;
|
||||
|
||||
/**
|
||||
* digest
|
||||
*/
|
||||
|
||||
const u32 search[4] =
|
||||
{
|
||||
digests_buf[digests_offset].digest_buf[DGST_R0],
|
||||
digests_buf[digests_offset].digest_buf[DGST_R1],
|
||||
digests_buf[digests_offset].digest_buf[DGST_R2],
|
||||
digests_buf[digests_offset].digest_buf[DGST_R3]
|
||||
};
|
||||
|
||||
/**
|
||||
* base
|
||||
*/
|
||||
|
||||
const u32 pw_len = pws[gid].pw_len;
|
||||
|
||||
const u32 pw_lenv = ceil ((float) pw_len / 4);
|
||||
|
||||
u32 w[64] = { 0 };
|
||||
|
||||
for (int idx = 0; idx < pw_lenv; idx++)
|
||||
{
|
||||
w[idx] = pws[gid].i[idx];
|
||||
|
||||
barrier (CLK_GLOBAL_MEM_FENCE);
|
||||
}
|
||||
|
||||
sha512_ctx_t ctx0;
|
||||
|
||||
sha512_init (&ctx0);
|
||||
|
||||
sha512_update_global_swap (&ctx0, salt_bufs[salt_pos].salt_buf, salt_bufs[salt_pos].salt_len);
|
||||
|
||||
/**
|
||||
* loop
|
||||
*/
|
||||
|
||||
for (u32 il_pos = 0; il_pos < il_cnt; il_pos++)
|
||||
{
|
||||
// todo: add rules engine
|
||||
|
||||
sha512_ctx_t ctx = ctx0;
|
||||
|
||||
sha512_update_swap (&ctx, w, pw_len);
|
||||
|
||||
sha512_final (&ctx);
|
||||
|
||||
const u32 r0 = l32_from_64_S (ctx.h[7]);
|
||||
const u32 r1 = h32_from_64_S (ctx.h[7]);
|
||||
const u32 r2 = l32_from_64_S (ctx.h[3]);
|
||||
const u32 r3 = h32_from_64_S (ctx.h[3]);
|
||||
|
||||
COMPARE_S_SCALAR (r0, r1, r2, r3);
|
||||
}
|
||||
}
|
114
OpenCL/m01720_a1-pure.cl
Normal file
114
OpenCL/m01720_a1-pure.cl
Normal file
@ -0,0 +1,114 @@
|
||||
/**
|
||||
* Author......: See docs/credits.txt
|
||||
* License.....: MIT
|
||||
*/
|
||||
|
||||
//#define NEW_SIMD_CODE
|
||||
|
||||
#include "inc_vendor.cl"
|
||||
#include "inc_hash_constants.h"
|
||||
#include "inc_hash_functions.cl"
|
||||
#include "inc_types.cl"
|
||||
#include "inc_common.cl"
|
||||
#include "inc_scalar.cl"
|
||||
#include "inc_hash_sha512.cl"
|
||||
|
||||
__kernel void m01720_mxx (__global pw_t *pws, __global const kernel_rule_t *rules_buf, __global const pw_t *combs_buf, __global const bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global const u32 *bitmaps_buf_s1_a, __global const u32 *bitmaps_buf_s1_b, __global const u32 *bitmaps_buf_s1_c, __global const u32 *bitmaps_buf_s1_d, __global const u32 *bitmaps_buf_s2_a, __global const u32 *bitmaps_buf_s2_b, __global const u32 *bitmaps_buf_s2_c, __global const u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global const digest_t *digests_buf, __global u32 *hashes_shown, __global const salt_t *salt_bufs, __global const void *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)
|
||||
{
|
||||
/**
|
||||
* modifier
|
||||
*/
|
||||
|
||||
const u32 lid = get_local_id (0);
|
||||
const u32 gid = get_global_id (0);
|
||||
|
||||
if (gid >= gid_max) return;
|
||||
|
||||
/**
|
||||
* base
|
||||
*/
|
||||
|
||||
sha512_ctx_t ctx0;
|
||||
|
||||
sha512_init (&ctx0);
|
||||
|
||||
sha512_update_global_swap (&ctx0, salt_bufs[salt_pos].salt_buf, salt_bufs[salt_pos].salt_len);
|
||||
|
||||
sha512_update_global_swap (&ctx0, pws[gid].i, pws[gid].pw_len);
|
||||
|
||||
/**
|
||||
* loop
|
||||
*/
|
||||
|
||||
for (u32 il_pos = 0; il_pos < il_cnt; il_pos++)
|
||||
{
|
||||
sha512_ctx_t ctx = ctx0;
|
||||
|
||||
sha512_update_global_swap (&ctx, combs_buf[il_pos].i, combs_buf[il_pos].pw_len);
|
||||
|
||||
sha512_final (&ctx);
|
||||
|
||||
const u32 r0 = l32_from_64_S (ctx.h[7]);
|
||||
const u32 r1 = h32_from_64_S (ctx.h[7]);
|
||||
const u32 r2 = l32_from_64_S (ctx.h[3]);
|
||||
const u32 r3 = h32_from_64_S (ctx.h[3]);
|
||||
|
||||
COMPARE_M_SCALAR (r0, r1, r2, r3);
|
||||
}
|
||||
}
|
||||
|
||||
__kernel void m01720_sxx (__global pw_t *pws, __global const kernel_rule_t *rules_buf, __global const pw_t *combs_buf, __global const bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global const u32 *bitmaps_buf_s1_a, __global const u32 *bitmaps_buf_s1_b, __global const u32 *bitmaps_buf_s1_c, __global const u32 *bitmaps_buf_s1_d, __global const u32 *bitmaps_buf_s2_a, __global const u32 *bitmaps_buf_s2_b, __global const u32 *bitmaps_buf_s2_c, __global const u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global const digest_t *digests_buf, __global u32 *hashes_shown, __global const salt_t *salt_bufs, __global const void *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)
|
||||
{
|
||||
/**
|
||||
* modifier
|
||||
*/
|
||||
|
||||
const u32 lid = get_local_id (0);
|
||||
const u32 gid = get_global_id (0);
|
||||
|
||||
if (gid >= gid_max) return;
|
||||
|
||||
/**
|
||||
* digest
|
||||
*/
|
||||
|
||||
const u32 search[4] =
|
||||
{
|
||||
digests_buf[digests_offset].digest_buf[DGST_R0],
|
||||
digests_buf[digests_offset].digest_buf[DGST_R1],
|
||||
digests_buf[digests_offset].digest_buf[DGST_R2],
|
||||
digests_buf[digests_offset].digest_buf[DGST_R3]
|
||||
};
|
||||
|
||||
/**
|
||||
* base
|
||||
*/
|
||||
|
||||
sha512_ctx_t ctx0;
|
||||
|
||||
sha512_init (&ctx0);
|
||||
|
||||
sha512_update_global_swap (&ctx0, salt_bufs[salt_pos].salt_buf, salt_bufs[salt_pos].salt_len);
|
||||
|
||||
sha512_update_global_swap (&ctx0, pws[gid].i, pws[gid].pw_len);
|
||||
|
||||
/**
|
||||
* loop
|
||||
*/
|
||||
|
||||
for (u32 il_pos = 0; il_pos < il_cnt; il_pos++)
|
||||
{
|
||||
sha512_ctx_t ctx = ctx0;
|
||||
|
||||
sha512_update_global_swap (&ctx, combs_buf[il_pos].i, combs_buf[il_pos].pw_len);
|
||||
|
||||
sha512_final (&ctx);
|
||||
|
||||
const u32 r0 = l32_from_64_S (ctx.h[7]);
|
||||
const u32 r1 = h32_from_64_S (ctx.h[7]);
|
||||
const u32 r2 = l32_from_64_S (ctx.h[3]);
|
||||
const u32 r3 = h32_from_64_S (ctx.h[3]);
|
||||
|
||||
COMPARE_S_SCALAR (r0, r1, r2, r3);
|
||||
}
|
||||
}
|
156
OpenCL/m01720_a3-pure.cl
Normal file
156
OpenCL/m01720_a3-pure.cl
Normal file
@ -0,0 +1,156 @@
|
||||
/**
|
||||
* Author......: See docs/credits.txt
|
||||
* License.....: MIT
|
||||
*/
|
||||
|
||||
#define NEW_SIMD_CODE
|
||||
|
||||
#include "inc_vendor.cl"
|
||||
#include "inc_hash_constants.h"
|
||||
#include "inc_hash_functions.cl"
|
||||
#include "inc_types.cl"
|
||||
#include "inc_common.cl"
|
||||
#include "inc_simd.cl"
|
||||
#include "inc_hash_sha512.cl"
|
||||
|
||||
__kernel void m01720_mxx (__global pw_t *pws, __global const kernel_rule_t *rules_buf, __global const pw_t *combs_buf, __global const u32x *words_buf_r, __global void *tmps, __global void *hooks, __global const u32 *bitmaps_buf_s1_a, __global const u32 *bitmaps_buf_s1_b, __global const u32 *bitmaps_buf_s1_c, __global const u32 *bitmaps_buf_s1_d, __global const u32 *bitmaps_buf_s2_a, __global const u32 *bitmaps_buf_s2_b, __global const u32 *bitmaps_buf_s2_c, __global const u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global const digest_t *digests_buf, __global u32 *hashes_shown, __global const salt_t *salt_bufs, __global const void *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)
|
||||
{
|
||||
/**
|
||||
* modifier
|
||||
*/
|
||||
|
||||
const u32 lid = get_local_id (0);
|
||||
const u32 gid = get_global_id (0);
|
||||
|
||||
if (gid >= gid_max) return;
|
||||
|
||||
/**
|
||||
* base
|
||||
*/
|
||||
|
||||
const u32 pw_len = pws[gid].pw_len;
|
||||
|
||||
const u32 pw_lenv = ceil ((float) pw_len / 4);
|
||||
|
||||
u32x w[64] = { 0 };
|
||||
|
||||
for (int idx = 0; idx < pw_lenv; idx++)
|
||||
{
|
||||
w[idx] = pws[gid].i[idx];
|
||||
|
||||
barrier (CLK_GLOBAL_MEM_FENCE);
|
||||
}
|
||||
|
||||
sha512_ctx_t ctx0;
|
||||
|
||||
sha512_init (&ctx0);
|
||||
|
||||
sha512_update_global_swap (&ctx0, salt_bufs[salt_pos].salt_buf, salt_bufs[salt_pos].salt_len);
|
||||
|
||||
/**
|
||||
* loop
|
||||
*/
|
||||
|
||||
u32x w0l = w[0];
|
||||
|
||||
for (u32 il_pos = 0; il_pos < il_cnt; il_pos += VECT_SIZE)
|
||||
{
|
||||
const u32x w0r = words_buf_r[il_pos / VECT_SIZE];
|
||||
|
||||
const u32x w0 = w0l | w0r;
|
||||
|
||||
w[0] = w0;
|
||||
|
||||
sha512_ctx_vector_t ctx;
|
||||
|
||||
sha512_init_vector_from_scalar (&ctx, &ctx0);
|
||||
|
||||
sha512_update_vector (&ctx, w, pw_len);
|
||||
|
||||
sha512_final_vector (&ctx);
|
||||
|
||||
const u32x r0 = l32_from_64 (ctx.h[7]);
|
||||
const u32x r1 = h32_from_64 (ctx.h[7]);
|
||||
const u32x r2 = l32_from_64 (ctx.h[3]);
|
||||
const u32x r3 = h32_from_64 (ctx.h[3]);
|
||||
|
||||
COMPARE_M_SIMD (r0, r1, r2, r3);
|
||||
}
|
||||
}
|
||||
|
||||
__kernel void m01720_sxx (__global pw_t *pws, __global const kernel_rule_t *rules_buf, __global const pw_t *combs_buf, __global const u32x *words_buf_r, __global void *tmps, __global void *hooks, __global const u32 *bitmaps_buf_s1_a, __global const u32 *bitmaps_buf_s1_b, __global const u32 *bitmaps_buf_s1_c, __global const u32 *bitmaps_buf_s1_d, __global const u32 *bitmaps_buf_s2_a, __global const u32 *bitmaps_buf_s2_b, __global const u32 *bitmaps_buf_s2_c, __global const u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global const digest_t *digests_buf, __global u32 *hashes_shown, __global const salt_t *salt_bufs, __global const void *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)
|
||||
{
|
||||
/**
|
||||
* modifier
|
||||
*/
|
||||
|
||||
const u32 lid = get_local_id (0);
|
||||
const u32 gid = get_global_id (0);
|
||||
|
||||
if (gid >= gid_max) return;
|
||||
|
||||
/**
|
||||
* digest
|
||||
*/
|
||||
|
||||
const u32 search[4] =
|
||||
{
|
||||
digests_buf[digests_offset].digest_buf[DGST_R0],
|
||||
digests_buf[digests_offset].digest_buf[DGST_R1],
|
||||
digests_buf[digests_offset].digest_buf[DGST_R2],
|
||||
digests_buf[digests_offset].digest_buf[DGST_R3]
|
||||
};
|
||||
|
||||
/**
|
||||
* base
|
||||
*/
|
||||
|
||||
const u32 pw_len = pws[gid].pw_len;
|
||||
|
||||
const u32 pw_lenv = ceil ((float) pw_len / 4);
|
||||
|
||||
u32x w[64] = { 0 };
|
||||
|
||||
for (int idx = 0; idx < pw_lenv; idx++)
|
||||
{
|
||||
w[idx] = pws[gid].i[idx];
|
||||
|
||||
barrier (CLK_GLOBAL_MEM_FENCE);
|
||||
}
|
||||
|
||||
sha512_ctx_t ctx0;
|
||||
|
||||
sha512_init (&ctx0);
|
||||
|
||||
sha512_update_global_swap (&ctx0, salt_bufs[salt_pos].salt_buf, salt_bufs[salt_pos].salt_len);
|
||||
|
||||
/**
|
||||
* loop
|
||||
*/
|
||||
|
||||
u32x w0l = w[0];
|
||||
|
||||
for (u32 il_pos = 0; il_pos < il_cnt; il_pos += VECT_SIZE)
|
||||
{
|
||||
const u32x w0r = words_buf_r[il_pos / VECT_SIZE];
|
||||
|
||||
const u32x w0 = w0l | w0r;
|
||||
|
||||
w[0] = w0;
|
||||
|
||||
sha512_ctx_vector_t ctx;
|
||||
|
||||
sha512_init_vector_from_scalar (&ctx, &ctx0);
|
||||
|
||||
sha512_update_vector (&ctx, w, pw_len);
|
||||
|
||||
sha512_final_vector (&ctx);
|
||||
|
||||
const u32x r0 = l32_from_64 (ctx.h[7]);
|
||||
const u32x r1 = h32_from_64 (ctx.h[7]);
|
||||
const u32x r2 = l32_from_64 (ctx.h[3]);
|
||||
const u32x r3 = h32_from_64 (ctx.h[3]);
|
||||
|
||||
COMPARE_S_SIMD (r0, r1, r2, r3);
|
||||
}
|
||||
}
|
164
OpenCL/m01730_a0-pure.cl
Normal file
164
OpenCL/m01730_a0-pure.cl
Normal file
@ -0,0 +1,164 @@
|
||||
/**
|
||||
* Author......: See docs/credits.txt
|
||||
* License.....: MIT
|
||||
*/
|
||||
|
||||
//#define NEW_SIMD_CODE
|
||||
|
||||
#include "inc_vendor.cl"
|
||||
#include "inc_hash_constants.h"
|
||||
#include "inc_hash_functions.cl"
|
||||
#include "inc_types.cl"
|
||||
#include "inc_common.cl"
|
||||
#include "inc_rp.h"
|
||||
#include "inc_rp.cl"
|
||||
#include "inc_scalar.cl"
|
||||
#include "inc_hash_sha512.cl"
|
||||
|
||||
__kernel void m01730_mxx (__global pw_t *pws, __global const kernel_rule_t *rules_buf, __global const pw_t *combs_buf, __global const bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global const u32 *bitmaps_buf_s1_a, __global const u32 *bitmaps_buf_s1_b, __global const u32 *bitmaps_buf_s1_c, __global const u32 *bitmaps_buf_s1_d, __global const u32 *bitmaps_buf_s2_a, __global const u32 *bitmaps_buf_s2_b, __global const u32 *bitmaps_buf_s2_c, __global const u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global const digest_t *digests_buf, __global u32 *hashes_shown, __global const salt_t *salt_bufs, __global const void *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)
|
||||
{
|
||||
/**
|
||||
* modifier
|
||||
*/
|
||||
|
||||
const u32 lid = get_local_id (0);
|
||||
const u32 gid = get_global_id (0);
|
||||
|
||||
if (gid >= gid_max) return;
|
||||
|
||||
/**
|
||||
* base
|
||||
*/
|
||||
|
||||
const u32 pw_len = pws[gid].pw_len;
|
||||
|
||||
const u32 pw_lenv = ceil ((float) pw_len / 4);
|
||||
|
||||
u32 w[64] = { 0 };
|
||||
|
||||
for (int idx = 0; idx < pw_lenv; idx++)
|
||||
{
|
||||
w[idx] = pws[gid].i[idx];
|
||||
|
||||
barrier (CLK_GLOBAL_MEM_FENCE);
|
||||
}
|
||||
|
||||
const u32 salt_len = salt_bufs[salt_pos].salt_len;
|
||||
|
||||
const u32 salt_lenv = ceil ((float) salt_len / 4);
|
||||
|
||||
u32 s[64] = { 0 };
|
||||
|
||||
for (int idx = 0; idx < salt_lenv; idx++)
|
||||
{
|
||||
s[idx] = swap32_S (salt_bufs[salt_pos].salt_buf[idx]);
|
||||
|
||||
barrier (CLK_GLOBAL_MEM_FENCE);
|
||||
}
|
||||
|
||||
/**
|
||||
* loop
|
||||
*/
|
||||
|
||||
for (u32 il_pos = 0; il_pos < il_cnt; il_pos++)
|
||||
{
|
||||
// todo: add rules engine
|
||||
|
||||
sha512_ctx_t ctx;
|
||||
|
||||
sha512_init (&ctx);
|
||||
|
||||
sha512_update_utf16le_swap (&ctx, w, pw_len);
|
||||
|
||||
sha512_update (&ctx, s, salt_len);
|
||||
|
||||
sha512_final (&ctx);
|
||||
|
||||
const u32 r0 = l32_from_64_S (ctx.h[7]);
|
||||
const u32 r1 = h32_from_64_S (ctx.h[7]);
|
||||
const u32 r2 = l32_from_64_S (ctx.h[3]);
|
||||
const u32 r3 = h32_from_64_S (ctx.h[3]);
|
||||
|
||||
COMPARE_M_SCALAR (r0, r1, r2, r3);
|
||||
}
|
||||
}
|
||||
|
||||
__kernel void m01730_sxx (__global pw_t *pws, __global const kernel_rule_t *rules_buf, __global const pw_t *combs_buf, __global const bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global const u32 *bitmaps_buf_s1_a, __global const u32 *bitmaps_buf_s1_b, __global const u32 *bitmaps_buf_s1_c, __global const u32 *bitmaps_buf_s1_d, __global const u32 *bitmaps_buf_s2_a, __global const u32 *bitmaps_buf_s2_b, __global const u32 *bitmaps_buf_s2_c, __global const u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global const digest_t *digests_buf, __global u32 *hashes_shown, __global const salt_t *salt_bufs, __global const void *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)
|
||||
{
|
||||
/**
|
||||
* modifier
|
||||
*/
|
||||
|
||||
const u32 lid = get_local_id (0);
|
||||
const u32 gid = get_global_id (0);
|
||||
|
||||
if (gid >= gid_max) return;
|
||||
|
||||
/**
|
||||
* digest
|
||||
*/
|
||||
|
||||
const u32 search[4] =
|
||||
{
|
||||
digests_buf[digests_offset].digest_buf[DGST_R0],
|
||||
digests_buf[digests_offset].digest_buf[DGST_R1],
|
||||
digests_buf[digests_offset].digest_buf[DGST_R2],
|
||||
digests_buf[digests_offset].digest_buf[DGST_R3]
|
||||
};
|
||||
|
||||
/**
|
||||
* base
|
||||
*/
|
||||
|
||||
const u32 pw_len = pws[gid].pw_len;
|
||||
|
||||
const u32 pw_lenv = ceil ((float) pw_len / 4);
|
||||
|
||||
u32 w[64] = { 0 };
|
||||
|
||||
for (int idx = 0; idx < pw_lenv; idx++)
|
||||
{
|
||||
w[idx] = pws[gid].i[idx];
|
||||
|
||||
barrier (CLK_GLOBAL_MEM_FENCE);
|
||||
}
|
||||
|
||||
const u32 salt_len = salt_bufs[salt_pos].salt_len;
|
||||
|
||||
const u32 salt_lenv = ceil ((float) salt_len / 4);
|
||||
|
||||
u32 s[64] = { 0 };
|
||||
|
||||
for (int idx = 0; idx < salt_lenv; idx++)
|
||||
{
|
||||
s[idx] = swap32_S (salt_bufs[salt_pos].salt_buf[idx]);
|
||||
|
||||
barrier (CLK_GLOBAL_MEM_FENCE);
|
||||
}
|
||||
|
||||
/**
|
||||
* loop
|
||||
*/
|
||||
|
||||
for (u32 il_pos = 0; il_pos < il_cnt; il_pos++)
|
||||
{
|
||||
// todo: add rules engine
|
||||
|
||||
sha512_ctx_t ctx;
|
||||
|
||||
sha512_init (&ctx);
|
||||
|
||||
sha512_update_utf16le_swap (&ctx, w, pw_len);
|
||||
|
||||
sha512_update (&ctx, s, salt_len);
|
||||
|
||||
sha512_final (&ctx);
|
||||
|
||||
const u32 r0 = l32_from_64_S (ctx.h[7]);
|
||||
const u32 r1 = h32_from_64_S (ctx.h[7]);
|
||||
const u32 r2 = l32_from_64_S (ctx.h[3]);
|
||||
const u32 r3 = h32_from_64_S (ctx.h[3]);
|
||||
|
||||
COMPARE_S_SCALAR (r0, r1, r2, r3);
|
||||
}
|
||||
}
|
140
OpenCL/m01730_a1-pure.cl
Normal file
140
OpenCL/m01730_a1-pure.cl
Normal file
@ -0,0 +1,140 @@
|
||||
/**
|
||||
* Author......: See docs/credits.txt
|
||||
* License.....: MIT
|
||||
*/
|
||||
|
||||
//#define NEW_SIMD_CODE
|
||||
|
||||
#include "inc_vendor.cl"
|
||||
#include "inc_hash_constants.h"
|
||||
#include "inc_hash_functions.cl"
|
||||
#include "inc_types.cl"
|
||||
#include "inc_common.cl"
|
||||
#include "inc_scalar.cl"
|
||||
#include "inc_hash_sha512.cl"
|
||||
|
||||
__kernel void m01730_mxx (__global pw_t *pws, __global const kernel_rule_t *rules_buf, __global const pw_t *combs_buf, __global const bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global const u32 *bitmaps_buf_s1_a, __global const u32 *bitmaps_buf_s1_b, __global const u32 *bitmaps_buf_s1_c, __global const u32 *bitmaps_buf_s1_d, __global const u32 *bitmaps_buf_s2_a, __global const u32 *bitmaps_buf_s2_b, __global const u32 *bitmaps_buf_s2_c, __global const u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global const digest_t *digests_buf, __global u32 *hashes_shown, __global const salt_t *salt_bufs, __global const void *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)
|
||||
{
|
||||
/**
|
||||
* modifier
|
||||
*/
|
||||
|
||||
const u32 lid = get_local_id (0);
|
||||
const u32 gid = get_global_id (0);
|
||||
|
||||
if (gid >= gid_max) return;
|
||||
|
||||
/**
|
||||
* base
|
||||
*/
|
||||
|
||||
const u32 salt_len = salt_bufs[salt_pos].salt_len;
|
||||
|
||||
const u32 salt_lenv = ceil ((float) salt_len / 4);
|
||||
|
||||
u32 s[64] = { 0 };
|
||||
|
||||
for (int idx = 0; idx < salt_lenv; idx++)
|
||||
{
|
||||
s[idx] = swap32_S (salt_bufs[salt_pos].salt_buf[idx]);
|
||||
|
||||
barrier (CLK_GLOBAL_MEM_FENCE);
|
||||
}
|
||||
|
||||
sha512_ctx_t ctx0;
|
||||
|
||||
sha512_init (&ctx0);
|
||||
|
||||
sha512_update_global_utf16le_swap (&ctx0, pws[gid].i, pws[gid].pw_len);
|
||||
|
||||
/**
|
||||
* loop
|
||||
*/
|
||||
|
||||
for (u32 il_pos = 0; il_pos < il_cnt; il_pos++)
|
||||
{
|
||||
sha512_ctx_t ctx = ctx0;
|
||||
|
||||
sha512_update_global_utf16le_swap (&ctx, combs_buf[il_pos].i, combs_buf[il_pos].pw_len);
|
||||
|
||||
sha512_update (&ctx, s, salt_len);
|
||||
|
||||
sha512_final (&ctx);
|
||||
|
||||
const u32 r0 = l32_from_64_S (ctx.h[7]);
|
||||
const u32 r1 = h32_from_64_S (ctx.h[7]);
|
||||
const u32 r2 = l32_from_64_S (ctx.h[3]);
|
||||
const u32 r3 = h32_from_64_S (ctx.h[3]);
|
||||
|
||||
COMPARE_M_SCALAR (r0, r1, r2, r3);
|
||||
}
|
||||
}
|
||||
|
||||
__kernel void m01730_sxx (__global pw_t *pws, __global const kernel_rule_t *rules_buf, __global const pw_t *combs_buf, __global const bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global const u32 *bitmaps_buf_s1_a, __global const u32 *bitmaps_buf_s1_b, __global const u32 *bitmaps_buf_s1_c, __global const u32 *bitmaps_buf_s1_d, __global const u32 *bitmaps_buf_s2_a, __global const u32 *bitmaps_buf_s2_b, __global const u32 *bitmaps_buf_s2_c, __global const u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global const digest_t *digests_buf, __global u32 *hashes_shown, __global const salt_t *salt_bufs, __global const void *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)
|
||||
{
|
||||
/**
|
||||
* modifier
|
||||
*/
|
||||
|
||||
const u32 lid = get_local_id (0);
|
||||
const u32 gid = get_global_id (0);
|
||||
|
||||
if (gid >= gid_max) return;
|
||||
|
||||
/**
|
||||
* digest
|
||||
*/
|
||||
|
||||
const u32 search[4] =
|
||||
{
|
||||
digests_buf[digests_offset].digest_buf[DGST_R0],
|
||||
digests_buf[digests_offset].digest_buf[DGST_R1],
|
||||
digests_buf[digests_offset].digest_buf[DGST_R2],
|
||||
digests_buf[digests_offset].digest_buf[DGST_R3]
|
||||
};
|
||||
|
||||
/**
|
||||
* base
|
||||
*/
|
||||
|
||||
const u32 salt_len = salt_bufs[salt_pos].salt_len;
|
||||
|
||||
const u32 salt_lenv = ceil ((float) salt_len / 4);
|
||||
|
||||
u32 s[64] = { 0 };
|
||||
|
||||
for (int idx = 0; idx < salt_lenv; idx++)
|
||||
{
|
||||
s[idx] = swap32_S (salt_bufs[salt_pos].salt_buf[idx]);
|
||||
|
||||
barrier (CLK_GLOBAL_MEM_FENCE);
|
||||
}
|
||||
|
||||
sha512_ctx_t ctx0;
|
||||
|
||||
sha512_init (&ctx0);
|
||||
|
||||
sha512_update_global_utf16le_swap (&ctx0, pws[gid].i, pws[gid].pw_len);
|
||||
|
||||
/**
|
||||
* loop
|
||||
*/
|
||||
|
||||
for (u32 il_pos = 0; il_pos < il_cnt; il_pos++)
|
||||
{
|
||||
sha512_ctx_t ctx = ctx0;
|
||||
|
||||
sha512_update_global_utf16le_swap (&ctx, combs_buf[il_pos].i, combs_buf[il_pos].pw_len);
|
||||
|
||||
sha512_update (&ctx, s, salt_len);
|
||||
|
||||
sha512_final (&ctx);
|
||||
|
||||
const u32 r0 = l32_from_64_S (ctx.h[7]);
|
||||
const u32 r1 = h32_from_64_S (ctx.h[7]);
|
||||
const u32 r2 = l32_from_64_S (ctx.h[3]);
|
||||
const u32 r3 = h32_from_64_S (ctx.h[3]);
|
||||
|
||||
COMPARE_S_SCALAR (r0, r1, r2, r3);
|
||||
}
|
||||
}
|
175
OpenCL/m01730_a3-pure.cl
Normal file
175
OpenCL/m01730_a3-pure.cl
Normal file
@ -0,0 +1,175 @@
|
||||
/**
|
||||
* Author......: See docs/credits.txt
|
||||
* License.....: MIT
|
||||
*/
|
||||
|
||||
#define NEW_SIMD_CODE
|
||||
|
||||
#include "inc_vendor.cl"
|
||||
#include "inc_hash_constants.h"
|
||||
#include "inc_hash_functions.cl"
|
||||
#include "inc_types.cl"
|
||||
#include "inc_common.cl"
|
||||
#include "inc_simd.cl"
|
||||
#include "inc_hash_sha512.cl"
|
||||
|
||||
__kernel void m01730_mxx (__global pw_t *pws, __global const kernel_rule_t *rules_buf, __global const pw_t *combs_buf, __global const u32x *words_buf_r, __global void *tmps, __global void *hooks, __global const u32 *bitmaps_buf_s1_a, __global const u32 *bitmaps_buf_s1_b, __global const u32 *bitmaps_buf_s1_c, __global const u32 *bitmaps_buf_s1_d, __global const u32 *bitmaps_buf_s2_a, __global const u32 *bitmaps_buf_s2_b, __global const u32 *bitmaps_buf_s2_c, __global const u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global const digest_t *digests_buf, __global u32 *hashes_shown, __global const salt_t *salt_bufs, __global const void *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)
|
||||
{
|
||||
/**
|
||||
* modifier
|
||||
*/
|
||||
|
||||
const u32 lid = get_local_id (0);
|
||||
const u32 gid = get_global_id (0);
|
||||
|
||||
if (gid >= gid_max) return;
|
||||
|
||||
/**
|
||||
* base
|
||||
*/
|
||||
|
||||
const u32 pw_len = pws[gid].pw_len;
|
||||
|
||||
const u32 pw_lenv = ceil ((float) pw_len / 4);
|
||||
|
||||
u32x w[64] = { 0 };
|
||||
|
||||
for (int idx = 0; idx < pw_lenv; idx++)
|
||||
{
|
||||
w[idx] = pws[gid].i[idx];
|
||||
|
||||
barrier (CLK_GLOBAL_MEM_FENCE);
|
||||
}
|
||||
|
||||
const u32 salt_len = salt_bufs[salt_pos].salt_len;
|
||||
|
||||
const u32 salt_lenv = ceil ((float) salt_len / 4);
|
||||
|
||||
u32x s[64] = { 0 };
|
||||
|
||||
for (int idx = 0; idx < salt_lenv; idx++)
|
||||
{
|
||||
s[idx] = swap32_S (salt_bufs[salt_pos].salt_buf[idx]);
|
||||
|
||||
barrier (CLK_GLOBAL_MEM_FENCE);
|
||||
}
|
||||
|
||||
/**
|
||||
* loop
|
||||
*/
|
||||
|
||||
u32x w0l = w[0];
|
||||
|
||||
for (u32 il_pos = 0; il_pos < il_cnt; il_pos += VECT_SIZE)
|
||||
{
|
||||
const u32x w0r = words_buf_r[il_pos / VECT_SIZE];
|
||||
|
||||
const u32x w0 = w0l | w0r;
|
||||
|
||||
w[0] = w0;
|
||||
|
||||
sha512_ctx_vector_t ctx;
|
||||
|
||||
sha512_init_vector (&ctx);
|
||||
|
||||
sha512_update_vector_utf16beN (&ctx, w, pw_len);
|
||||
|
||||
sha512_update_vector (&ctx, s, salt_len);
|
||||
|
||||
sha512_final_vector (&ctx);
|
||||
|
||||
const u32x r0 = l32_from_64 (ctx.h[7]);
|
||||
const u32x r1 = h32_from_64 (ctx.h[7]);
|
||||
const u32x r2 = l32_from_64 (ctx.h[3]);
|
||||
const u32x r3 = h32_from_64 (ctx.h[3]);
|
||||
|
||||
COMPARE_M_SIMD (r0, r1, r2, r3);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
__kernel void m01730_sxx (__global pw_t *pws, __global const kernel_rule_t *rules_buf, __global const pw_t *combs_buf, __global const u32x *words_buf_r, __global void *tmps, __global void *hooks, __global const u32 *bitmaps_buf_s1_a, __global const u32 *bitmaps_buf_s1_b, __global const u32 *bitmaps_buf_s1_c, __global const u32 *bitmaps_buf_s1_d, __global const u32 *bitmaps_buf_s2_a, __global const u32 *bitmaps_buf_s2_b, __global const u32 *bitmaps_buf_s2_c, __global const u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global const digest_t *digests_buf, __global u32 *hashes_shown, __global const salt_t *salt_bufs, __global const void *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)
|
||||
{
|
||||
/**
|
||||
* modifier
|
||||
*/
|
||||
|
||||
const u32 lid = get_local_id (0);
|
||||
const u32 gid = get_global_id (0);
|
||||
|
||||
if (gid >= gid_max) return;
|
||||
|
||||
/**
|
||||
* digest
|
||||
*/
|
||||
|
||||
const u32 search[4] =
|
||||
{
|
||||
digests_buf[digests_offset].digest_buf[DGST_R0],
|
||||
digests_buf[digests_offset].digest_buf[DGST_R1],
|
||||
digests_buf[digests_offset].digest_buf[DGST_R2],
|
||||
digests_buf[digests_offset].digest_buf[DGST_R3]
|
||||
};
|
||||
|
||||
/**
|
||||
* base
|
||||
*/
|
||||
|
||||
const u32 pw_len = pws[gid].pw_len;
|
||||
|
||||
const u32 pw_lenv = ceil ((float) pw_len / 4);
|
||||
|
||||
u32x w[64] = { 0 };
|
||||
|
||||
for (int idx = 0; idx < pw_lenv; idx++)
|
||||
{
|
||||
w[idx] = pws[gid].i[idx];
|
||||
|
||||
barrier (CLK_GLOBAL_MEM_FENCE);
|
||||
}
|
||||
|
||||
const u32 salt_len = salt_bufs[salt_pos].salt_len;
|
||||
|
||||
const u32 salt_lenv = ceil ((float) salt_len / 4);
|
||||
|
||||
u32x s[64] = { 0 };
|
||||
|
||||
for (int idx = 0; idx < salt_lenv; idx++)
|
||||
{
|
||||
s[idx] = swap32_S (salt_bufs[salt_pos].salt_buf[idx]);
|
||||
|
||||
barrier (CLK_GLOBAL_MEM_FENCE);
|
||||
}
|
||||
|
||||
/**
|
||||
* loop
|
||||
*/
|
||||
|
||||
u32x w0l = w[0];
|
||||
|
||||
for (u32 il_pos = 0; il_pos < il_cnt; il_pos += VECT_SIZE)
|
||||
{
|
||||
const u32x w0r = words_buf_r[il_pos / VECT_SIZE];
|
||||
|
||||
const u32x w0 = w0l | w0r;
|
||||
|
||||
w[0] = w0;
|
||||
|
||||
sha512_ctx_vector_t ctx;
|
||||
|
||||
sha512_init_vector (&ctx);
|
||||
|
||||
sha512_update_vector_utf16beN (&ctx, w, pw_len);
|
||||
|
||||
sha512_update_vector (&ctx, s, salt_len);
|
||||
|
||||
sha512_final_vector (&ctx);
|
||||
|
||||
const u32x r0 = l32_from_64 (ctx.h[7]);
|
||||
const u32x r1 = h32_from_64 (ctx.h[7]);
|
||||
const u32x r2 = l32_from_64 (ctx.h[3]);
|
||||
const u32x r3 = h32_from_64 (ctx.h[3]);
|
||||
|
||||
COMPARE_S_SIMD (r0, r1, r2, r3);
|
||||
}
|
||||
}
|
142
OpenCL/m01740_a0-pure.cl
Normal file
142
OpenCL/m01740_a0-pure.cl
Normal file
@ -0,0 +1,142 @@
|
||||
/**
|
||||
* Author......: See docs/credits.txt
|
||||
* License.....: MIT
|
||||
*/
|
||||
|
||||
//#define NEW_SIMD_CODE
|
||||
|
||||
#include "inc_vendor.cl"
|
||||
#include "inc_hash_constants.h"
|
||||
#include "inc_hash_functions.cl"
|
||||
#include "inc_types.cl"
|
||||
#include "inc_common.cl"
|
||||
#include "inc_rp.h"
|
||||
#include "inc_rp.cl"
|
||||
#include "inc_scalar.cl"
|
||||
#include "inc_hash_sha512.cl"
|
||||
|
||||
__kernel void m01740_mxx (__global pw_t *pws, __global const kernel_rule_t *rules_buf, __global const pw_t *combs_buf, __global const bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global const u32 *bitmaps_buf_s1_a, __global const u32 *bitmaps_buf_s1_b, __global const u32 *bitmaps_buf_s1_c, __global const u32 *bitmaps_buf_s1_d, __global const u32 *bitmaps_buf_s2_a, __global const u32 *bitmaps_buf_s2_b, __global const u32 *bitmaps_buf_s2_c, __global const u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global const digest_t *digests_buf, __global u32 *hashes_shown, __global const salt_t *salt_bufs, __global const void *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)
|
||||
{
|
||||
/**
|
||||
* modifier
|
||||
*/
|
||||
|
||||
const u32 lid = get_local_id (0);
|
||||
const u32 gid = get_global_id (0);
|
||||
|
||||
if (gid >= gid_max) return;
|
||||
|
||||
/**
|
||||
* base
|
||||
*/
|
||||
|
||||
const u32 pw_len = pws[gid].pw_len;
|
||||
|
||||
const u32 pw_lenv = ceil ((float) pw_len / 4);
|
||||
|
||||
u32 w[64] = { 0 };
|
||||
|
||||
for (int idx = 0; idx < pw_lenv; idx++)
|
||||
{
|
||||
w[idx] = pws[gid].i[idx];
|
||||
|
||||
barrier (CLK_GLOBAL_MEM_FENCE);
|
||||
}
|
||||
|
||||
sha512_ctx_t ctx0;
|
||||
|
||||
sha512_init (&ctx0);
|
||||
|
||||
sha512_update_global_swap (&ctx0, salt_bufs[salt_pos].salt_buf, salt_bufs[salt_pos].salt_len);
|
||||
|
||||
/**
|
||||
* loop
|
||||
*/
|
||||
|
||||
for (u32 il_pos = 0; il_pos < il_cnt; il_pos++)
|
||||
{
|
||||
// todo: add rules engine
|
||||
|
||||
sha512_ctx_t ctx = ctx0;
|
||||
|
||||
sha512_update_utf16le_swap (&ctx, w, pw_len);
|
||||
|
||||
sha512_final (&ctx);
|
||||
|
||||
const u32 r0 = l32_from_64_S (ctx.h[7]);
|
||||
const u32 r1 = h32_from_64_S (ctx.h[7]);
|
||||
const u32 r2 = l32_from_64_S (ctx.h[3]);
|
||||
const u32 r3 = h32_from_64_S (ctx.h[3]);
|
||||
|
||||
COMPARE_M_SCALAR (r0, r1, r2, r3);
|
||||
}
|
||||
}
|
||||
|
||||
__kernel void m01740_sxx (__global pw_t *pws, __global const kernel_rule_t *rules_buf, __global const pw_t *combs_buf, __global const bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global const u32 *bitmaps_buf_s1_a, __global const u32 *bitmaps_buf_s1_b, __global const u32 *bitmaps_buf_s1_c, __global const u32 *bitmaps_buf_s1_d, __global const u32 *bitmaps_buf_s2_a, __global const u32 *bitmaps_buf_s2_b, __global const u32 *bitmaps_buf_s2_c, __global const u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global const digest_t *digests_buf, __global u32 *hashes_shown, __global const salt_t *salt_bufs, __global const void *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)
|
||||
{
|
||||
/**
|
||||
* modifier
|
||||
*/
|
||||
|
||||
const u32 lid = get_local_id (0);
|
||||
const u32 gid = get_global_id (0);
|
||||
|
||||
if (gid >= gid_max) return;
|
||||
|
||||
/**
|
||||
* digest
|
||||
*/
|
||||
|
||||
const u32 search[4] =
|
||||
{
|
||||
digests_buf[digests_offset].digest_buf[DGST_R0],
|
||||
digests_buf[digests_offset].digest_buf[DGST_R1],
|
||||
digests_buf[digests_offset].digest_buf[DGST_R2],
|
||||
digests_buf[digests_offset].digest_buf[DGST_R3]
|
||||
};
|
||||
|
||||
/**
|
||||
* base
|
||||
*/
|
||||
|
||||
const u32 pw_len = pws[gid].pw_len;
|
||||
|
||||
const u32 pw_lenv = ceil ((float) pw_len / 4);
|
||||
|
||||
u32 w[64] = { 0 };
|
||||
|
||||
for (int idx = 0; idx < pw_lenv; idx++)
|
||||
{
|
||||
w[idx] = pws[gid].i[idx];
|
||||
|
||||
barrier (CLK_GLOBAL_MEM_FENCE);
|
||||
}
|
||||
|
||||
sha512_ctx_t ctx0;
|
||||
|
||||
sha512_init (&ctx0);
|
||||
|
||||
sha512_update_global_swap (&ctx0, salt_bufs[salt_pos].salt_buf, salt_bufs[salt_pos].salt_len);
|
||||
|
||||
/**
|
||||
* loop
|
||||
*/
|
||||
|
||||
for (u32 il_pos = 0; il_pos < il_cnt; il_pos++)
|
||||
{
|
||||
// todo: add rules engine
|
||||
|
||||
sha512_ctx_t ctx = ctx0;
|
||||
|
||||
sha512_update_utf16le_swap (&ctx, w, pw_len);
|
||||
|
||||
sha512_final (&ctx);
|
||||
|
||||
const u32 r0 = l32_from_64_S (ctx.h[7]);
|
||||
const u32 r1 = h32_from_64_S (ctx.h[7]);
|
||||
const u32 r2 = l32_from_64_S (ctx.h[3]);
|
||||
const u32 r3 = h32_from_64_S (ctx.h[3]);
|
||||
|
||||
COMPARE_S_SCALAR (r0, r1, r2, r3);
|
||||
}
|
||||
}
|
114
OpenCL/m01740_a1-pure.cl
Normal file
114
OpenCL/m01740_a1-pure.cl
Normal file
@ -0,0 +1,114 @@
|
||||
/**
|
||||
* Author......: See docs/credits.txt
|
||||
* License.....: MIT
|
||||
*/
|
||||
|
||||
//#define NEW_SIMD_CODE
|
||||
|
||||
#include "inc_vendor.cl"
|
||||
#include "inc_hash_constants.h"
|
||||
#include "inc_hash_functions.cl"
|
||||
#include "inc_types.cl"
|
||||
#include "inc_common.cl"
|
||||
#include "inc_scalar.cl"
|
||||
#include "inc_hash_sha512.cl"
|
||||
|
||||
__kernel void m01740_mxx (__global pw_t *pws, __global const kernel_rule_t *rules_buf, __global const pw_t *combs_buf, __global const bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global const u32 *bitmaps_buf_s1_a, __global const u32 *bitmaps_buf_s1_b, __global const u32 *bitmaps_buf_s1_c, __global const u32 *bitmaps_buf_s1_d, __global const u32 *bitmaps_buf_s2_a, __global const u32 *bitmaps_buf_s2_b, __global const u32 *bitmaps_buf_s2_c, __global const u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global const digest_t *digests_buf, __global u32 *hashes_shown, __global const salt_t *salt_bufs, __global const void *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)
|
||||
{
|
||||
/**
|
||||
* modifier
|
||||
*/
|
||||
|
||||
const u32 lid = get_local_id (0);
|
||||
const u32 gid = get_global_id (0);
|
||||
|
||||
if (gid >= gid_max) return;
|
||||
|
||||
/**
|
||||
* base
|
||||
*/
|
||||
|
||||
sha512_ctx_t ctx0;
|
||||
|
||||
sha512_init (&ctx0);
|
||||
|
||||
sha512_update_global_swap (&ctx0, salt_bufs[salt_pos].salt_buf, salt_bufs[salt_pos].salt_len);
|
||||
|
||||
sha512_update_global_utf16le_swap (&ctx0, pws[gid].i, pws[gid].pw_len);
|
||||
|
||||
/**
|
||||
* loop
|
||||
*/
|
||||
|
||||
for (u32 il_pos = 0; il_pos < il_cnt; il_pos++)
|
||||
{
|
||||
sha512_ctx_t ctx = ctx0;
|
||||
|
||||
sha512_update_global_utf16le_swap (&ctx, combs_buf[il_pos].i, combs_buf[il_pos].pw_len);
|
||||
|
||||
sha512_final (&ctx);
|
||||
|
||||
const u32 r0 = l32_from_64_S (ctx.h[7]);
|
||||
const u32 r1 = h32_from_64_S (ctx.h[7]);
|
||||
const u32 r2 = l32_from_64_S (ctx.h[3]);
|
||||
const u32 r3 = h32_from_64_S (ctx.h[3]);
|
||||
|
||||
COMPARE_M_SCALAR (r0, r1, r2, r3);
|
||||
}
|
||||
}
|
||||
|
||||
__kernel void m01740_sxx (__global pw_t *pws, __global const kernel_rule_t *rules_buf, __global const pw_t *combs_buf, __global const bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global const u32 *bitmaps_buf_s1_a, __global const u32 *bitmaps_buf_s1_b, __global const u32 *bitmaps_buf_s1_c, __global const u32 *bitmaps_buf_s1_d, __global const u32 *bitmaps_buf_s2_a, __global const u32 *bitmaps_buf_s2_b, __global const u32 *bitmaps_buf_s2_c, __global const u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global const digest_t *digests_buf, __global u32 *hashes_shown, __global const salt_t *salt_bufs, __global const void *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)
|
||||
{
|
||||
/**
|
||||
* modifier
|
||||
*/
|
||||
|
||||
const u32 lid = get_local_id (0);
|
||||
const u32 gid = get_global_id (0);
|
||||
|
||||
if (gid >= gid_max) return;
|
||||
|
||||
/**
|
||||
* digest
|
||||
*/
|
||||
|
||||
const u32 search[4] =
|
||||
{
|
||||
digests_buf[digests_offset].digest_buf[DGST_R0],
|
||||
digests_buf[digests_offset].digest_buf[DGST_R1],
|
||||
digests_buf[digests_offset].digest_buf[DGST_R2],
|
||||
digests_buf[digests_offset].digest_buf[DGST_R3]
|
||||
};
|
||||
|
||||
/**
|
||||
* base
|
||||
*/
|
||||
|
||||
sha512_ctx_t ctx0;
|
||||
|
||||
sha512_init (&ctx0);
|
||||
|
||||
sha512_update_global_swap (&ctx0, salt_bufs[salt_pos].salt_buf, salt_bufs[salt_pos].salt_len);
|
||||
|
||||
sha512_update_global_utf16le_swap (&ctx0, pws[gid].i, pws[gid].pw_len);
|
||||
|
||||
/**
|
||||
* loop
|
||||
*/
|
||||
|
||||
for (u32 il_pos = 0; il_pos < il_cnt; il_pos++)
|
||||
{
|
||||
sha512_ctx_t ctx = ctx0;
|
||||
|
||||
sha512_update_global_utf16le_swap (&ctx, combs_buf[il_pos].i, combs_buf[il_pos].pw_len);
|
||||
|
||||
sha512_final (&ctx);
|
||||
|
||||
const u32 r0 = l32_from_64_S (ctx.h[7]);
|
||||
const u32 r1 = h32_from_64_S (ctx.h[7]);
|
||||
const u32 r2 = l32_from_64_S (ctx.h[3]);
|
||||
const u32 r3 = h32_from_64_S (ctx.h[3]);
|
||||
|
||||
COMPARE_S_SCALAR (r0, r1, r2, r3);
|
||||
}
|
||||
}
|
156
OpenCL/m01740_a3-pure.cl
Normal file
156
OpenCL/m01740_a3-pure.cl
Normal file
@ -0,0 +1,156 @@
|
||||
/**
|
||||
* Author......: See docs/credits.txt
|
||||
* License.....: MIT
|
||||
*/
|
||||
|
||||
#define NEW_SIMD_CODE
|
||||
|
||||
#include "inc_vendor.cl"
|
||||
#include "inc_hash_constants.h"
|
||||
#include "inc_hash_functions.cl"
|
||||
#include "inc_types.cl"
|
||||
#include "inc_common.cl"
|
||||
#include "inc_simd.cl"
|
||||
#include "inc_hash_sha512.cl"
|
||||
|
||||
__kernel void m01740_mxx (__global pw_t *pws, __global const kernel_rule_t *rules_buf, __global const pw_t *combs_buf, __global const u32x *words_buf_r, __global void *tmps, __global void *hooks, __global const u32 *bitmaps_buf_s1_a, __global const u32 *bitmaps_buf_s1_b, __global const u32 *bitmaps_buf_s1_c, __global const u32 *bitmaps_buf_s1_d, __global const u32 *bitmaps_buf_s2_a, __global const u32 *bitmaps_buf_s2_b, __global const u32 *bitmaps_buf_s2_c, __global const u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global const digest_t *digests_buf, __global u32 *hashes_shown, __global const salt_t *salt_bufs, __global const void *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)
|
||||
{
|
||||
/**
|
||||
* modifier
|
||||
*/
|
||||
|
||||
const u32 lid = get_local_id (0);
|
||||
const u32 gid = get_global_id (0);
|
||||
|
||||
if (gid >= gid_max) return;
|
||||
|
||||
/**
|
||||
* base
|
||||
*/
|
||||
|
||||
const u32 pw_len = pws[gid].pw_len;
|
||||
|
||||
const u32 pw_lenv = ceil ((float) pw_len / 4);
|
||||
|
||||
u32x w[64] = { 0 };
|
||||
|
||||
for (int idx = 0; idx < pw_lenv; idx++)
|
||||
{
|
||||
w[idx] = pws[gid].i[idx];
|
||||
|
||||
barrier (CLK_GLOBAL_MEM_FENCE);
|
||||
}
|
||||
|
||||
sha512_ctx_t ctx0;
|
||||
|
||||
sha512_init (&ctx0);
|
||||
|
||||
sha512_update_global_swap (&ctx0, salt_bufs[salt_pos].salt_buf, salt_bufs[salt_pos].salt_len);
|
||||
|
||||
/**
|
||||
* loop
|
||||
*/
|
||||
|
||||
u32x w0l = w[0];
|
||||
|
||||
for (u32 il_pos = 0; il_pos < il_cnt; il_pos += VECT_SIZE)
|
||||
{
|
||||
const u32x w0r = words_buf_r[il_pos / VECT_SIZE];
|
||||
|
||||
const u32x w0 = w0l | w0r;
|
||||
|
||||
w[0] = w0;
|
||||
|
||||
sha512_ctx_vector_t ctx;
|
||||
|
||||
sha512_init_vector_from_scalar (&ctx, &ctx0);
|
||||
|
||||
sha512_update_vector_utf16beN (&ctx, w, pw_len);
|
||||
|
||||
sha512_final_vector (&ctx);
|
||||
|
||||
const u32x r0 = l32_from_64 (ctx.h[7]);
|
||||
const u32x r1 = h32_from_64 (ctx.h[7]);
|
||||
const u32x r2 = l32_from_64 (ctx.h[3]);
|
||||
const u32x r3 = h32_from_64 (ctx.h[3]);
|
||||
|
||||
COMPARE_M_SIMD (r0, r1, r2, r3);
|
||||
}
|
||||
}
|
||||
|
||||
__kernel void m01740_sxx (__global pw_t *pws, __global const kernel_rule_t *rules_buf, __global const pw_t *combs_buf, __global const u32x *words_buf_r, __global void *tmps, __global void *hooks, __global const u32 *bitmaps_buf_s1_a, __global const u32 *bitmaps_buf_s1_b, __global const u32 *bitmaps_buf_s1_c, __global const u32 *bitmaps_buf_s1_d, __global const u32 *bitmaps_buf_s2_a, __global const u32 *bitmaps_buf_s2_b, __global const u32 *bitmaps_buf_s2_c, __global const u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global const digest_t *digests_buf, __global u32 *hashes_shown, __global const salt_t *salt_bufs, __global const void *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)
|
||||
{
|
||||
/**
|
||||
* modifier
|
||||
*/
|
||||
|
||||
const u32 lid = get_local_id (0);
|
||||
const u32 gid = get_global_id (0);
|
||||
|
||||
if (gid >= gid_max) return;
|
||||
|
||||
/**
|
||||
* digest
|
||||
*/
|
||||
|
||||
const u32 search[4] =
|
||||
{
|
||||
digests_buf[digests_offset].digest_buf[DGST_R0],
|
||||
digests_buf[digests_offset].digest_buf[DGST_R1],
|
||||
digests_buf[digests_offset].digest_buf[DGST_R2],
|
||||
digests_buf[digests_offset].digest_buf[DGST_R3]
|
||||
};
|
||||
|
||||
/**
|
||||
* base
|
||||
*/
|
||||
|
||||
const u32 pw_len = pws[gid].pw_len;
|
||||
|
||||
const u32 pw_lenv = ceil ((float) pw_len / 4);
|
||||
|
||||
u32x w[64] = { 0 };
|
||||
|
||||
for (int idx = 0; idx < pw_lenv; idx++)
|
||||
{
|
||||
w[idx] = pws[gid].i[idx];
|
||||
|
||||
barrier (CLK_GLOBAL_MEM_FENCE);
|
||||
}
|
||||
|
||||
sha512_ctx_t ctx0;
|
||||
|
||||
sha512_init (&ctx0);
|
||||
|
||||
sha512_update_global_swap (&ctx0, salt_bufs[salt_pos].salt_buf, salt_bufs[salt_pos].salt_len);
|
||||
|
||||
/**
|
||||
* loop
|
||||
*/
|
||||
|
||||
u32x w0l = w[0];
|
||||
|
||||
for (u32 il_pos = 0; il_pos < il_cnt; il_pos += VECT_SIZE)
|
||||
{
|
||||
const u32x w0r = words_buf_r[il_pos / VECT_SIZE];
|
||||
|
||||
const u32x w0 = w0l | w0r;
|
||||
|
||||
w[0] = w0;
|
||||
|
||||
sha512_ctx_vector_t ctx;
|
||||
|
||||
sha512_init_vector_from_scalar (&ctx, &ctx0);
|
||||
|
||||
sha512_update_vector_utf16beN (&ctx, w, pw_len);
|
||||
|
||||
sha512_final_vector (&ctx);
|
||||
|
||||
const u32x r0 = l32_from_64 (ctx.h[7]);
|
||||
const u32x r1 = h32_from_64 (ctx.h[7]);
|
||||
const u32x r2 = l32_from_64 (ctx.h[3]);
|
||||
const u32x r3 = h32_from_64 (ctx.h[3]);
|
||||
|
||||
COMPARE_S_SIMD (r0, r1, r2, r3);
|
||||
}
|
||||
}
|
160
OpenCL/m01750_a0-pure.cl
Normal file
160
OpenCL/m01750_a0-pure.cl
Normal file
@ -0,0 +1,160 @@
|
||||
/**
|
||||
* Author......: See docs/credits.txt
|
||||
* License.....: MIT
|
||||
*/
|
||||
|
||||
//#define NEW_SIMD_CODE
|
||||
|
||||
#include "inc_vendor.cl"
|
||||
#include "inc_hash_constants.h"
|
||||
#include "inc_hash_functions.cl"
|
||||
#include "inc_types.cl"
|
||||
#include "inc_common.cl"
|
||||
#include "inc_rp.h"
|
||||
#include "inc_rp.cl"
|
||||
#include "inc_scalar.cl"
|
||||
#include "inc_hash_sha512.cl"
|
||||
|
||||
__kernel void m01750_mxx (__global pw_t *pws, __global const kernel_rule_t *rules_buf, __global const pw_t *combs_buf, __global const bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global const u32 *bitmaps_buf_s1_a, __global const u32 *bitmaps_buf_s1_b, __global const u32 *bitmaps_buf_s1_c, __global const u32 *bitmaps_buf_s1_d, __global const u32 *bitmaps_buf_s2_a, __global const u32 *bitmaps_buf_s2_b, __global const u32 *bitmaps_buf_s2_c, __global const u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global const digest_t *digests_buf, __global u32 *hashes_shown, __global const salt_t *salt_bufs, __global const void *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)
|
||||
{
|
||||
/**
|
||||
* modifier
|
||||
*/
|
||||
|
||||
const u32 lid = get_local_id (0);
|
||||
const u32 gid = get_global_id (0);
|
||||
|
||||
if (gid >= gid_max) return;
|
||||
|
||||
/**
|
||||
* base
|
||||
*/
|
||||
|
||||
const u32 pw_len = pws[gid].pw_len;
|
||||
|
||||
const u32 pw_lenv = ceil ((float) pw_len / 4);
|
||||
|
||||
u32 w[64] = { 0 };
|
||||
|
||||
for (int idx = 0; idx < pw_lenv; idx++)
|
||||
{
|
||||
w[idx] = pws[gid].i[idx];
|
||||
|
||||
barrier (CLK_GLOBAL_MEM_FENCE);
|
||||
}
|
||||
|
||||
const u32 salt_len = salt_bufs[salt_pos].salt_len;
|
||||
|
||||
const u32 salt_lenv = ceil ((float) salt_len / 4);
|
||||
|
||||
u32 s[64] = { 0 };
|
||||
|
||||
for (int idx = 0; idx < salt_lenv; idx++)
|
||||
{
|
||||
s[idx] = swap32_S (salt_bufs[salt_pos].salt_buf[idx]);
|
||||
|
||||
barrier (CLK_GLOBAL_MEM_FENCE);
|
||||
}
|
||||
|
||||
/**
|
||||
* loop
|
||||
*/
|
||||
|
||||
for (u32 il_pos = 0; il_pos < il_cnt; il_pos++)
|
||||
{
|
||||
// todo: add rules engine
|
||||
|
||||
sha512_hmac_ctx_t ctx;
|
||||
|
||||
sha512_hmac_init_swap (&ctx, w, pw_len);
|
||||
|
||||
sha512_hmac_update (&ctx, s, salt_len);
|
||||
|
||||
sha512_hmac_final (&ctx);
|
||||
|
||||
const u32 r0 = l32_from_64_S (ctx.opad.h[7]);
|
||||
const u32 r1 = h32_from_64_S (ctx.opad.h[7]);
|
||||
const u32 r2 = l32_from_64_S (ctx.opad.h[3]);
|
||||
const u32 r3 = h32_from_64_S (ctx.opad.h[3]);
|
||||
|
||||
COMPARE_M_SCALAR (r0, r1, r2, r3);
|
||||
}
|
||||
}
|
||||
|
||||
__kernel void m01750_sxx (__global pw_t *pws, __global const kernel_rule_t *rules_buf, __global const pw_t *combs_buf, __global const bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global const u32 *bitmaps_buf_s1_a, __global const u32 *bitmaps_buf_s1_b, __global const u32 *bitmaps_buf_s1_c, __global const u32 *bitmaps_buf_s1_d, __global const u32 *bitmaps_buf_s2_a, __global const u32 *bitmaps_buf_s2_b, __global const u32 *bitmaps_buf_s2_c, __global const u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global const digest_t *digests_buf, __global u32 *hashes_shown, __global const salt_t *salt_bufs, __global const void *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)
|
||||
{
|
||||
/**
|
||||
* modifier
|
||||
*/
|
||||
|
||||
const u32 lid = get_local_id (0);
|
||||
const u32 gid = get_global_id (0);
|
||||
|
||||
if (gid >= gid_max) return;
|
||||
|
||||
/**
|
||||
* digest
|
||||
*/
|
||||
|
||||
const u32 search[4] =
|
||||
{
|
||||
digests_buf[digests_offset].digest_buf[DGST_R0],
|
||||
digests_buf[digests_offset].digest_buf[DGST_R1],
|
||||
digests_buf[digests_offset].digest_buf[DGST_R2],
|
||||
digests_buf[digests_offset].digest_buf[DGST_R3]
|
||||
};
|
||||
|
||||
/**
|
||||
* base
|
||||
*/
|
||||
|
||||
const u32 pw_len = pws[gid].pw_len;
|
||||
|
||||
const u32 pw_lenv = ceil ((float) pw_len / 4);
|
||||
|
||||
u32 w[64] = { 0 };
|
||||
|
||||
for (int idx = 0; idx < pw_lenv; idx++)
|
||||
{
|
||||
w[idx] = pws[gid].i[idx];
|
||||
|
||||
barrier (CLK_GLOBAL_MEM_FENCE);
|
||||
}
|
||||
|
||||
const u32 salt_len = salt_bufs[salt_pos].salt_len;
|
||||
|
||||
const u32 salt_lenv = ceil ((float) salt_len / 4);
|
||||
|
||||
u32 s[64] = { 0 };
|
||||
|
||||
for (int idx = 0; idx < salt_lenv; idx++)
|
||||
{
|
||||
s[idx] = swap32_S (salt_bufs[salt_pos].salt_buf[idx]);
|
||||
|
||||
barrier (CLK_GLOBAL_MEM_FENCE);
|
||||
}
|
||||
|
||||
/**
|
||||
* loop
|
||||
*/
|
||||
|
||||
for (u32 il_pos = 0; il_pos < il_cnt; il_pos++)
|
||||
{
|
||||
// todo: add rules engine
|
||||
|
||||
sha512_hmac_ctx_t ctx;
|
||||
|
||||
sha512_hmac_init_swap (&ctx, w, pw_len);
|
||||
|
||||
sha512_hmac_update (&ctx, s, salt_len);
|
||||
|
||||
sha512_hmac_final (&ctx);
|
||||
|
||||
const u32 r0 = l32_from_64_S (ctx.opad.h[7]);
|
||||
const u32 r1 = h32_from_64_S (ctx.opad.h[7]);
|
||||
const u32 r2 = l32_from_64_S (ctx.opad.h[3]);
|
||||
const u32 r3 = h32_from_64_S (ctx.opad.h[3]);
|
||||
|
||||
COMPARE_S_SCALAR (r0, r1, r2, r3);
|
||||
}
|
||||
}
|
198
OpenCL/m01750_a1-pure.cl
Normal file
198
OpenCL/m01750_a1-pure.cl
Normal file
@ -0,0 +1,198 @@
|
||||
/**
|
||||
* Author......: See docs/credits.txt
|
||||
* License.....: MIT
|
||||
*/
|
||||
|
||||
//#define NEW_SIMD_CODE
|
||||
|
||||
#include "inc_vendor.cl"
|
||||
#include "inc_hash_constants.h"
|
||||
#include "inc_hash_functions.cl"
|
||||
#include "inc_types.cl"
|
||||
#include "inc_common.cl"
|
||||
#include "inc_scalar.cl"
|
||||
#include "inc_hash_sha512.cl"
|
||||
|
||||
__kernel void m01750_mxx (__global pw_t *pws, __global const kernel_rule_t *rules_buf, __global const pw_t *combs_buf, __global const bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global const u32 *bitmaps_buf_s1_a, __global const u32 *bitmaps_buf_s1_b, __global const u32 *bitmaps_buf_s1_c, __global const u32 *bitmaps_buf_s1_d, __global const u32 *bitmaps_buf_s2_a, __global const u32 *bitmaps_buf_s2_b, __global const u32 *bitmaps_buf_s2_c, __global const u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global const digest_t *digests_buf, __global u32 *hashes_shown, __global const salt_t *salt_bufs, __global const void *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)
|
||||
{
|
||||
/**
|
||||
* modifier
|
||||
*/
|
||||
|
||||
const u32 lid = get_local_id (0);
|
||||
const u32 gid = get_global_id (0);
|
||||
|
||||
if (gid >= gid_max) return;
|
||||
|
||||
/**
|
||||
* base
|
||||
*/
|
||||
|
||||
const u32 pw_len = pws[gid].pw_len;
|
||||
|
||||
const u32 pw_lenv = ceil ((float) pw_len / 4);
|
||||
|
||||
u32 w[64] = { 0 };
|
||||
|
||||
for (int idx = 0; idx < pw_lenv; idx++)
|
||||
{
|
||||
w[idx] = swap32_S (pws[gid].i[idx]);
|
||||
|
||||
barrier (CLK_GLOBAL_MEM_FENCE);
|
||||
}
|
||||
|
||||
const u32 salt_len = salt_bufs[salt_pos].salt_len;
|
||||
|
||||
const u32 salt_lenv = ceil ((float) salt_len / 4);
|
||||
|
||||
u32 s[64] = { 0 };
|
||||
|
||||
for (int idx = 0; idx < salt_lenv; idx++)
|
||||
{
|
||||
s[idx] = swap32_S (salt_bufs[salt_pos].salt_buf[idx]);
|
||||
|
||||
barrier (CLK_GLOBAL_MEM_FENCE);
|
||||
}
|
||||
|
||||
/**
|
||||
* loop
|
||||
*/
|
||||
|
||||
for (u32 il_pos = 0; il_pos < il_cnt; il_pos++)
|
||||
{
|
||||
const u32 comb_len = combs_buf[il_pos].pw_len;
|
||||
|
||||
u32 c[64];
|
||||
|
||||
#ifdef _unroll
|
||||
#pragma unroll
|
||||
#endif
|
||||
for (int idx = 0; idx < 64; idx++)
|
||||
{
|
||||
c[idx] = swap32_S (combs_buf[il_pos].i[idx]);
|
||||
}
|
||||
|
||||
switch_buffer_by_offset_1x64_be_S (c, pw_len);
|
||||
|
||||
#ifdef _unroll
|
||||
#pragma unroll
|
||||
#endif
|
||||
for (int i = 0; i < 64; i++)
|
||||
{
|
||||
c[i] |= w[i];
|
||||
}
|
||||
|
||||
sha512_hmac_ctx_vector_t ctx;
|
||||
|
||||
sha512_hmac_init_vector (&ctx, c, pw_len + comb_len);
|
||||
|
||||
sha512_hmac_update_vector (&ctx, s, salt_len);
|
||||
|
||||
sha512_hmac_final_vector (&ctx);
|
||||
|
||||
const u32 r0 = l32_from_64_S (ctx.opad.h[7]);
|
||||
const u32 r1 = h32_from_64_S (ctx.opad.h[7]);
|
||||
const u32 r2 = l32_from_64_S (ctx.opad.h[3]);
|
||||
const u32 r3 = h32_from_64_S (ctx.opad.h[3]);
|
||||
|
||||
COMPARE_M_SCALAR (r0, r1, r2, r3);
|
||||
}
|
||||
}
|
||||
|
||||
__kernel void m01750_sxx (__global pw_t *pws, __global const kernel_rule_t *rules_buf, __global const pw_t *combs_buf, __global const bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global const u32 *bitmaps_buf_s1_a, __global const u32 *bitmaps_buf_s1_b, __global const u32 *bitmaps_buf_s1_c, __global const u32 *bitmaps_buf_s1_d, __global const u32 *bitmaps_buf_s2_a, __global const u32 *bitmaps_buf_s2_b, __global const u32 *bitmaps_buf_s2_c, __global const u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global const digest_t *digests_buf, __global u32 *hashes_shown, __global const salt_t *salt_bufs, __global const void *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)
|
||||
{
|
||||
/**
|
||||
* modifier
|
||||
*/
|
||||
|
||||
const u32 lid = get_local_id (0);
|
||||
const u32 gid = get_global_id (0);
|
||||
|
||||
if (gid >= gid_max) return;
|
||||
|
||||
/**
|
||||
* digest
|
||||
*/
|
||||
|
||||
const u32 search[4] =
|
||||
{
|
||||
digests_buf[digests_offset].digest_buf[DGST_R0],
|
||||
digests_buf[digests_offset].digest_buf[DGST_R1],
|
||||
digests_buf[digests_offset].digest_buf[DGST_R2],
|
||||
digests_buf[digests_offset].digest_buf[DGST_R3]
|
||||
};
|
||||
|
||||
/**
|
||||
* base
|
||||
*/
|
||||
|
||||
const u32 pw_len = pws[gid].pw_len;
|
||||
|
||||
const u32 pw_lenv = ceil ((float) pw_len / 4);
|
||||
|
||||
u32 w[64] = { 0 };
|
||||
|
||||
for (int idx = 0; idx < pw_lenv; idx++)
|
||||
{
|
||||
w[idx] = swap32_S (pws[gid].i[idx]);
|
||||
|
||||
barrier (CLK_GLOBAL_MEM_FENCE);
|
||||
}
|
||||
|
||||
const u32 salt_len = salt_bufs[salt_pos].salt_len;
|
||||
|
||||
const u32 salt_lenv = ceil ((float) salt_len / 4);
|
||||
|
||||
u32 s[64] = { 0 };
|
||||
|
||||
for (int idx = 0; idx < salt_lenv; idx++)
|
||||
{
|
||||
s[idx] = swap32_S (salt_bufs[salt_pos].salt_buf[idx]);
|
||||
|
||||
barrier (CLK_GLOBAL_MEM_FENCE);
|
||||
}
|
||||
|
||||
/**
|
||||
* loop
|
||||
*/
|
||||
|
||||
for (u32 il_pos = 0; il_pos < il_cnt; il_pos++)
|
||||
{
|
||||
const u32 comb_len = combs_buf[il_pos].pw_len;
|
||||
|
||||
u32 c[64];
|
||||
|
||||
#ifdef _unroll
|
||||
#pragma unroll
|
||||
#endif
|
||||
for (int idx = 0; idx < 64; idx++)
|
||||
{
|
||||
c[idx] = swap32_S (combs_buf[il_pos].i[idx]);
|
||||
}
|
||||
|
||||
switch_buffer_by_offset_1x64_be_S (c, pw_len);
|
||||
|
||||
#ifdef _unroll
|
||||
#pragma unroll
|
||||
#endif
|
||||
for (int i = 0; i < 64; i++)
|
||||
{
|
||||
c[i] |= w[i];
|
||||
}
|
||||
|
||||
sha512_hmac_ctx_vector_t ctx;
|
||||
|
||||
sha512_hmac_init_vector (&ctx, c, pw_len + comb_len);
|
||||
|
||||
sha512_hmac_update_vector (&ctx, s, salt_len);
|
||||
|
||||
sha512_hmac_final_vector (&ctx);
|
||||
|
||||
const u32 r0 = l32_from_64_S (ctx.opad.h[7]);
|
||||
const u32 r1 = h32_from_64_S (ctx.opad.h[7]);
|
||||
const u32 r2 = l32_from_64_S (ctx.opad.h[3]);
|
||||
const u32 r3 = h32_from_64_S (ctx.opad.h[3]);
|
||||
|
||||
COMPARE_S_SCALAR (r0, r1, r2, r3);
|
||||
}
|
||||
}
|
170
OpenCL/m01750_a3-pure.cl
Normal file
170
OpenCL/m01750_a3-pure.cl
Normal file
@ -0,0 +1,170 @@
|
||||
/**
|
||||
* Author......: See docs/credits.txt
|
||||
* License.....: MIT
|
||||
*/
|
||||
|
||||
#define NEW_SIMD_CODE
|
||||
|
||||
#include "inc_vendor.cl"
|
||||
#include "inc_hash_constants.h"
|
||||
#include "inc_hash_functions.cl"
|
||||
#include "inc_types.cl"
|
||||
#include "inc_common.cl"
|
||||
#include "inc_simd.cl"
|
||||
#include "inc_hash_sha512.cl"
|
||||
|
||||
__kernel void m01750_mxx (__global pw_t *pws, __global const kernel_rule_t *rules_buf, __global const pw_t *combs_buf, __global const u32x *words_buf_r, __global void *tmps, __global void *hooks, __global const u32 *bitmaps_buf_s1_a, __global const u32 *bitmaps_buf_s1_b, __global const u32 *bitmaps_buf_s1_c, __global const u32 *bitmaps_buf_s1_d, __global const u32 *bitmaps_buf_s2_a, __global const u32 *bitmaps_buf_s2_b, __global const u32 *bitmaps_buf_s2_c, __global const u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global const digest_t *digests_buf, __global u32 *hashes_shown, __global const salt_t *salt_bufs, __global const void *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)
|
||||
{
|
||||
/**
|
||||
* modifier
|
||||
*/
|
||||
|
||||
const u32 lid = get_local_id (0);
|
||||
const u32 gid = get_global_id (0);
|
||||
|
||||
if (gid >= gid_max) return;
|
||||
|
||||
/**
|
||||
* base
|
||||
*/
|
||||
|
||||
const u32 pw_len = pws[gid].pw_len;
|
||||
|
||||
const u32 pw_lenv = ceil ((float) pw_len / 4);
|
||||
|
||||
u32x w[64] = { 0 };
|
||||
|
||||
for (int idx = 0; idx < pw_lenv; idx++)
|
||||
{
|
||||
w[idx] = pws[gid].i[idx];
|
||||
|
||||
barrier (CLK_GLOBAL_MEM_FENCE);
|
||||
}
|
||||
|
||||
const u32 salt_len = salt_bufs[salt_pos].salt_len;
|
||||
|
||||
const u32 salt_lenv = ceil ((float) salt_len / 4);
|
||||
|
||||
u32x s[64] = { 0 };
|
||||
|
||||
for (int idx = 0; idx < salt_lenv; idx++)
|
||||
{
|
||||
s[idx] = swap32_S (salt_bufs[salt_pos].salt_buf[idx]);
|
||||
|
||||
barrier (CLK_GLOBAL_MEM_FENCE);
|
||||
}
|
||||
|
||||
/**
|
||||
* loop
|
||||
*/
|
||||
|
||||
u32x w0l = w[0];
|
||||
|
||||
for (u32 il_pos = 0; il_pos < il_cnt; il_pos += VECT_SIZE)
|
||||
{
|
||||
const u32x w0r = words_buf_r[il_pos / VECT_SIZE];
|
||||
|
||||
const u32x w0 = w0l | w0r;
|
||||
|
||||
w[0] = w0;
|
||||
|
||||
sha512_hmac_ctx_vector_t ctx;
|
||||
|
||||
sha512_hmac_init_vector (&ctx, w, pw_len);
|
||||
|
||||
sha512_hmac_update_vector (&ctx, s, salt_len);
|
||||
|
||||
sha512_hmac_final_vector (&ctx);
|
||||
|
||||
const u32x r0 = l32_from_64 (ctx.opad.h[7]);
|
||||
const u32x r1 = h32_from_64 (ctx.opad.h[7]);
|
||||
const u32x r2 = l32_from_64 (ctx.opad.h[3]);
|
||||
const u32x r3 = h32_from_64 (ctx.opad.h[3]);
|
||||
|
||||
COMPARE_M_SIMD (r0, r1, r2, r3);
|
||||
}
|
||||
}
|
||||
|
||||
__kernel void m01750_sxx (__global pw_t *pws, __global const kernel_rule_t *rules_buf, __global const pw_t *combs_buf, __global const u32x *words_buf_r, __global void *tmps, __global void *hooks, __global const u32 *bitmaps_buf_s1_a, __global const u32 *bitmaps_buf_s1_b, __global const u32 *bitmaps_buf_s1_c, __global const u32 *bitmaps_buf_s1_d, __global const u32 *bitmaps_buf_s2_a, __global const u32 *bitmaps_buf_s2_b, __global const u32 *bitmaps_buf_s2_c, __global const u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global const digest_t *digests_buf, __global u32 *hashes_shown, __global const salt_t *salt_bufs, __global const void *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)
|
||||
{
|
||||
/**
|
||||
* modifier
|
||||
*/
|
||||
|
||||
const u32 lid = get_local_id (0);
|
||||
const u32 gid = get_global_id (0);
|
||||
|
||||
if (gid >= gid_max) return;
|
||||
|
||||
/**
|
||||
* digest
|
||||
*/
|
||||
|
||||
const u32 search[4] =
|
||||
{
|
||||
digests_buf[digests_offset].digest_buf[DGST_R0],
|
||||
digests_buf[digests_offset].digest_buf[DGST_R1],
|
||||
digests_buf[digests_offset].digest_buf[DGST_R2],
|
||||
digests_buf[digests_offset].digest_buf[DGST_R3]
|
||||
};
|
||||
|
||||
/**
|
||||
* base
|
||||
*/
|
||||
|
||||
const u32 pw_len = pws[gid].pw_len;
|
||||
|
||||
const u32 pw_lenv = ceil ((float) pw_len / 4);
|
||||
|
||||
u32x w[64] = { 0 };
|
||||
|
||||
for (int idx = 0; idx < pw_lenv; idx++)
|
||||
{
|
||||
w[idx] = pws[gid].i[idx];
|
||||
|
||||
barrier (CLK_GLOBAL_MEM_FENCE);
|
||||
}
|
||||
|
||||
const u32 salt_len = salt_bufs[salt_pos].salt_len;
|
||||
|
||||
const u32 salt_lenv = ceil ((float) salt_len / 4);
|
||||
|
||||
u32x s[64] = { 0 };
|
||||
|
||||
for (int idx = 0; idx < salt_lenv; idx++)
|
||||
{
|
||||
s[idx] = swap32_S (salt_bufs[salt_pos].salt_buf[idx]);
|
||||
|
||||
barrier (CLK_GLOBAL_MEM_FENCE);
|
||||
}
|
||||
|
||||
/**
|
||||
* loop
|
||||
*/
|
||||
|
||||
u32x w0l = w[0];
|
||||
|
||||
for (u32 il_pos = 0; il_pos < il_cnt; il_pos += VECT_SIZE)
|
||||
{
|
||||
const u32x w0r = words_buf_r[il_pos / VECT_SIZE];
|
||||
|
||||
const u32x w0 = w0l | w0r;
|
||||
|
||||
w[0] = w0;
|
||||
|
||||
sha512_hmac_ctx_vector_t ctx;
|
||||
|
||||
sha512_hmac_init_vector (&ctx, w, pw_len);
|
||||
|
||||
sha512_hmac_update_vector (&ctx, s, salt_len);
|
||||
|
||||
sha512_hmac_final_vector (&ctx);
|
||||
|
||||
const u32x r0 = l32_from_64 (ctx.opad.h[7]);
|
||||
const u32x r1 = h32_from_64 (ctx.opad.h[7]);
|
||||
const u32x r2 = l32_from_64 (ctx.opad.h[3]);
|
||||
const u32x r3 = h32_from_64 (ctx.opad.h[3]);
|
||||
|
||||
COMPARE_S_SIMD (r0, r1, r2, r3);
|
||||
}
|
||||
}
|
164
OpenCL/m01760_a0-pure.cl
Normal file
164
OpenCL/m01760_a0-pure.cl
Normal file
@ -0,0 +1,164 @@
|
||||
/**
|
||||
* Author......: See docs/credits.txt
|
||||
* License.....: MIT
|
||||
*/
|
||||
|
||||
//#define NEW_SIMD_CODE
|
||||
|
||||
#include "inc_vendor.cl"
|
||||
#include "inc_hash_constants.h"
|
||||
#include "inc_hash_functions.cl"
|
||||
#include "inc_types.cl"
|
||||
#include "inc_common.cl"
|
||||
#include "inc_rp.h"
|
||||
#include "inc_rp.cl"
|
||||
#include "inc_scalar.cl"
|
||||
#include "inc_hash_sha512.cl"
|
||||
|
||||
__kernel void m01760_mxx (__global pw_t *pws, __global const kernel_rule_t *rules_buf, __global const pw_t *combs_buf, __global const bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global const u32 *bitmaps_buf_s1_a, __global const u32 *bitmaps_buf_s1_b, __global const u32 *bitmaps_buf_s1_c, __global const u32 *bitmaps_buf_s1_d, __global const u32 *bitmaps_buf_s2_a, __global const u32 *bitmaps_buf_s2_b, __global const u32 *bitmaps_buf_s2_c, __global const u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global const digest_t *digests_buf, __global u32 *hashes_shown, __global const salt_t *salt_bufs, __global const void *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)
|
||||
{
|
||||
/**
|
||||
* modifier
|
||||
*/
|
||||
|
||||
const u32 lid = get_local_id (0);
|
||||
const u32 gid = get_global_id (0);
|
||||
|
||||
if (gid >= gid_max) return;
|
||||
|
||||
/**
|
||||
* base
|
||||
*/
|
||||
|
||||
const u32 pw_len = pws[gid].pw_len;
|
||||
|
||||
const u32 pw_lenv = ceil ((float) pw_len / 4);
|
||||
|
||||
u32 w[64] = { 0 };
|
||||
|
||||
for (int idx = 0; idx < pw_lenv; idx++)
|
||||
{
|
||||
w[idx] = pws[gid].i[idx];
|
||||
|
||||
barrier (CLK_GLOBAL_MEM_FENCE);
|
||||
}
|
||||
|
||||
const u32 salt_len = salt_bufs[salt_pos].salt_len;
|
||||
|
||||
const u32 salt_lenv = ceil ((float) salt_len / 4);
|
||||
|
||||
u32 s[64] = { 0 };
|
||||
|
||||
for (int idx = 0; idx < salt_lenv; idx++)
|
||||
{
|
||||
s[idx] = swap32_S (salt_bufs[salt_pos].salt_buf[idx]);
|
||||
|
||||
barrier (CLK_GLOBAL_MEM_FENCE);
|
||||
}
|
||||
|
||||
sha512_hmac_ctx_t ctx0;
|
||||
|
||||
sha512_hmac_init (&ctx0, s, salt_len);
|
||||
|
||||
/**
|
||||
* loop
|
||||
*/
|
||||
|
||||
for (u32 il_pos = 0; il_pos < il_cnt; il_pos++)
|
||||
{
|
||||
// todo: add rules engine
|
||||
|
||||
sha512_hmac_ctx_t ctx = ctx0;
|
||||
|
||||
sha512_hmac_update_swap (&ctx, w, pw_len);
|
||||
|
||||
sha512_hmac_final (&ctx);
|
||||
|
||||
const u32 r0 = l32_from_64_S (ctx.opad.h[7]);
|
||||
const u32 r1 = h32_from_64_S (ctx.opad.h[7]);
|
||||
const u32 r2 = l32_from_64_S (ctx.opad.h[3]);
|
||||
const u32 r3 = h32_from_64_S (ctx.opad.h[3]);
|
||||
|
||||
COMPARE_M_SCALAR (r0, r1, r2, r3);
|
||||
}
|
||||
}
|
||||
|
||||
__kernel void m01760_sxx (__global pw_t *pws, __global const kernel_rule_t *rules_buf, __global const pw_t *combs_buf, __global const bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global const u32 *bitmaps_buf_s1_a, __global const u32 *bitmaps_buf_s1_b, __global const u32 *bitmaps_buf_s1_c, __global const u32 *bitmaps_buf_s1_d, __global const u32 *bitmaps_buf_s2_a, __global const u32 *bitmaps_buf_s2_b, __global const u32 *bitmaps_buf_s2_c, __global const u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global const digest_t *digests_buf, __global u32 *hashes_shown, __global const salt_t *salt_bufs, __global const void *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)
|
||||
{
|
||||
/**
|
||||
* modifier
|
||||
*/
|
||||
|
||||
const u32 lid = get_local_id (0);
|
||||
const u32 gid = get_global_id (0);
|
||||
|
||||
if (gid >= gid_max) return;
|
||||
|
||||
/**
|
||||
* digest
|
||||
*/
|
||||
|
||||
const u32 search[4] =
|
||||
{
|
||||
digests_buf[digests_offset].digest_buf[DGST_R0],
|
||||
digests_buf[digests_offset].digest_buf[DGST_R1],
|
||||
digests_buf[digests_offset].digest_buf[DGST_R2],
|
||||
digests_buf[digests_offset].digest_buf[DGST_R3]
|
||||
};
|
||||
|
||||
/**
|
||||
* base
|
||||
*/
|
||||
|
||||
const u32 pw_len = pws[gid].pw_len;
|
||||
|
||||
const u32 pw_lenv = ceil ((float) pw_len / 4);
|
||||
|
||||
u32 w[64] = { 0 };
|
||||
|
||||
for (int idx = 0; idx < pw_lenv; idx++)
|
||||
{
|
||||
w[idx] = pws[gid].i[idx];
|
||||
|
||||
barrier (CLK_GLOBAL_MEM_FENCE);
|
||||
}
|
||||
|
||||
const u32 salt_len = salt_bufs[salt_pos].salt_len;
|
||||
|
||||
const u32 salt_lenv = ceil ((float) salt_len / 4);
|
||||
|
||||
u32 s[64] = { 0 };
|
||||
|
||||
for (int idx = 0; idx < salt_lenv; idx++)
|
||||
{
|
||||
s[idx] = swap32_S (salt_bufs[salt_pos].salt_buf[idx]);
|
||||
|
||||
barrier (CLK_GLOBAL_MEM_FENCE);
|
||||
}
|
||||
|
||||
sha512_hmac_ctx_t ctx0;
|
||||
|
||||
sha512_hmac_init (&ctx0, s, salt_len);
|
||||
|
||||
/**
|
||||
* loop
|
||||
*/
|
||||
|
||||
for (u32 il_pos = 0; il_pos < il_cnt; il_pos++)
|
||||
{
|
||||
// todo: add rules engine
|
||||
|
||||
sha512_hmac_ctx_t ctx = ctx0;
|
||||
|
||||
sha512_hmac_update_swap (&ctx, w, pw_len);
|
||||
|
||||
sha512_hmac_final (&ctx);
|
||||
|
||||
const u32 r0 = l32_from_64_S (ctx.opad.h[7]);
|
||||
const u32 r1 = h32_from_64_S (ctx.opad.h[7]);
|
||||
const u32 r2 = l32_from_64_S (ctx.opad.h[3]);
|
||||
const u32 r3 = h32_from_64_S (ctx.opad.h[3]);
|
||||
|
||||
COMPARE_S_SCALAR (r0, r1, r2, r3);
|
||||
}
|
||||
}
|
202
OpenCL/m01760_a1-pure.cl
Normal file
202
OpenCL/m01760_a1-pure.cl
Normal file
@ -0,0 +1,202 @@
|
||||
/**
|
||||
* Author......: See docs/credits.txt
|
||||
* License.....: MIT
|
||||
*/
|
||||
|
||||
//#define NEW_SIMD_CODE
|
||||
|
||||
#include "inc_vendor.cl"
|
||||
#include "inc_hash_constants.h"
|
||||
#include "inc_hash_functions.cl"
|
||||
#include "inc_types.cl"
|
||||
#include "inc_common.cl"
|
||||
#include "inc_scalar.cl"
|
||||
#include "inc_hash_sha512.cl"
|
||||
|
||||
__kernel void m01760_mxx (__global pw_t *pws, __global const kernel_rule_t *rules_buf, __global const pw_t *combs_buf, __global const bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global const u32 *bitmaps_buf_s1_a, __global const u32 *bitmaps_buf_s1_b, __global const u32 *bitmaps_buf_s1_c, __global const u32 *bitmaps_buf_s1_d, __global const u32 *bitmaps_buf_s2_a, __global const u32 *bitmaps_buf_s2_b, __global const u32 *bitmaps_buf_s2_c, __global const u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global const digest_t *digests_buf, __global u32 *hashes_shown, __global const salt_t *salt_bufs, __global const void *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)
|
||||
{
|
||||
/**
|
||||
* modifier
|
||||
*/
|
||||
|
||||
const u32 lid = get_local_id (0);
|
||||
const u32 gid = get_global_id (0);
|
||||
|
||||
if (gid >= gid_max) return;
|
||||
|
||||
/**
|
||||
* base
|
||||
*/
|
||||
|
||||
const u32 pw_len = pws[gid].pw_len;
|
||||
|
||||
const u32 pw_lenv = ceil ((float) pw_len / 4);
|
||||
|
||||
u32 w[64] = { 0 };
|
||||
|
||||
for (int idx = 0; idx < pw_lenv; idx++)
|
||||
{
|
||||
w[idx] = swap32_S (pws[gid].i[idx]);
|
||||
|
||||
barrier (CLK_GLOBAL_MEM_FENCE);
|
||||
}
|
||||
|
||||
const u32 salt_len = salt_bufs[salt_pos].salt_len;
|
||||
|
||||
const u32 salt_lenv = ceil ((float) salt_len / 4);
|
||||
|
||||
u32 s[64] = { 0 };
|
||||
|
||||
for (int idx = 0; idx < salt_lenv; idx++)
|
||||
{
|
||||
s[idx] = swap32_S (salt_bufs[salt_pos].salt_buf[idx]);
|
||||
|
||||
barrier (CLK_GLOBAL_MEM_FENCE);
|
||||
}
|
||||
|
||||
sha512_hmac_ctx_t ctx0;
|
||||
|
||||
sha512_hmac_init (&ctx0, s, salt_len);
|
||||
|
||||
/**
|
||||
* loop
|
||||
*/
|
||||
|
||||
for (u32 il_pos = 0; il_pos < il_cnt; il_pos++)
|
||||
{
|
||||
const u32 comb_len = combs_buf[il_pos].pw_len;
|
||||
|
||||
u32 c[64];
|
||||
|
||||
#ifdef _unroll
|
||||
#pragma unroll
|
||||
#endif
|
||||
for (int idx = 0; idx < 64; idx++)
|
||||
{
|
||||
c[idx] = swap32_S (combs_buf[il_pos].i[idx]);
|
||||
}
|
||||
|
||||
switch_buffer_by_offset_1x64_be_S (c, pw_len);
|
||||
|
||||
#ifdef _unroll
|
||||
#pragma unroll
|
||||
#endif
|
||||
for (int i = 0; i < 64; i++)
|
||||
{
|
||||
c[i] |= w[i];
|
||||
}
|
||||
|
||||
sha512_hmac_ctx_t ctx = ctx0;
|
||||
|
||||
sha512_hmac_update (&ctx, c, pw_len + comb_len);
|
||||
|
||||
sha512_hmac_final (&ctx);
|
||||
|
||||
const u32 r0 = l32_from_64_S (ctx.opad.h[7]);
|
||||
const u32 r1 = h32_from_64_S (ctx.opad.h[7]);
|
||||
const u32 r2 = l32_from_64_S (ctx.opad.h[3]);
|
||||
const u32 r3 = h32_from_64_S (ctx.opad.h[3]);
|
||||
|
||||
COMPARE_M_SCALAR (r0, r1, r2, r3);
|
||||
}
|
||||
}
|
||||
|
||||
__kernel void m01760_sxx (__global pw_t *pws, __global const kernel_rule_t *rules_buf, __global const pw_t *combs_buf, __global const bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global const u32 *bitmaps_buf_s1_a, __global const u32 *bitmaps_buf_s1_b, __global const u32 *bitmaps_buf_s1_c, __global const u32 *bitmaps_buf_s1_d, __global const u32 *bitmaps_buf_s2_a, __global const u32 *bitmaps_buf_s2_b, __global const u32 *bitmaps_buf_s2_c, __global const u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global const digest_t *digests_buf, __global u32 *hashes_shown, __global const salt_t *salt_bufs, __global const void *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)
|
||||
{
|
||||
/**
|
||||
* modifier
|
||||
*/
|
||||
|
||||
const u32 lid = get_local_id (0);
|
||||
const u32 gid = get_global_id (0);
|
||||
|
||||
if (gid >= gid_max) return;
|
||||
|
||||
/**
|
||||
* digest
|
||||
*/
|
||||
|
||||
const u32 search[4] =
|
||||
{
|
||||
digests_buf[digests_offset].digest_buf[DGST_R0],
|
||||
digests_buf[digests_offset].digest_buf[DGST_R1],
|
||||
digests_buf[digests_offset].digest_buf[DGST_R2],
|
||||
digests_buf[digests_offset].digest_buf[DGST_R3]
|
||||
};
|
||||
|
||||
/**
|
||||
* base
|
||||
*/
|
||||
|
||||
const u32 pw_len = pws[gid].pw_len;
|
||||
|
||||
const u32 pw_lenv = ceil ((float) pw_len / 4);
|
||||
|
||||
u32 w[64] = { 0 };
|
||||
|
||||
for (int idx = 0; idx < pw_lenv; idx++)
|
||||
{
|
||||
w[idx] = swap32_S (pws[gid].i[idx]);
|
||||
|
||||
barrier (CLK_GLOBAL_MEM_FENCE);
|
||||
}
|
||||
|
||||
const u32 salt_len = salt_bufs[salt_pos].salt_len;
|
||||
|
||||
const u32 salt_lenv = ceil ((float) salt_len / 4);
|
||||
|
||||
u32 s[64] = { 0 };
|
||||
|
||||
for (int idx = 0; idx < salt_lenv; idx++)
|
||||
{
|
||||
s[idx] = swap32_S (salt_bufs[salt_pos].salt_buf[idx]);
|
||||
|
||||
barrier (CLK_GLOBAL_MEM_FENCE);
|
||||
}
|
||||
|
||||
sha512_hmac_ctx_t ctx0;
|
||||
|
||||
sha512_hmac_init (&ctx0, s, salt_len);
|
||||
|
||||
/**
|
||||
* loop
|
||||
*/
|
||||
|
||||
for (u32 il_pos = 0; il_pos < il_cnt; il_pos++)
|
||||
{
|
||||
const u32 comb_len = combs_buf[il_pos].pw_len;
|
||||
|
||||
u32 c[64];
|
||||
|
||||
#ifdef _unroll
|
||||
#pragma unroll
|
||||
#endif
|
||||
for (int idx = 0; idx < 64; idx++)
|
||||
{
|
||||
c[idx] = swap32_S (combs_buf[il_pos].i[idx]);
|
||||
}
|
||||
|
||||
switch_buffer_by_offset_1x64_be_S (c, pw_len);
|
||||
|
||||
#ifdef _unroll
|
||||
#pragma unroll
|
||||
#endif
|
||||
for (int i = 0; i < 64; i++)
|
||||
{
|
||||
c[i] |= w[i];
|
||||
}
|
||||
|
||||
sha512_hmac_ctx_t ctx = ctx0;
|
||||
|
||||
sha512_hmac_update (&ctx, c, pw_len + comb_len);
|
||||
|
||||
sha512_hmac_final (&ctx);
|
||||
|
||||
const u32 r0 = l32_from_64_S (ctx.opad.h[7]);
|
||||
const u32 r1 = h32_from_64_S (ctx.opad.h[7]);
|
||||
const u32 r2 = l32_from_64_S (ctx.opad.h[3]);
|
||||
const u32 r3 = h32_from_64_S (ctx.opad.h[3]);
|
||||
|
||||
COMPARE_S_SCALAR (r0, r1, r2, r3);
|
||||
}
|
||||
}
|
174
OpenCL/m01760_a3-pure.cl
Normal file
174
OpenCL/m01760_a3-pure.cl
Normal file
@ -0,0 +1,174 @@
|
||||
/**
|
||||
* Author......: See docs/credits.txt
|
||||
* License.....: MIT
|
||||
*/
|
||||
|
||||
#define NEW_SIMD_CODE
|
||||
|
||||
#include "inc_vendor.cl"
|
||||
#include "inc_hash_constants.h"
|
||||
#include "inc_hash_functions.cl"
|
||||
#include "inc_types.cl"
|
||||
#include "inc_common.cl"
|
||||
#include "inc_simd.cl"
|
||||
#include "inc_hash_sha512.cl"
|
||||
|
||||
__kernel void m01760_mxx (__global pw_t *pws, __global const kernel_rule_t *rules_buf, __global const pw_t *combs_buf, __global const u32x *words_buf_r, __global void *tmps, __global void *hooks, __global const u32 *bitmaps_buf_s1_a, __global const u32 *bitmaps_buf_s1_b, __global const u32 *bitmaps_buf_s1_c, __global const u32 *bitmaps_buf_s1_d, __global const u32 *bitmaps_buf_s2_a, __global const u32 *bitmaps_buf_s2_b, __global const u32 *bitmaps_buf_s2_c, __global const u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global const digest_t *digests_buf, __global u32 *hashes_shown, __global const salt_t *salt_bufs, __global const void *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)
|
||||
{
|
||||
/**
|
||||
* modifier
|
||||
*/
|
||||
|
||||
const u32 lid = get_local_id (0);
|
||||
const u32 gid = get_global_id (0);
|
||||
|
||||
if (gid >= gid_max) return;
|
||||
|
||||
/**
|
||||
* base
|
||||
*/
|
||||
|
||||
const u32 pw_len = pws[gid].pw_len;
|
||||
|
||||
const u32 pw_lenv = ceil ((float) pw_len / 4);
|
||||
|
||||
u32x w[64] = { 0 };
|
||||
|
||||
for (int idx = 0; idx < pw_lenv; idx++)
|
||||
{
|
||||
w[idx] = pws[gid].i[idx];
|
||||
|
||||
barrier (CLK_GLOBAL_MEM_FENCE);
|
||||
}
|
||||
|
||||
const u32 salt_len = salt_bufs[salt_pos].salt_len;
|
||||
|
||||
const u32 salt_lenv = ceil ((float) salt_len / 4);
|
||||
|
||||
u32x s[64] = { 0 };
|
||||
|
||||
for (int idx = 0; idx < salt_lenv; idx++)
|
||||
{
|
||||
s[idx] = swap32_S (salt_bufs[salt_pos].salt_buf[idx]);
|
||||
|
||||
barrier (CLK_GLOBAL_MEM_FENCE);
|
||||
}
|
||||
|
||||
sha512_hmac_ctx_vector_t ctx0;
|
||||
|
||||
sha512_hmac_init_vector (&ctx0, s, salt_len);
|
||||
|
||||
/**
|
||||
* loop
|
||||
*/
|
||||
|
||||
u32x w0l = w[0];
|
||||
|
||||
for (u32 il_pos = 0; il_pos < il_cnt; il_pos += VECT_SIZE)
|
||||
{
|
||||
const u32x w0r = words_buf_r[il_pos / VECT_SIZE];
|
||||
|
||||
const u32x w0 = w0l | w0r;
|
||||
|
||||
w[0] = w0;
|
||||
|
||||
sha512_hmac_ctx_vector_t ctx = ctx0;
|
||||
|
||||
sha512_hmac_update_vector (&ctx, w, pw_len);
|
||||
|
||||
sha512_hmac_final_vector (&ctx);
|
||||
|
||||
const u32x r0 = l32_from_64 (ctx.opad.h[7]);
|
||||
const u32x r1 = h32_from_64 (ctx.opad.h[7]);
|
||||
const u32x r2 = l32_from_64 (ctx.opad.h[3]);
|
||||
const u32x r3 = h32_from_64 (ctx.opad.h[3]);
|
||||
|
||||
COMPARE_M_SIMD (r0, r1, r2, r3);
|
||||
}
|
||||
}
|
||||
|
||||
__kernel void m01760_sxx (__global pw_t *pws, __global const kernel_rule_t *rules_buf, __global const pw_t *combs_buf, __global const u32x *words_buf_r, __global void *tmps, __global void *hooks, __global const u32 *bitmaps_buf_s1_a, __global const u32 *bitmaps_buf_s1_b, __global const u32 *bitmaps_buf_s1_c, __global const u32 *bitmaps_buf_s1_d, __global const u32 *bitmaps_buf_s2_a, __global const u32 *bitmaps_buf_s2_b, __global const u32 *bitmaps_buf_s2_c, __global const u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global const digest_t *digests_buf, __global u32 *hashes_shown, __global const salt_t *salt_bufs, __global const void *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)
|
||||
{
|
||||
/**
|
||||
* modifier
|
||||
*/
|
||||
|
||||
const u32 lid = get_local_id (0);
|
||||
const u32 gid = get_global_id (0);
|
||||
|
||||
if (gid >= gid_max) return;
|
||||
|
||||
/**
|
||||
* digest
|
||||
*/
|
||||
|
||||
const u32 search[4] =
|
||||
{
|
||||
digests_buf[digests_offset].digest_buf[DGST_R0],
|
||||
digests_buf[digests_offset].digest_buf[DGST_R1],
|
||||
digests_buf[digests_offset].digest_buf[DGST_R2],
|
||||
digests_buf[digests_offset].digest_buf[DGST_R3]
|
||||
};
|
||||
|
||||
/**
|
||||
* base
|
||||
*/
|
||||
|
||||
const u32 pw_len = pws[gid].pw_len;
|
||||
|
||||
const u32 pw_lenv = ceil ((float) pw_len / 4);
|
||||
|
||||
u32x w[64] = { 0 };
|
||||
|
||||
for (int idx = 0; idx < pw_lenv; idx++)
|
||||
{
|
||||
w[idx] = pws[gid].i[idx];
|
||||
|
||||
barrier (CLK_GLOBAL_MEM_FENCE);
|
||||
}
|
||||
|
||||
const u32 salt_len = salt_bufs[salt_pos].salt_len;
|
||||
|
||||
const u32 salt_lenv = ceil ((float) salt_len / 4);
|
||||
|
||||
u32x s[64] = { 0 };
|
||||
|
||||
for (int idx = 0; idx < salt_lenv; idx++)
|
||||
{
|
||||
s[idx] = swap32_S (salt_bufs[salt_pos].salt_buf[idx]);
|
||||
|
||||
barrier (CLK_GLOBAL_MEM_FENCE);
|
||||
}
|
||||
|
||||
sha512_hmac_ctx_vector_t ctx0;
|
||||
|
||||
sha512_hmac_init_vector (&ctx0, s, salt_len);
|
||||
|
||||
/**
|
||||
* loop
|
||||
*/
|
||||
|
||||
u32x w0l = w[0];
|
||||
|
||||
for (u32 il_pos = 0; il_pos < il_cnt; il_pos += VECT_SIZE)
|
||||
{
|
||||
const u32x w0r = words_buf_r[il_pos / VECT_SIZE];
|
||||
|
||||
const u32x w0 = w0l | w0r;
|
||||
|
||||
w[0] = w0;
|
||||
|
||||
sha512_hmac_ctx_vector_t ctx = ctx0;
|
||||
|
||||
sha512_hmac_update_vector (&ctx, w, pw_len);
|
||||
|
||||
sha512_hmac_final_vector (&ctx);
|
||||
|
||||
const u32x r0 = l32_from_64 (ctx.opad.h[7]);
|
||||
const u32x r1 = h32_from_64 (ctx.opad.h[7]);
|
||||
const u32x r2 = l32_from_64 (ctx.opad.h[3]);
|
||||
const u32x r3 = h32_from_64 (ctx.opad.h[3]);
|
||||
|
||||
COMPARE_S_SIMD (r0, r1, r2, r3);
|
||||
}
|
||||
}
|
@ -17,42 +17,6 @@
|
||||
#define COMPARE_S "inc_comp_single.cl"
|
||||
#define COMPARE_M "inc_comp_multi.cl"
|
||||
|
||||
void hmac_sha1_run_V (u32x w0[4], u32x w1[4], u32x w2[4], u32x w3[4], u32x ipad[5], u32x opad[5], u32x digest[5])
|
||||
{
|
||||
digest[0] = ipad[0];
|
||||
digest[1] = ipad[1];
|
||||
digest[2] = ipad[2];
|
||||
digest[3] = ipad[3];
|
||||
digest[4] = ipad[4];
|
||||
|
||||
sha1_transform_vector (w0, w1, w2, w3, digest);
|
||||
|
||||
w0[0] = digest[0];
|
||||
w0[1] = digest[1];
|
||||
w0[2] = digest[2];
|
||||
w0[3] = digest[3];
|
||||
w1[0] = digest[4];
|
||||
w1[1] = 0x80000000;
|
||||
w1[2] = 0;
|
||||
w1[3] = 0;
|
||||
w2[0] = 0;
|
||||
w2[1] = 0;
|
||||
w2[2] = 0;
|
||||
w2[3] = 0;
|
||||
w3[0] = 0;
|
||||
w3[1] = 0;
|
||||
w3[2] = 0;
|
||||
w3[3] = (64 + 20) * 8;
|
||||
|
||||
digest[0] = opad[0];
|
||||
digest[1] = opad[1];
|
||||
digest[2] = opad[2];
|
||||
digest[3] = opad[3];
|
||||
digest[4] = opad[4];
|
||||
|
||||
sha1_transform_vector (w0, w1, w2, w3, digest);
|
||||
}
|
||||
|
||||
__kernel void m02500_init (__global pw_t *pws, __global const kernel_rule_t *rules_buf, __global const pw_t *combs_buf, __global const bf_t *bfs_buf, __global wpa_tmp_t *tmps, __global void *hooks, __global const u32 *bitmaps_buf_s1_a, __global const u32 *bitmaps_buf_s1_b, __global const u32 *bitmaps_buf_s1_c, __global const u32 *bitmaps_buf_s1_d, __global const u32 *bitmaps_buf_s2_a, __global const u32 *bitmaps_buf_s2_b, __global const u32 *bitmaps_buf_s2_c, __global const u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global const digest_t *digests_buf, __global u32 *hashes_shown, __global const salt_t *salt_bufs, __global const wpa_t *wpa_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)
|
||||
{
|
||||
/**
|
||||
@ -131,20 +95,25 @@ __kernel void m02500_loop (__global pw_t *pws, __global const kernel_rule_t *rul
|
||||
|
||||
if ((gid * VECT_SIZE) >= gid_max) return;
|
||||
|
||||
u32x ipad[5];
|
||||
u32x opad[5];
|
||||
sha1_hmac_ctx_vector_t ctx;
|
||||
|
||||
ipad[0] = packv (tmps, ipad, gid, 0);
|
||||
ipad[1] = packv (tmps, ipad, gid, 1);
|
||||
ipad[2] = packv (tmps, ipad, gid, 2);
|
||||
ipad[3] = packv (tmps, ipad, gid, 3);
|
||||
ipad[4] = packv (tmps, ipad, gid, 4);
|
||||
sha1_hmac_init (&ctx);
|
||||
|
||||
opad[0] = packv (tmps, opad, gid, 0);
|
||||
opad[1] = packv (tmps, opad, gid, 1);
|
||||
opad[2] = packv (tmps, opad, gid, 2);
|
||||
opad[3] = packv (tmps, opad, gid, 3);
|
||||
opad[4] = packv (tmps, opad, gid, 4);
|
||||
ctx.ipad.h[0] = packv (tmps, ipad, gid, 0);
|
||||
ctx.ipad.h[1] = packv (tmps, ipad, gid, 1);
|
||||
ctx.ipad.h[2] = packv (tmps, ipad, gid, 2);
|
||||
ctx.ipad.h[3] = packv (tmps, ipad, gid, 3);
|
||||
ctx.ipad.h[4] = packv (tmps, ipad, gid, 4);
|
||||
|
||||
ctx.ipad.len = 64;
|
||||
|
||||
ctx.opad.h[0] = packv (tmps, opad, gid, 0);
|
||||
ctx.opad.h[1] = packv (tmps, opad, gid, 1);
|
||||
ctx.opad.h[2] = packv (tmps, opad, gid, 2);
|
||||
ctx.opad.h[3] = packv (tmps, opad, gid, 3);
|
||||
ctx.opad.h[4] = packv (tmps, opad, gid, 4);
|
||||
|
||||
ctx.opad.len = 64;
|
||||
|
||||
for (u32 i = 0; i < 8; i += 5)
|
||||
{
|
||||
@ -175,7 +144,7 @@ __kernel void m02500_loop (__global pw_t *pws, __global const kernel_rule_t *rul
|
||||
w0[2] = dgst[2];
|
||||
w0[3] = dgst[3];
|
||||
w1[0] = dgst[4];
|
||||
w1[1] = 0x80000000;
|
||||
w1[1] = 0;
|
||||
w1[2] = 0;
|
||||
w1[3] = 0;
|
||||
w2[0] = 0;
|
||||
@ -185,9 +154,17 @@ __kernel void m02500_loop (__global pw_t *pws, __global const kernel_rule_t *rul
|
||||
w3[0] = 0;
|
||||
w3[1] = 0;
|
||||
w3[2] = 0;
|
||||
w3[3] = (64 + 20) * 8;
|
||||
w3[3] = 0;
|
||||
|
||||
hmac_sha1_run_V (w0, w1, w2, w3, ipad, opad, dgst);
|
||||
sha1_hmac_update_vector_64 (&ctx, w0, w1, w2, w3, 20);
|
||||
|
||||
sha1_hmac_final_vector (&ctx);
|
||||
|
||||
dgst[0] = ctx.opad.h[0];
|
||||
dgst[1] = ctx.opad.h[1];
|
||||
dgst[2] = ctx.opad.h[2];
|
||||
dgst[3] = ctx.opad.h[3];
|
||||
dgst[4] = ctx.opad.h[4];
|
||||
|
||||
out[0] ^= dgst[0];
|
||||
out[1] ^= dgst[1];
|
||||
|
Loading…
Reference in New Issue
Block a user