1
0
mirror of https://github.com/hashcat/hashcat.git synced 2024-11-17 21:59:06 +00:00
hashcat/OpenCL/amp_a1.cl

44 lines
908 B
Common Lisp
Raw Normal View History

2015-12-04 14:47:52 +00:00
/**
* Author......: See docs/credits.txt
2015-12-04 14:47:52 +00:00
* License.....: MIT
*/
#include "inc_vendor.cl"
#include "inc_types.cl"
#include "inc_common.cl"
2015-12-04 14:47:52 +00:00
__kernel void amp (__global pw_t *pws, __global pw_t *pws_amp, __global const kernel_rule_t *rules_buf, __global const pw_t *combs_buf, __global const bf_t *bfs_buf, const u32 combs_mode, const u64 gid_max)
2015-12-04 14:47:52 +00:00
{
const u64 gid = get_global_id (0);
2015-12-04 14:47:52 +00:00
if (gid >= gid_max) return;
pw_t pw = pws[gid];
2015-12-04 14:47:52 +00:00
pw_t comb = combs_buf[0];
2015-12-04 14:47:52 +00:00
const u32 pw_len = pw.pw_len;
2015-12-04 14:47:52 +00:00
const u32 comb_len = comb.pw_len;
2015-12-04 14:47:52 +00:00
if (combs_mode == COMBINATOR_MODE_BASE_LEFT)
{
switch_buffer_by_offset_1x64_le_S (comb.i, pw_len);
2015-12-04 14:47:52 +00:00
}
if (combs_mode == COMBINATOR_MODE_BASE_RIGHT)
{
switch_buffer_by_offset_1x64_le_S (pw.i, comb_len);
2015-12-04 14:47:52 +00:00
}
#pragma unroll
for (int i = 0; i < 64; i++)
{
pw.i[i] |= comb.i[i];
}
2015-12-04 14:47:52 +00:00
pw.pw_len = pw_len + comb_len;
2015-12-04 14:47:52 +00:00
pws_amp[gid] = pw;
2015-12-04 14:47:52 +00:00
}