2015-12-04 14:47:52 +00:00
|
|
|
/**
|
2016-09-11 20:20:15 +00:00
|
|
|
* Author......: See docs/credits.txt
|
2015-12-04 14:47:52 +00:00
|
|
|
* License.....: MIT
|
|
|
|
*/
|
|
|
|
|
2016-05-25 21:04:26 +00:00
|
|
|
#include "inc_hash_constants.h"
|
|
|
|
#include "inc_vendor.cl"
|
|
|
|
#include "inc_types.cl"
|
2015-12-04 14:47:52 +00:00
|
|
|
|
2016-05-25 21:04:26 +00:00
|
|
|
#include "inc_rp.h"
|
|
|
|
#include "inc_rp.cl"
|
2015-12-04 14:47:52 +00:00
|
|
|
|
2017-06-24 22:56:25 +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 u32 gid_max)
|
2015-12-04 14:47:52 +00:00
|
|
|
{
|
|
|
|
const u32 gid = get_global_id (0);
|
|
|
|
|
|
|
|
if (gid >= gid_max) return;
|
|
|
|
|
2017-06-17 15:57:30 +00:00
|
|
|
if (rules_buf[0].cmds[0] == RULE_OP_MANGLE_NOOP && rules_buf[0].cmds[1] == 0) return;
|
2016-09-14 15:40:39 +00:00
|
|
|
|
2017-06-17 15:57:30 +00:00
|
|
|
const u32 pw_len = pws[gid].pw_len;
|
2016-09-14 15:40:39 +00:00
|
|
|
|
2015-12-15 11:04:22 +00:00
|
|
|
u32 w0[4];
|
|
|
|
u32 w1[4];
|
2015-12-04 14:47:52 +00:00
|
|
|
|
|
|
|
w0[0] = pws[gid].i[ 0];
|
|
|
|
w0[1] = pws[gid].i[ 1];
|
|
|
|
w0[2] = pws[gid].i[ 2];
|
|
|
|
w0[3] = pws[gid].i[ 3];
|
|
|
|
w1[0] = pws[gid].i[ 4];
|
|
|
|
w1[1] = pws[gid].i[ 5];
|
|
|
|
w1[2] = pws[gid].i[ 6];
|
|
|
|
w1[3] = pws[gid].i[ 7];
|
|
|
|
|
|
|
|
const u32 out_len = apply_rules (rules_buf[0].cmds, w0, w1, pw_len);
|
|
|
|
|
|
|
|
pws_amp[gid].i[0] = w0[0];
|
|
|
|
pws_amp[gid].i[1] = w0[1];
|
|
|
|
pws_amp[gid].i[2] = w0[2];
|
|
|
|
pws_amp[gid].i[3] = w0[3];
|
|
|
|
pws_amp[gid].i[4] = w1[0];
|
|
|
|
pws_amp[gid].i[5] = w1[1];
|
|
|
|
pws_amp[gid].i[6] = w1[2];
|
|
|
|
pws_amp[gid].i[7] = w1[3];
|
|
|
|
|
|
|
|
pws_amp[gid].pw_len = out_len;
|
|
|
|
}
|