1
0
mirror of https://github.com/hashcat/hashcat.git synced 2024-12-26 00:18:36 +00:00
hashcat/OpenCL/amp_a1.cl

46 lines
940 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
*/
#ifdef KERNEL_STATIC
#include "inc_vendor.h"
#include "inc_types.h"
#include "inc_common.cl"
#endif
2015-12-04 14:47:52 +00:00
KERNEL_FQ void amp (GLOBAL_AS pw_t *pws, GLOBAL_AS pw_t *pws_amp, GLOBAL_AS const kernel_rule_t *rules_buf, GLOBAL_AS const pw_t *combs_buf, GLOBAL_AS 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_amp[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[gid] = pw;
2015-12-04 14:47:52 +00:00
}