mirror of
https://github.com/hashcat/hashcat.git
synced 2024-11-26 01:50:10 +00:00
Merge pull request #311 from fgaudreault/master
Adding parser and basic kernels for -m 13500
This commit is contained in:
commit
9294aaccae
522
OpenCL/m00134_a0.cl
Normal file
522
OpenCL/m00134_a0.cl
Normal file
@ -0,0 +1,522 @@
|
||||
/**
|
||||
* Author......: Jens Steube <jens.steube@gmail.com>
|
||||
* License.....: MIT
|
||||
*/
|
||||
|
||||
#define _SHA1_
|
||||
|
||||
#define NEW_SIMD_CODE
|
||||
|
||||
#include "include/constants.h"
|
||||
#include "include/kernel_vendor.h"
|
||||
|
||||
#define DGST_R0 3
|
||||
#define DGST_R1 4
|
||||
#define DGST_R2 2
|
||||
#define DGST_R3 1
|
||||
|
||||
#include "include/kernel_functions.c"
|
||||
#include "OpenCL/types_ocl.c"
|
||||
#include "OpenCL/common.c"
|
||||
#include "include/rp_kernel.h"
|
||||
#include "OpenCL/rp.c"
|
||||
#include "OpenCL/simd.c"
|
||||
|
||||
// no unicode yet
|
||||
|
||||
__kernel void m00134_m04 (__global pw_t *pws, __global kernel_rule_t *rules_buf, __global comb_t *combs_buf, __global bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global u32 *bitmaps_buf_s1_a, __global u32 *bitmaps_buf_s1_b, __global u32 *bitmaps_buf_s1_c, __global u32 *bitmaps_buf_s1_d, __global u32 *bitmaps_buf_s2_a, __global u32 *bitmaps_buf_s2_b, __global u32 *bitmaps_buf_s2_c, __global u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global digest_t *digests_buf, __global u32 *hashes_shown, __global salt_t *salt_bufs, __global void *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
|
||||
{
|
||||
/**
|
||||
* modifier
|
||||
*/
|
||||
|
||||
const u32 lid = get_local_id (0);
|
||||
|
||||
/**
|
||||
* base
|
||||
*/
|
||||
|
||||
const u32 gid = get_global_id (0);
|
||||
|
||||
if (gid >= gid_max) return;
|
||||
|
||||
u32 pw_buf0[4];
|
||||
u32 pw_buf1[4];
|
||||
|
||||
pw_buf0[0] = pws[gid].i[0];
|
||||
pw_buf0[1] = pws[gid].i[1];
|
||||
pw_buf0[2] = pws[gid].i[2];
|
||||
pw_buf0[3] = pws[gid].i[3];
|
||||
pw_buf1[0] = pws[gid].i[4];
|
||||
pw_buf1[1] = pws[gid].i[5];
|
||||
pw_buf1[2] = pws[gid].i[6];
|
||||
pw_buf1[3] = pws[gid].i[7];
|
||||
|
||||
const u32 pw_len = pws[gid].pw_len;
|
||||
|
||||
/**
|
||||
* salt
|
||||
*/
|
||||
|
||||
u32 salt_buf0[4];
|
||||
u32 salt_buf1[4];
|
||||
u32 salt_buf2[4];
|
||||
u32 salt_buf3[4];
|
||||
|
||||
salt_buf0[0] = salt_bufs[salt_pos].salt_buf[ 0];
|
||||
salt_buf0[1] = salt_bufs[salt_pos].salt_buf[ 1];
|
||||
salt_buf0[2] = salt_bufs[salt_pos].salt_buf[ 2];
|
||||
salt_buf0[3] = salt_bufs[salt_pos].salt_buf[ 3];
|
||||
salt_buf1[0] = salt_bufs[salt_pos].salt_buf[ 4];
|
||||
salt_buf1[1] = salt_bufs[salt_pos].salt_buf[ 5];
|
||||
salt_buf1[2] = salt_bufs[salt_pos].salt_buf[ 6];
|
||||
salt_buf1[3] = salt_bufs[salt_pos].salt_buf[ 7];
|
||||
salt_buf2[0] = salt_bufs[salt_pos].salt_buf[ 8];
|
||||
salt_buf2[1] = salt_bufs[salt_pos].salt_buf[ 9];
|
||||
salt_buf2[2] = salt_bufs[salt_pos].salt_buf[10];
|
||||
salt_buf2[3] = salt_bufs[salt_pos].salt_buf[11];
|
||||
salt_buf3[0] = salt_bufs[salt_pos].salt_buf[12];
|
||||
salt_buf3[1] = salt_bufs[salt_pos].salt_buf[13];
|
||||
salt_buf3[2] = salt_bufs[salt_pos].salt_buf[14];
|
||||
salt_buf3[3] = salt_bufs[salt_pos].salt_buf[15];
|
||||
|
||||
const u32 salt_len = salt_bufs[salt_pos].salt_len;
|
||||
|
||||
/**
|
||||
* loop
|
||||
*/
|
||||
|
||||
for (u32 il_pos = 0; il_pos < il_cnt; il_pos += VECT_SIZE)
|
||||
{
|
||||
u32x w0[4] = { 0 };
|
||||
u32x w1[4] = { 0 };
|
||||
u32x w2[4] = { 0 };
|
||||
u32x w3[4] = { 0 };
|
||||
|
||||
const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1);
|
||||
|
||||
make_unicode (w1, w2, w3);
|
||||
make_unicode (w0, w0, w1);
|
||||
|
||||
const u32x out_len2 = out_len * 2;
|
||||
|
||||
/**
|
||||
* prepend salt
|
||||
*/
|
||||
|
||||
const u32x out_salt_len = out_len2 + salt_len;
|
||||
|
||||
switch_buffer_by_offset_le_VV (w0, w1, w2, w3, salt_len);
|
||||
|
||||
w0[0] |= salt_buf0[0];
|
||||
w0[1] |= salt_buf0[1];
|
||||
w0[2] |= salt_buf0[2];
|
||||
w0[3] |= salt_buf0[3];
|
||||
w1[0] |= salt_buf1[0];
|
||||
w1[1] |= salt_buf1[1];
|
||||
w1[2] |= salt_buf1[2];
|
||||
w1[3] |= salt_buf1[3];
|
||||
w2[0] |= salt_buf2[0];
|
||||
w2[1] |= salt_buf2[1];
|
||||
w2[2] |= salt_buf2[2];
|
||||
w2[3] |= salt_buf2[3];
|
||||
w3[0] |= salt_buf3[0];
|
||||
w3[1] |= salt_buf3[1];
|
||||
w3[2] |= salt_buf3[2];
|
||||
w3[3] |= salt_buf3[3];
|
||||
|
||||
append_0x80_4x4_VV (w0, w1, w2, w3, out_salt_len);
|
||||
|
||||
/**
|
||||
* sha1
|
||||
*/
|
||||
|
||||
u32x w0_t = swap32 (w0[0]);
|
||||
u32x w1_t = swap32 (w0[1]);
|
||||
u32x w2_t = swap32 (w0[2]);
|
||||
u32x w3_t = swap32 (w0[3]);
|
||||
u32x w4_t = swap32 (w1[0]);
|
||||
u32x w5_t = swap32 (w1[1]);
|
||||
u32x w6_t = swap32 (w1[2]);
|
||||
u32x w7_t = swap32 (w1[3]);
|
||||
u32x w8_t = swap32 (w2[0]);
|
||||
u32x w9_t = swap32 (w2[1]);
|
||||
u32x wa_t = swap32 (w2[2]);
|
||||
u32x wb_t = swap32 (w2[3]);
|
||||
u32x wc_t = swap32 (w3[0]);
|
||||
u32x wd_t = swap32 (w3[1]);
|
||||
u32x we_t = 0;
|
||||
u32x wf_t = out_salt_len * 8;
|
||||
|
||||
u32x a = SHA1M_A;
|
||||
u32x b = SHA1M_B;
|
||||
u32x c = SHA1M_C;
|
||||
u32x d = SHA1M_D;
|
||||
u32x e = SHA1M_E;
|
||||
|
||||
#undef K
|
||||
#define K SHA1C00
|
||||
|
||||
SHA1_STEP (SHA1_F0o, a, b, c, d, e, w0_t);
|
||||
SHA1_STEP (SHA1_F0o, e, a, b, c, d, w1_t);
|
||||
SHA1_STEP (SHA1_F0o, d, e, a, b, c, w2_t);
|
||||
SHA1_STEP (SHA1_F0o, c, d, e, a, b, w3_t);
|
||||
SHA1_STEP (SHA1_F0o, b, c, d, e, a, w4_t);
|
||||
SHA1_STEP (SHA1_F0o, a, b, c, d, e, w5_t);
|
||||
SHA1_STEP (SHA1_F0o, e, a, b, c, d, w6_t);
|
||||
SHA1_STEP (SHA1_F0o, d, e, a, b, c, w7_t);
|
||||
SHA1_STEP (SHA1_F0o, c, d, e, a, b, w8_t);
|
||||
SHA1_STEP (SHA1_F0o, b, c, d, e, a, w9_t);
|
||||
SHA1_STEP (SHA1_F0o, a, b, c, d, e, wa_t);
|
||||
SHA1_STEP (SHA1_F0o, e, a, b, c, d, wb_t);
|
||||
SHA1_STEP (SHA1_F0o, d, e, a, b, c, wc_t);
|
||||
SHA1_STEP (SHA1_F0o, c, d, e, a, b, wd_t);
|
||||
SHA1_STEP (SHA1_F0o, b, c, d, e, a, we_t);
|
||||
SHA1_STEP (SHA1_F0o, a, b, c, d, e, wf_t);
|
||||
w0_t = rotl32 ((wd_t ^ w8_t ^ w2_t ^ w0_t), 1u); SHA1_STEP (SHA1_F0o, e, a, b, c, d, w0_t);
|
||||
w1_t = rotl32 ((we_t ^ w9_t ^ w3_t ^ w1_t), 1u); SHA1_STEP (SHA1_F0o, d, e, a, b, c, w1_t);
|
||||
w2_t = rotl32 ((wf_t ^ wa_t ^ w4_t ^ w2_t), 1u); SHA1_STEP (SHA1_F0o, c, d, e, a, b, w2_t);
|
||||
w3_t = rotl32 ((w0_t ^ wb_t ^ w5_t ^ w3_t), 1u); SHA1_STEP (SHA1_F0o, b, c, d, e, a, w3_t);
|
||||
|
||||
#undef K
|
||||
#define K SHA1C01
|
||||
|
||||
w4_t = rotl32 ((w1_t ^ wc_t ^ w6_t ^ w4_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w4_t);
|
||||
w5_t = rotl32 ((w2_t ^ wd_t ^ w7_t ^ w5_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, w5_t);
|
||||
w6_t = rotl32 ((w3_t ^ we_t ^ w8_t ^ w6_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w6_t);
|
||||
w7_t = rotl32 ((w4_t ^ wf_t ^ w9_t ^ w7_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w7_t);
|
||||
w8_t = rotl32 ((w5_t ^ w0_t ^ wa_t ^ w8_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w8_t);
|
||||
w9_t = rotl32 ((w6_t ^ w1_t ^ wb_t ^ w9_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w9_t);
|
||||
wa_t = rotl32 ((w7_t ^ w2_t ^ wc_t ^ wa_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, wa_t);
|
||||
wb_t = rotl32 ((w8_t ^ w3_t ^ wd_t ^ wb_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, wb_t);
|
||||
wc_t = rotl32 ((w9_t ^ w4_t ^ we_t ^ wc_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, wc_t);
|
||||
wd_t = rotl32 ((wa_t ^ w5_t ^ wf_t ^ wd_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, wd_t);
|
||||
we_t = rotl32 ((wb_t ^ w6_t ^ w0_t ^ we_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, we_t);
|
||||
wf_t = rotl32 ((wc_t ^ w7_t ^ w1_t ^ wf_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, wf_t);
|
||||
w0_t = rotl32 ((wd_t ^ w8_t ^ w2_t ^ w0_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w0_t);
|
||||
w1_t = rotl32 ((we_t ^ w9_t ^ w3_t ^ w1_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w1_t);
|
||||
w2_t = rotl32 ((wf_t ^ wa_t ^ w4_t ^ w2_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w2_t);
|
||||
w3_t = rotl32 ((w0_t ^ wb_t ^ w5_t ^ w3_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w3_t);
|
||||
w4_t = rotl32 ((w1_t ^ wc_t ^ w6_t ^ w4_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, w4_t);
|
||||
w5_t = rotl32 ((w2_t ^ wd_t ^ w7_t ^ w5_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w5_t);
|
||||
w6_t = rotl32 ((w3_t ^ we_t ^ w8_t ^ w6_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w6_t);
|
||||
w7_t = rotl32 ((w4_t ^ wf_t ^ w9_t ^ w7_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w7_t);
|
||||
|
||||
#undef K
|
||||
#define K SHA1C02
|
||||
|
||||
w8_t = rotl32 ((w5_t ^ w0_t ^ wa_t ^ w8_t), 1u); SHA1_STEP (SHA1_F2o, a, b, c, d, e, w8_t);
|
||||
w9_t = rotl32 ((w6_t ^ w1_t ^ wb_t ^ w9_t), 1u); SHA1_STEP (SHA1_F2o, e, a, b, c, d, w9_t);
|
||||
wa_t = rotl32 ((w7_t ^ w2_t ^ wc_t ^ wa_t), 1u); SHA1_STEP (SHA1_F2o, d, e, a, b, c, wa_t);
|
||||
wb_t = rotl32 ((w8_t ^ w3_t ^ wd_t ^ wb_t), 1u); SHA1_STEP (SHA1_F2o, c, d, e, a, b, wb_t);
|
||||
wc_t = rotl32 ((w9_t ^ w4_t ^ we_t ^ wc_t), 1u); SHA1_STEP (SHA1_F2o, b, c, d, e, a, wc_t);
|
||||
wd_t = rotl32 ((wa_t ^ w5_t ^ wf_t ^ wd_t), 1u); SHA1_STEP (SHA1_F2o, a, b, c, d, e, wd_t);
|
||||
we_t = rotl32 ((wb_t ^ w6_t ^ w0_t ^ we_t), 1u); SHA1_STEP (SHA1_F2o, e, a, b, c, d, we_t);
|
||||
wf_t = rotl32 ((wc_t ^ w7_t ^ w1_t ^ wf_t), 1u); SHA1_STEP (SHA1_F2o, d, e, a, b, c, wf_t);
|
||||
w0_t = rotl32 ((wd_t ^ w8_t ^ w2_t ^ w0_t), 1u); SHA1_STEP (SHA1_F2o, c, d, e, a, b, w0_t);
|
||||
w1_t = rotl32 ((we_t ^ w9_t ^ w3_t ^ w1_t), 1u); SHA1_STEP (SHA1_F2o, b, c, d, e, a, w1_t);
|
||||
w2_t = rotl32 ((wf_t ^ wa_t ^ w4_t ^ w2_t), 1u); SHA1_STEP (SHA1_F2o, a, b, c, d, e, w2_t);
|
||||
w3_t = rotl32 ((w0_t ^ wb_t ^ w5_t ^ w3_t), 1u); SHA1_STEP (SHA1_F2o, e, a, b, c, d, w3_t);
|
||||
w4_t = rotl32 ((w1_t ^ wc_t ^ w6_t ^ w4_t), 1u); SHA1_STEP (SHA1_F2o, d, e, a, b, c, w4_t);
|
||||
w5_t = rotl32 ((w2_t ^ wd_t ^ w7_t ^ w5_t), 1u); SHA1_STEP (SHA1_F2o, c, d, e, a, b, w5_t);
|
||||
w6_t = rotl32 ((w3_t ^ we_t ^ w8_t ^ w6_t), 1u); SHA1_STEP (SHA1_F2o, b, c, d, e, a, w6_t);
|
||||
w7_t = rotl32 ((w4_t ^ wf_t ^ w9_t ^ w7_t), 1u); SHA1_STEP (SHA1_F2o, a, b, c, d, e, w7_t);
|
||||
w8_t = rotl32 ((w5_t ^ w0_t ^ wa_t ^ w8_t), 1u); SHA1_STEP (SHA1_F2o, e, a, b, c, d, w8_t);
|
||||
w9_t = rotl32 ((w6_t ^ w1_t ^ wb_t ^ w9_t), 1u); SHA1_STEP (SHA1_F2o, d, e, a, b, c, w9_t);
|
||||
wa_t = rotl32 ((w7_t ^ w2_t ^ wc_t ^ wa_t), 1u); SHA1_STEP (SHA1_F2o, c, d, e, a, b, wa_t);
|
||||
wb_t = rotl32 ((w8_t ^ w3_t ^ wd_t ^ wb_t), 1u); SHA1_STEP (SHA1_F2o, b, c, d, e, a, wb_t);
|
||||
|
||||
#undef K
|
||||
#define K SHA1C03
|
||||
|
||||
wc_t = rotl32 ((w9_t ^ w4_t ^ we_t ^ wc_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, wc_t);
|
||||
wd_t = rotl32 ((wa_t ^ w5_t ^ wf_t ^ wd_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, wd_t);
|
||||
we_t = rotl32 ((wb_t ^ w6_t ^ w0_t ^ we_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, we_t);
|
||||
wf_t = rotl32 ((wc_t ^ w7_t ^ w1_t ^ wf_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, wf_t);
|
||||
w0_t = rotl32 ((wd_t ^ w8_t ^ w2_t ^ w0_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w0_t);
|
||||
w1_t = rotl32 ((we_t ^ w9_t ^ w3_t ^ w1_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w1_t);
|
||||
w2_t = rotl32 ((wf_t ^ wa_t ^ w4_t ^ w2_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, w2_t);
|
||||
w3_t = rotl32 ((w0_t ^ wb_t ^ w5_t ^ w3_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w3_t);
|
||||
w4_t = rotl32 ((w1_t ^ wc_t ^ w6_t ^ w4_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w4_t);
|
||||
w5_t = rotl32 ((w2_t ^ wd_t ^ w7_t ^ w5_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w5_t);
|
||||
w6_t = rotl32 ((w3_t ^ we_t ^ w8_t ^ w6_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w6_t);
|
||||
w7_t = rotl32 ((w4_t ^ wf_t ^ w9_t ^ w7_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, w7_t);
|
||||
w8_t = rotl32 ((w5_t ^ w0_t ^ wa_t ^ w8_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w8_t);
|
||||
w9_t = rotl32 ((w6_t ^ w1_t ^ wb_t ^ w9_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w9_t);
|
||||
wa_t = rotl32 ((w7_t ^ w2_t ^ wc_t ^ wa_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, wa_t);
|
||||
wb_t = rotl32 ((w8_t ^ w3_t ^ wd_t ^ wb_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, wb_t);
|
||||
wc_t = rotl32 ((w9_t ^ w4_t ^ we_t ^ wc_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, wc_t);
|
||||
wd_t = rotl32 ((wa_t ^ w5_t ^ wf_t ^ wd_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, wd_t);
|
||||
we_t = rotl32 ((wb_t ^ w6_t ^ w0_t ^ we_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, we_t);
|
||||
wf_t = rotl32 ((wc_t ^ w7_t ^ w1_t ^ wf_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, wf_t);
|
||||
|
||||
COMPARE_M_SIMD (d, e, c, b);
|
||||
}
|
||||
}
|
||||
|
||||
__kernel void m00134_m08 (__global pw_t *pws, __global kernel_rule_t *rules_buf, __global comb_t *combs_buf, __global bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global u32 *bitmaps_buf_s1_a, __global u32 *bitmaps_buf_s1_b, __global u32 *bitmaps_buf_s1_c, __global u32 *bitmaps_buf_s1_d, __global u32 *bitmaps_buf_s2_a, __global u32 *bitmaps_buf_s2_b, __global u32 *bitmaps_buf_s2_c, __global u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global digest_t *digests_buf, __global u32 *hashes_shown, __global salt_t *salt_bufs, __global void *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
|
||||
{
|
||||
}
|
||||
|
||||
__kernel void m00134_m16 (__global pw_t *pws, __global kernel_rule_t *rules_buf, __global comb_t *combs_buf, __global bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global u32 *bitmaps_buf_s1_a, __global u32 *bitmaps_buf_s1_b, __global u32 *bitmaps_buf_s1_c, __global u32 *bitmaps_buf_s1_d, __global u32 *bitmaps_buf_s2_a, __global u32 *bitmaps_buf_s2_b, __global u32 *bitmaps_buf_s2_c, __global u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global digest_t *digests_buf, __global u32 *hashes_shown, __global salt_t *salt_bufs, __global void *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
|
||||
{
|
||||
}
|
||||
|
||||
__kernel void m00134_s04 (__global pw_t *pws, __global kernel_rule_t *rules_buf, __global comb_t *combs_buf, __global bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global u32 *bitmaps_buf_s1_a, __global u32 *bitmaps_buf_s1_b, __global u32 *bitmaps_buf_s1_c, __global u32 *bitmaps_buf_s1_d, __global u32 *bitmaps_buf_s2_a, __global u32 *bitmaps_buf_s2_b, __global u32 *bitmaps_buf_s2_c, __global u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global digest_t *digests_buf, __global u32 *hashes_shown, __global salt_t *salt_bufs, __global void *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
|
||||
{
|
||||
/**
|
||||
* modifier
|
||||
*/
|
||||
|
||||
const u32 lid = get_local_id (0);
|
||||
|
||||
/**
|
||||
* base
|
||||
*/
|
||||
|
||||
const u32 gid = get_global_id (0);
|
||||
|
||||
if (gid >= gid_max) return;
|
||||
|
||||
u32 pw_buf0[4];
|
||||
u32 pw_buf1[4];
|
||||
|
||||
pw_buf0[0] = pws[gid].i[0];
|
||||
pw_buf0[1] = pws[gid].i[1];
|
||||
pw_buf0[2] = pws[gid].i[2];
|
||||
pw_buf0[3] = pws[gid].i[3];
|
||||
pw_buf1[0] = pws[gid].i[4];
|
||||
pw_buf1[1] = pws[gid].i[5];
|
||||
pw_buf1[2] = pws[gid].i[6];
|
||||
pw_buf1[3] = pws[gid].i[7];
|
||||
|
||||
const u32 pw_len = pws[gid].pw_len;
|
||||
|
||||
/**
|
||||
* salt
|
||||
*/
|
||||
|
||||
u32 salt_buf0[4];
|
||||
u32 salt_buf1[4];
|
||||
u32 salt_buf2[4];
|
||||
u32 salt_buf3[4];
|
||||
|
||||
salt_buf0[0] = salt_bufs[salt_pos].salt_buf[ 0];
|
||||
salt_buf0[1] = salt_bufs[salt_pos].salt_buf[ 1];
|
||||
salt_buf0[2] = salt_bufs[salt_pos].salt_buf[ 2];
|
||||
salt_buf0[3] = salt_bufs[salt_pos].salt_buf[ 3];
|
||||
salt_buf1[0] = salt_bufs[salt_pos].salt_buf[ 4];
|
||||
salt_buf1[1] = salt_bufs[salt_pos].salt_buf[ 5];
|
||||
salt_buf1[2] = salt_bufs[salt_pos].salt_buf[ 6];
|
||||
salt_buf1[3] = salt_bufs[salt_pos].salt_buf[ 7];
|
||||
salt_buf2[0] = salt_bufs[salt_pos].salt_buf[ 8];
|
||||
salt_buf2[1] = salt_bufs[salt_pos].salt_buf[ 9];
|
||||
salt_buf2[2] = salt_bufs[salt_pos].salt_buf[10];
|
||||
salt_buf2[3] = salt_bufs[salt_pos].salt_buf[11];
|
||||
salt_buf3[0] = salt_bufs[salt_pos].salt_buf[12];
|
||||
salt_buf3[1] = salt_bufs[salt_pos].salt_buf[13];
|
||||
salt_buf3[2] = salt_bufs[salt_pos].salt_buf[14];
|
||||
salt_buf3[3] = salt_bufs[salt_pos].salt_buf[15];
|
||||
|
||||
const u32 salt_len = salt_bufs[salt_pos].salt_len;
|
||||
|
||||
/**
|
||||
* 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]
|
||||
};
|
||||
|
||||
/**
|
||||
* reverse
|
||||
*/
|
||||
|
||||
const u32 e_rev = rotl32_S (search[1], 2u);
|
||||
|
||||
/**
|
||||
* loop
|
||||
*/
|
||||
|
||||
for (u32 il_pos = 0; il_pos < il_cnt; il_pos += VECT_SIZE)
|
||||
{
|
||||
u32x w0[4] = { 0 };
|
||||
u32x w1[4] = { 0 };
|
||||
u32x w2[4] = { 0 };
|
||||
u32x w3[4] = { 0 };
|
||||
|
||||
const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1);
|
||||
|
||||
make_unicode (w1, w2, w3);
|
||||
make_unicode (w0, w0, w1);
|
||||
|
||||
const u32x out_len2 = out_len * 2;
|
||||
|
||||
/**
|
||||
* prepend salt
|
||||
*/
|
||||
|
||||
const u32x out_salt_len = out_len2 + salt_len;
|
||||
|
||||
switch_buffer_by_offset_le_VV (w0, w1, w2, w3, salt_len);
|
||||
|
||||
w0[0] |= salt_buf0[0];
|
||||
w0[1] |= salt_buf0[1];
|
||||
w0[2] |= salt_buf0[2];
|
||||
w0[3] |= salt_buf0[3];
|
||||
w1[0] |= salt_buf1[0];
|
||||
w1[1] |= salt_buf1[1];
|
||||
w1[2] |= salt_buf1[2];
|
||||
w1[3] |= salt_buf1[3];
|
||||
w2[0] |= salt_buf2[0];
|
||||
w2[1] |= salt_buf2[1];
|
||||
w2[2] |= salt_buf2[2];
|
||||
w2[3] |= salt_buf2[3];
|
||||
w3[0] |= salt_buf3[0];
|
||||
w3[1] |= salt_buf3[1];
|
||||
w3[2] |= salt_buf3[2];
|
||||
w3[3] |= salt_buf3[3];
|
||||
|
||||
append_0x80_4x4_VV (w0, w1, w2, w3, out_salt_len);
|
||||
|
||||
/**
|
||||
* sha1
|
||||
*/
|
||||
|
||||
u32x w0_t = swap32 (w0[0]);
|
||||
u32x w1_t = swap32 (w0[1]);
|
||||
u32x w2_t = swap32 (w0[2]);
|
||||
u32x w3_t = swap32 (w0[3]);
|
||||
u32x w4_t = swap32 (w1[0]);
|
||||
u32x w5_t = swap32 (w1[1]);
|
||||
u32x w6_t = swap32 (w1[2]);
|
||||
u32x w7_t = swap32 (w1[3]);
|
||||
u32x w8_t = swap32 (w2[0]);
|
||||
u32x w9_t = swap32 (w2[1]);
|
||||
u32x wa_t = swap32 (w2[2]);
|
||||
u32x wb_t = swap32 (w2[3]);
|
||||
u32x wc_t = swap32 (w3[0]);
|
||||
u32x wd_t = swap32 (w3[1]);
|
||||
u32x we_t = 0;
|
||||
u32x wf_t = out_salt_len * 8;
|
||||
|
||||
u32x a = SHA1M_A;
|
||||
u32x b = SHA1M_B;
|
||||
u32x c = SHA1M_C;
|
||||
u32x d = SHA1M_D;
|
||||
u32x e = SHA1M_E;
|
||||
|
||||
#undef K
|
||||
#define K SHA1C00
|
||||
|
||||
SHA1_STEP (SHA1_F0o, a, b, c, d, e, w0_t);
|
||||
SHA1_STEP (SHA1_F0o, e, a, b, c, d, w1_t);
|
||||
SHA1_STEP (SHA1_F0o, d, e, a, b, c, w2_t);
|
||||
SHA1_STEP (SHA1_F0o, c, d, e, a, b, w3_t);
|
||||
SHA1_STEP (SHA1_F0o, b, c, d, e, a, w4_t);
|
||||
SHA1_STEP (SHA1_F0o, a, b, c, d, e, w5_t);
|
||||
SHA1_STEP (SHA1_F0o, e, a, b, c, d, w6_t);
|
||||
SHA1_STEP (SHA1_F0o, d, e, a, b, c, w7_t);
|
||||
SHA1_STEP (SHA1_F0o, c, d, e, a, b, w8_t);
|
||||
SHA1_STEP (SHA1_F0o, b, c, d, e, a, w9_t);
|
||||
SHA1_STEP (SHA1_F0o, a, b, c, d, e, wa_t);
|
||||
SHA1_STEP (SHA1_F0o, e, a, b, c, d, wb_t);
|
||||
SHA1_STEP (SHA1_F0o, d, e, a, b, c, wc_t);
|
||||
SHA1_STEP (SHA1_F0o, c, d, e, a, b, wd_t);
|
||||
SHA1_STEP (SHA1_F0o, b, c, d, e, a, we_t);
|
||||
SHA1_STEP (SHA1_F0o, a, b, c, d, e, wf_t);
|
||||
w0_t = rotl32 ((wd_t ^ w8_t ^ w2_t ^ w0_t), 1u); SHA1_STEP (SHA1_F0o, e, a, b, c, d, w0_t);
|
||||
w1_t = rotl32 ((we_t ^ w9_t ^ w3_t ^ w1_t), 1u); SHA1_STEP (SHA1_F0o, d, e, a, b, c, w1_t);
|
||||
w2_t = rotl32 ((wf_t ^ wa_t ^ w4_t ^ w2_t), 1u); SHA1_STEP (SHA1_F0o, c, d, e, a, b, w2_t);
|
||||
w3_t = rotl32 ((w0_t ^ wb_t ^ w5_t ^ w3_t), 1u); SHA1_STEP (SHA1_F0o, b, c, d, e, a, w3_t);
|
||||
|
||||
#undef K
|
||||
#define K SHA1C01
|
||||
|
||||
w4_t = rotl32 ((w1_t ^ wc_t ^ w6_t ^ w4_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w4_t);
|
||||
w5_t = rotl32 ((w2_t ^ wd_t ^ w7_t ^ w5_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, w5_t);
|
||||
w6_t = rotl32 ((w3_t ^ we_t ^ w8_t ^ w6_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w6_t);
|
||||
w7_t = rotl32 ((w4_t ^ wf_t ^ w9_t ^ w7_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w7_t);
|
||||
w8_t = rotl32 ((w5_t ^ w0_t ^ wa_t ^ w8_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w8_t);
|
||||
w9_t = rotl32 ((w6_t ^ w1_t ^ wb_t ^ w9_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w9_t);
|
||||
wa_t = rotl32 ((w7_t ^ w2_t ^ wc_t ^ wa_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, wa_t);
|
||||
wb_t = rotl32 ((w8_t ^ w3_t ^ wd_t ^ wb_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, wb_t);
|
||||
wc_t = rotl32 ((w9_t ^ w4_t ^ we_t ^ wc_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, wc_t);
|
||||
wd_t = rotl32 ((wa_t ^ w5_t ^ wf_t ^ wd_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, wd_t);
|
||||
we_t = rotl32 ((wb_t ^ w6_t ^ w0_t ^ we_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, we_t);
|
||||
wf_t = rotl32 ((wc_t ^ w7_t ^ w1_t ^ wf_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, wf_t);
|
||||
w0_t = rotl32 ((wd_t ^ w8_t ^ w2_t ^ w0_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w0_t);
|
||||
w1_t = rotl32 ((we_t ^ w9_t ^ w3_t ^ w1_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w1_t);
|
||||
w2_t = rotl32 ((wf_t ^ wa_t ^ w4_t ^ w2_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w2_t);
|
||||
w3_t = rotl32 ((w0_t ^ wb_t ^ w5_t ^ w3_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w3_t);
|
||||
w4_t = rotl32 ((w1_t ^ wc_t ^ w6_t ^ w4_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, w4_t);
|
||||
w5_t = rotl32 ((w2_t ^ wd_t ^ w7_t ^ w5_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w5_t);
|
||||
w6_t = rotl32 ((w3_t ^ we_t ^ w8_t ^ w6_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w6_t);
|
||||
w7_t = rotl32 ((w4_t ^ wf_t ^ w9_t ^ w7_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w7_t);
|
||||
|
||||
#undef K
|
||||
#define K SHA1C02
|
||||
|
||||
w8_t = rotl32 ((w5_t ^ w0_t ^ wa_t ^ w8_t), 1u); SHA1_STEP (SHA1_F2o, a, b, c, d, e, w8_t);
|
||||
w9_t = rotl32 ((w6_t ^ w1_t ^ wb_t ^ w9_t), 1u); SHA1_STEP (SHA1_F2o, e, a, b, c, d, w9_t);
|
||||
wa_t = rotl32 ((w7_t ^ w2_t ^ wc_t ^ wa_t), 1u); SHA1_STEP (SHA1_F2o, d, e, a, b, c, wa_t);
|
||||
wb_t = rotl32 ((w8_t ^ w3_t ^ wd_t ^ wb_t), 1u); SHA1_STEP (SHA1_F2o, c, d, e, a, b, wb_t);
|
||||
wc_t = rotl32 ((w9_t ^ w4_t ^ we_t ^ wc_t), 1u); SHA1_STEP (SHA1_F2o, b, c, d, e, a, wc_t);
|
||||
wd_t = rotl32 ((wa_t ^ w5_t ^ wf_t ^ wd_t), 1u); SHA1_STEP (SHA1_F2o, a, b, c, d, e, wd_t);
|
||||
we_t = rotl32 ((wb_t ^ w6_t ^ w0_t ^ we_t), 1u); SHA1_STEP (SHA1_F2o, e, a, b, c, d, we_t);
|
||||
wf_t = rotl32 ((wc_t ^ w7_t ^ w1_t ^ wf_t), 1u); SHA1_STEP (SHA1_F2o, d, e, a, b, c, wf_t);
|
||||
w0_t = rotl32 ((wd_t ^ w8_t ^ w2_t ^ w0_t), 1u); SHA1_STEP (SHA1_F2o, c, d, e, a, b, w0_t);
|
||||
w1_t = rotl32 ((we_t ^ w9_t ^ w3_t ^ w1_t), 1u); SHA1_STEP (SHA1_F2o, b, c, d, e, a, w1_t);
|
||||
w2_t = rotl32 ((wf_t ^ wa_t ^ w4_t ^ w2_t), 1u); SHA1_STEP (SHA1_F2o, a, b, c, d, e, w2_t);
|
||||
w3_t = rotl32 ((w0_t ^ wb_t ^ w5_t ^ w3_t), 1u); SHA1_STEP (SHA1_F2o, e, a, b, c, d, w3_t);
|
||||
w4_t = rotl32 ((w1_t ^ wc_t ^ w6_t ^ w4_t), 1u); SHA1_STEP (SHA1_F2o, d, e, a, b, c, w4_t);
|
||||
w5_t = rotl32 ((w2_t ^ wd_t ^ w7_t ^ w5_t), 1u); SHA1_STEP (SHA1_F2o, c, d, e, a, b, w5_t);
|
||||
w6_t = rotl32 ((w3_t ^ we_t ^ w8_t ^ w6_t), 1u); SHA1_STEP (SHA1_F2o, b, c, d, e, a, w6_t);
|
||||
w7_t = rotl32 ((w4_t ^ wf_t ^ w9_t ^ w7_t), 1u); SHA1_STEP (SHA1_F2o, a, b, c, d, e, w7_t);
|
||||
w8_t = rotl32 ((w5_t ^ w0_t ^ wa_t ^ w8_t), 1u); SHA1_STEP (SHA1_F2o, e, a, b, c, d, w8_t);
|
||||
w9_t = rotl32 ((w6_t ^ w1_t ^ wb_t ^ w9_t), 1u); SHA1_STEP (SHA1_F2o, d, e, a, b, c, w9_t);
|
||||
wa_t = rotl32 ((w7_t ^ w2_t ^ wc_t ^ wa_t), 1u); SHA1_STEP (SHA1_F2o, c, d, e, a, b, wa_t);
|
||||
wb_t = rotl32 ((w8_t ^ w3_t ^ wd_t ^ wb_t), 1u); SHA1_STEP (SHA1_F2o, b, c, d, e, a, wb_t);
|
||||
|
||||
#undef K
|
||||
#define K SHA1C03
|
||||
|
||||
wc_t = rotl32 ((w9_t ^ w4_t ^ we_t ^ wc_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, wc_t);
|
||||
wd_t = rotl32 ((wa_t ^ w5_t ^ wf_t ^ wd_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, wd_t);
|
||||
we_t = rotl32 ((wb_t ^ w6_t ^ w0_t ^ we_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, we_t);
|
||||
wf_t = rotl32 ((wc_t ^ w7_t ^ w1_t ^ wf_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, wf_t);
|
||||
w0_t = rotl32 ((wd_t ^ w8_t ^ w2_t ^ w0_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w0_t);
|
||||
w1_t = rotl32 ((we_t ^ w9_t ^ w3_t ^ w1_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w1_t);
|
||||
w2_t = rotl32 ((wf_t ^ wa_t ^ w4_t ^ w2_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, w2_t);
|
||||
w3_t = rotl32 ((w0_t ^ wb_t ^ w5_t ^ w3_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w3_t);
|
||||
w4_t = rotl32 ((w1_t ^ wc_t ^ w6_t ^ w4_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w4_t);
|
||||
w5_t = rotl32 ((w2_t ^ wd_t ^ w7_t ^ w5_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w5_t);
|
||||
w6_t = rotl32 ((w3_t ^ we_t ^ w8_t ^ w6_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w6_t);
|
||||
w7_t = rotl32 ((w4_t ^ wf_t ^ w9_t ^ w7_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, w7_t);
|
||||
w8_t = rotl32 ((w5_t ^ w0_t ^ wa_t ^ w8_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w8_t);
|
||||
w9_t = rotl32 ((w6_t ^ w1_t ^ wb_t ^ w9_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w9_t);
|
||||
wa_t = rotl32 ((w7_t ^ w2_t ^ wc_t ^ wa_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, wa_t);
|
||||
wb_t = rotl32 ((w8_t ^ w3_t ^ wd_t ^ wb_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, wb_t);
|
||||
|
||||
if (MATCHES_NONE_VS (e, e_rev)) continue;
|
||||
|
||||
wc_t = rotl32 ((w9_t ^ w4_t ^ we_t ^ wc_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, wc_t);
|
||||
wd_t = rotl32 ((wa_t ^ w5_t ^ wf_t ^ wd_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, wd_t);
|
||||
we_t = rotl32 ((wb_t ^ w6_t ^ w0_t ^ we_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, we_t);
|
||||
wf_t = rotl32 ((wc_t ^ w7_t ^ w1_t ^ wf_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, wf_t);
|
||||
|
||||
COMPARE_S_SIMD (d, e, c, b);
|
||||
}
|
||||
}
|
||||
|
||||
__kernel void m00134_s08 (__global pw_t *pws, __global kernel_rule_t *rules_buf, __global comb_t *combs_buf, __global bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global u32 *bitmaps_buf_s1_a, __global u32 *bitmaps_buf_s1_b, __global u32 *bitmaps_buf_s1_c, __global u32 *bitmaps_buf_s1_d, __global u32 *bitmaps_buf_s2_a, __global u32 *bitmaps_buf_s2_b, __global u32 *bitmaps_buf_s2_c, __global u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global digest_t *digests_buf, __global u32 *hashes_shown, __global salt_t *salt_bufs, __global void *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
|
||||
{
|
||||
}
|
||||
|
||||
__kernel void m00134_s16 (__global pw_t *pws, __global kernel_rule_t *rules_buf, __global comb_t *combs_buf, __global bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global u32 *bitmaps_buf_s1_a, __global u32 *bitmaps_buf_s1_b, __global u32 *bitmaps_buf_s1_c, __global u32 *bitmaps_buf_s1_d, __global u32 *bitmaps_buf_s2_a, __global u32 *bitmaps_buf_s2_b, __global u32 *bitmaps_buf_s2_c, __global u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global digest_t *digests_buf, __global u32 *hashes_shown, __global salt_t *salt_bufs, __global void *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
|
||||
{
|
||||
}
|
636
OpenCL/m00134_a1.cl
Normal file
636
OpenCL/m00134_a1.cl
Normal file
@ -0,0 +1,636 @@
|
||||
/**
|
||||
* Author......: Jens Steube <jens.steube@gmail.com>
|
||||
* License.....: MIT
|
||||
*/
|
||||
|
||||
#define _SHA1_
|
||||
|
||||
#define NEW_SIMD_CODE
|
||||
|
||||
#include "include/constants.h"
|
||||
#include "include/kernel_vendor.h"
|
||||
|
||||
#define DGST_R0 3
|
||||
#define DGST_R1 4
|
||||
#define DGST_R2 2
|
||||
#define DGST_R3 1
|
||||
|
||||
#include "include/kernel_functions.c"
|
||||
#include "OpenCL/types_ocl.c"
|
||||
#include "OpenCL/common.c"
|
||||
#include "OpenCL/simd.c"
|
||||
|
||||
// no unicode yet
|
||||
|
||||
__kernel void m00134_m04 (__global pw_t *pws, __global kernel_rule_t *rules_buf, __global comb_t *combs_buf, __global bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global u32 *bitmaps_buf_s1_a, __global u32 *bitmaps_buf_s1_b, __global u32 *bitmaps_buf_s1_c, __global u32 *bitmaps_buf_s1_d, __global u32 *bitmaps_buf_s2_a, __global u32 *bitmaps_buf_s2_b, __global u32 *bitmaps_buf_s2_c, __global u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global digest_t *digests_buf, __global u32 *hashes_shown, __global salt_t *salt_bufs, __global void *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
|
||||
{
|
||||
/**
|
||||
* modifier
|
||||
*/
|
||||
|
||||
const u32 lid = get_local_id (0);
|
||||
|
||||
/**
|
||||
* base
|
||||
*/
|
||||
|
||||
const u32 gid = get_global_id (0);
|
||||
|
||||
if (gid >= gid_max) return;
|
||||
|
||||
u32 pw_buf0[4];
|
||||
u32 pw_buf1[4];
|
||||
|
||||
pw_buf0[0] = pws[gid].i[0];
|
||||
pw_buf0[1] = pws[gid].i[1];
|
||||
pw_buf0[2] = pws[gid].i[2];
|
||||
pw_buf0[3] = pws[gid].i[3];
|
||||
pw_buf1[0] = pws[gid].i[4];
|
||||
pw_buf1[1] = pws[gid].i[5];
|
||||
pw_buf1[2] = pws[gid].i[6];
|
||||
pw_buf1[3] = pws[gid].i[7];
|
||||
|
||||
const u32 pw_l_len = pws[gid].pw_len;
|
||||
|
||||
/**
|
||||
* salt
|
||||
*/
|
||||
|
||||
u32 salt_buf0[4];
|
||||
u32 salt_buf1[4];
|
||||
u32 salt_buf2[4];
|
||||
u32 salt_buf3[4];
|
||||
|
||||
salt_buf0[0] = salt_bufs[salt_pos].salt_buf[ 0];
|
||||
salt_buf0[1] = salt_bufs[salt_pos].salt_buf[ 1];
|
||||
salt_buf0[2] = salt_bufs[salt_pos].salt_buf[ 2];
|
||||
salt_buf0[3] = salt_bufs[salt_pos].salt_buf[ 3];
|
||||
salt_buf1[0] = salt_bufs[salt_pos].salt_buf[ 4];
|
||||
salt_buf1[1] = salt_bufs[salt_pos].salt_buf[ 5];
|
||||
salt_buf1[2] = salt_bufs[salt_pos].salt_buf[ 6];
|
||||
salt_buf1[3] = salt_bufs[salt_pos].salt_buf[ 7];
|
||||
salt_buf2[0] = salt_bufs[salt_pos].salt_buf[ 8];
|
||||
salt_buf2[1] = salt_bufs[salt_pos].salt_buf[ 9];
|
||||
salt_buf2[2] = salt_bufs[salt_pos].salt_buf[10];
|
||||
salt_buf2[3] = salt_bufs[salt_pos].salt_buf[11];
|
||||
salt_buf3[0] = salt_bufs[salt_pos].salt_buf[12];
|
||||
salt_buf3[1] = salt_bufs[salt_pos].salt_buf[13];
|
||||
salt_buf3[2] = salt_bufs[salt_pos].salt_buf[14];
|
||||
salt_buf3[3] = salt_bufs[salt_pos].salt_buf[15];
|
||||
|
||||
const u32 salt_len = salt_bufs[salt_pos].salt_len;
|
||||
|
||||
/**
|
||||
* loop
|
||||
*/
|
||||
|
||||
for (u32 il_pos = 0; il_pos < il_cnt; il_pos += VECT_SIZE)
|
||||
{
|
||||
const u32x pw_r_len = pwlenx_create_combt (combs_buf, il_pos);
|
||||
|
||||
const u32x pw_len = pw_l_len + pw_r_len;
|
||||
|
||||
/**
|
||||
* concat password candidate
|
||||
*/
|
||||
|
||||
u32x wordl0[4] = { 0 };
|
||||
u32x wordl1[4] = { 0 };
|
||||
u32x wordl2[4] = { 0 };
|
||||
u32x wordl3[4] = { 0 };
|
||||
|
||||
wordl0[0] = pw_buf0[0];
|
||||
wordl0[1] = pw_buf0[1];
|
||||
wordl0[2] = pw_buf0[2];
|
||||
wordl0[3] = pw_buf0[3];
|
||||
wordl1[0] = pw_buf1[0];
|
||||
wordl1[1] = pw_buf1[1];
|
||||
wordl1[2] = pw_buf1[2];
|
||||
wordl1[3] = pw_buf1[3];
|
||||
|
||||
u32x wordr0[4] = { 0 };
|
||||
u32x wordr1[4] = { 0 };
|
||||
u32x wordr2[4] = { 0 };
|
||||
u32x wordr3[4] = { 0 };
|
||||
|
||||
wordr0[0] = ix_create_combt (combs_buf, il_pos, 0);
|
||||
wordr0[1] = ix_create_combt (combs_buf, il_pos, 1);
|
||||
wordr0[2] = ix_create_combt (combs_buf, il_pos, 2);
|
||||
wordr0[3] = ix_create_combt (combs_buf, il_pos, 3);
|
||||
wordr1[0] = ix_create_combt (combs_buf, il_pos, 4);
|
||||
wordr1[1] = ix_create_combt (combs_buf, il_pos, 5);
|
||||
wordr1[2] = ix_create_combt (combs_buf, il_pos, 6);
|
||||
wordr1[3] = ix_create_combt (combs_buf, il_pos, 7);
|
||||
|
||||
if (combs_mode == COMBINATOR_MODE_BASE_LEFT)
|
||||
{
|
||||
switch_buffer_by_offset_le_VV (wordr0, wordr1, wordr2, wordr3, pw_l_len);
|
||||
}
|
||||
else
|
||||
{
|
||||
switch_buffer_by_offset_le_VV (wordl0, wordl1, wordl2, wordl3, pw_r_len);
|
||||
}
|
||||
|
||||
u32x w0[4];
|
||||
u32x w1[4];
|
||||
u32x w2[4];
|
||||
u32x w3[4];
|
||||
|
||||
w0[0] = wordl0[0] | wordr0[0];
|
||||
w0[1] = wordl0[1] | wordr0[1];
|
||||
w0[2] = wordl0[2] | wordr0[2];
|
||||
w0[3] = wordl0[3] | wordr0[3];
|
||||
w1[0] = wordl1[0] | wordr1[0];
|
||||
w1[1] = wordl1[1] | wordr1[1];
|
||||
w1[2] = wordl1[2] | wordr1[2];
|
||||
w1[3] = wordl1[3] | wordr1[3];
|
||||
w2[0] = wordl2[0] | wordr2[0];
|
||||
w2[1] = wordl2[1] | wordr2[1];
|
||||
w2[2] = wordl2[2] | wordr2[2];
|
||||
w2[3] = wordl2[3] | wordr2[3];
|
||||
w3[0] = wordl3[0] | wordr3[0];
|
||||
w3[1] = wordl3[1] | wordr3[1];
|
||||
w3[2] = wordl3[2] | wordr3[2];
|
||||
w3[3] = wordl3[3] | wordr3[3];
|
||||
|
||||
make_unicode (w1, w2, w3);
|
||||
make_unicode (w0, w0, w1);
|
||||
|
||||
const u32x pw_len2 = pw_len * 2;
|
||||
|
||||
/**
|
||||
* prepend salt
|
||||
*/
|
||||
|
||||
switch_buffer_by_offset_le (w0, w1, w2, w3, salt_len);
|
||||
|
||||
const u32x pw_salt_len = pw_len2 + salt_len;
|
||||
|
||||
w0[0] |= salt_buf0[0];
|
||||
w0[1] |= salt_buf0[1];
|
||||
w0[2] |= salt_buf0[2];
|
||||
w0[3] |= salt_buf0[3];
|
||||
w1[0] |= salt_buf1[0];
|
||||
w1[1] |= salt_buf1[1];
|
||||
w1[2] |= salt_buf1[2];
|
||||
w1[3] |= salt_buf1[3];
|
||||
w2[0] |= salt_buf2[0];
|
||||
w2[1] |= salt_buf2[1];
|
||||
w2[2] |= salt_buf2[2];
|
||||
w2[3] |= salt_buf2[3];
|
||||
w3[0] |= salt_buf3[0];
|
||||
w3[1] |= salt_buf3[1];
|
||||
w3[2] |= salt_buf3[2];
|
||||
w3[3] |= salt_buf3[3];
|
||||
|
||||
/**
|
||||
* sha1
|
||||
*/
|
||||
|
||||
u32x w0_t = swap32 (w0[0]);
|
||||
u32x w1_t = swap32 (w0[1]);
|
||||
u32x w2_t = swap32 (w0[2]);
|
||||
u32x w3_t = swap32 (w0[3]);
|
||||
u32x w4_t = swap32 (w1[0]);
|
||||
u32x w5_t = swap32 (w1[1]);
|
||||
u32x w6_t = swap32 (w1[2]);
|
||||
u32x w7_t = swap32 (w1[3]);
|
||||
u32x w8_t = swap32 (w2[0]);
|
||||
u32x w9_t = swap32 (w2[1]);
|
||||
u32x wa_t = swap32 (w2[2]);
|
||||
u32x wb_t = swap32 (w2[3]);
|
||||
u32x wc_t = swap32 (w3[0]);
|
||||
u32x wd_t = swap32 (w3[1]);
|
||||
u32x we_t = 0;
|
||||
u32x wf_t = pw_salt_len * 8;
|
||||
|
||||
u32x a = SHA1M_A;
|
||||
u32x b = SHA1M_B;
|
||||
u32x c = SHA1M_C;
|
||||
u32x d = SHA1M_D;
|
||||
u32x e = SHA1M_E;
|
||||
|
||||
#undef K
|
||||
#define K SHA1C00
|
||||
|
||||
SHA1_STEP (SHA1_F0o, a, b, c, d, e, w0_t);
|
||||
SHA1_STEP (SHA1_F0o, e, a, b, c, d, w1_t);
|
||||
SHA1_STEP (SHA1_F0o, d, e, a, b, c, w2_t);
|
||||
SHA1_STEP (SHA1_F0o, c, d, e, a, b, w3_t);
|
||||
SHA1_STEP (SHA1_F0o, b, c, d, e, a, w4_t);
|
||||
SHA1_STEP (SHA1_F0o, a, b, c, d, e, w5_t);
|
||||
SHA1_STEP (SHA1_F0o, e, a, b, c, d, w6_t);
|
||||
SHA1_STEP (SHA1_F0o, d, e, a, b, c, w7_t);
|
||||
SHA1_STEP (SHA1_F0o, c, d, e, a, b, w8_t);
|
||||
SHA1_STEP (SHA1_F0o, b, c, d, e, a, w9_t);
|
||||
SHA1_STEP (SHA1_F0o, a, b, c, d, e, wa_t);
|
||||
SHA1_STEP (SHA1_F0o, e, a, b, c, d, wb_t);
|
||||
SHA1_STEP (SHA1_F0o, d, e, a, b, c, wc_t);
|
||||
SHA1_STEP (SHA1_F0o, c, d, e, a, b, wd_t);
|
||||
SHA1_STEP (SHA1_F0o, b, c, d, e, a, we_t);
|
||||
SHA1_STEP (SHA1_F0o, a, b, c, d, e, wf_t);
|
||||
w0_t = rotl32 ((wd_t ^ w8_t ^ w2_t ^ w0_t), 1u); SHA1_STEP (SHA1_F0o, e, a, b, c, d, w0_t);
|
||||
w1_t = rotl32 ((we_t ^ w9_t ^ w3_t ^ w1_t), 1u); SHA1_STEP (SHA1_F0o, d, e, a, b, c, w1_t);
|
||||
w2_t = rotl32 ((wf_t ^ wa_t ^ w4_t ^ w2_t), 1u); SHA1_STEP (SHA1_F0o, c, d, e, a, b, w2_t);
|
||||
w3_t = rotl32 ((w0_t ^ wb_t ^ w5_t ^ w3_t), 1u); SHA1_STEP (SHA1_F0o, b, c, d, e, a, w3_t);
|
||||
|
||||
#undef K
|
||||
#define K SHA1C01
|
||||
|
||||
w4_t = rotl32 ((w1_t ^ wc_t ^ w6_t ^ w4_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w4_t);
|
||||
w5_t = rotl32 ((w2_t ^ wd_t ^ w7_t ^ w5_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, w5_t);
|
||||
w6_t = rotl32 ((w3_t ^ we_t ^ w8_t ^ w6_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w6_t);
|
||||
w7_t = rotl32 ((w4_t ^ wf_t ^ w9_t ^ w7_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w7_t);
|
||||
w8_t = rotl32 ((w5_t ^ w0_t ^ wa_t ^ w8_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w8_t);
|
||||
w9_t = rotl32 ((w6_t ^ w1_t ^ wb_t ^ w9_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w9_t);
|
||||
wa_t = rotl32 ((w7_t ^ w2_t ^ wc_t ^ wa_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, wa_t);
|
||||
wb_t = rotl32 ((w8_t ^ w3_t ^ wd_t ^ wb_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, wb_t);
|
||||
wc_t = rotl32 ((w9_t ^ w4_t ^ we_t ^ wc_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, wc_t);
|
||||
wd_t = rotl32 ((wa_t ^ w5_t ^ wf_t ^ wd_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, wd_t);
|
||||
we_t = rotl32 ((wb_t ^ w6_t ^ w0_t ^ we_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, we_t);
|
||||
wf_t = rotl32 ((wc_t ^ w7_t ^ w1_t ^ wf_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, wf_t);
|
||||
w0_t = rotl32 ((wd_t ^ w8_t ^ w2_t ^ w0_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w0_t);
|
||||
w1_t = rotl32 ((we_t ^ w9_t ^ w3_t ^ w1_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w1_t);
|
||||
w2_t = rotl32 ((wf_t ^ wa_t ^ w4_t ^ w2_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w2_t);
|
||||
w3_t = rotl32 ((w0_t ^ wb_t ^ w5_t ^ w3_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w3_t);
|
||||
w4_t = rotl32 ((w1_t ^ wc_t ^ w6_t ^ w4_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, w4_t);
|
||||
w5_t = rotl32 ((w2_t ^ wd_t ^ w7_t ^ w5_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w5_t);
|
||||
w6_t = rotl32 ((w3_t ^ we_t ^ w8_t ^ w6_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w6_t);
|
||||
w7_t = rotl32 ((w4_t ^ wf_t ^ w9_t ^ w7_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w7_t);
|
||||
|
||||
#undef K
|
||||
#define K SHA1C02
|
||||
|
||||
w8_t = rotl32 ((w5_t ^ w0_t ^ wa_t ^ w8_t), 1u); SHA1_STEP (SHA1_F2o, a, b, c, d, e, w8_t);
|
||||
w9_t = rotl32 ((w6_t ^ w1_t ^ wb_t ^ w9_t), 1u); SHA1_STEP (SHA1_F2o, e, a, b, c, d, w9_t);
|
||||
wa_t = rotl32 ((w7_t ^ w2_t ^ wc_t ^ wa_t), 1u); SHA1_STEP (SHA1_F2o, d, e, a, b, c, wa_t);
|
||||
wb_t = rotl32 ((w8_t ^ w3_t ^ wd_t ^ wb_t), 1u); SHA1_STEP (SHA1_F2o, c, d, e, a, b, wb_t);
|
||||
wc_t = rotl32 ((w9_t ^ w4_t ^ we_t ^ wc_t), 1u); SHA1_STEP (SHA1_F2o, b, c, d, e, a, wc_t);
|
||||
wd_t = rotl32 ((wa_t ^ w5_t ^ wf_t ^ wd_t), 1u); SHA1_STEP (SHA1_F2o, a, b, c, d, e, wd_t);
|
||||
we_t = rotl32 ((wb_t ^ w6_t ^ w0_t ^ we_t), 1u); SHA1_STEP (SHA1_F2o, e, a, b, c, d, we_t);
|
||||
wf_t = rotl32 ((wc_t ^ w7_t ^ w1_t ^ wf_t), 1u); SHA1_STEP (SHA1_F2o, d, e, a, b, c, wf_t);
|
||||
w0_t = rotl32 ((wd_t ^ w8_t ^ w2_t ^ w0_t), 1u); SHA1_STEP (SHA1_F2o, c, d, e, a, b, w0_t);
|
||||
w1_t = rotl32 ((we_t ^ w9_t ^ w3_t ^ w1_t), 1u); SHA1_STEP (SHA1_F2o, b, c, d, e, a, w1_t);
|
||||
w2_t = rotl32 ((wf_t ^ wa_t ^ w4_t ^ w2_t), 1u); SHA1_STEP (SHA1_F2o, a, b, c, d, e, w2_t);
|
||||
w3_t = rotl32 ((w0_t ^ wb_t ^ w5_t ^ w3_t), 1u); SHA1_STEP (SHA1_F2o, e, a, b, c, d, w3_t);
|
||||
w4_t = rotl32 ((w1_t ^ wc_t ^ w6_t ^ w4_t), 1u); SHA1_STEP (SHA1_F2o, d, e, a, b, c, w4_t);
|
||||
w5_t = rotl32 ((w2_t ^ wd_t ^ w7_t ^ w5_t), 1u); SHA1_STEP (SHA1_F2o, c, d, e, a, b, w5_t);
|
||||
w6_t = rotl32 ((w3_t ^ we_t ^ w8_t ^ w6_t), 1u); SHA1_STEP (SHA1_F2o, b, c, d, e, a, w6_t);
|
||||
w7_t = rotl32 ((w4_t ^ wf_t ^ w9_t ^ w7_t), 1u); SHA1_STEP (SHA1_F2o, a, b, c, d, e, w7_t);
|
||||
w8_t = rotl32 ((w5_t ^ w0_t ^ wa_t ^ w8_t), 1u); SHA1_STEP (SHA1_F2o, e, a, b, c, d, w8_t);
|
||||
w9_t = rotl32 ((w6_t ^ w1_t ^ wb_t ^ w9_t), 1u); SHA1_STEP (SHA1_F2o, d, e, a, b, c, w9_t);
|
||||
wa_t = rotl32 ((w7_t ^ w2_t ^ wc_t ^ wa_t), 1u); SHA1_STEP (SHA1_F2o, c, d, e, a, b, wa_t);
|
||||
wb_t = rotl32 ((w8_t ^ w3_t ^ wd_t ^ wb_t), 1u); SHA1_STEP (SHA1_F2o, b, c, d, e, a, wb_t);
|
||||
|
||||
#undef K
|
||||
#define K SHA1C03
|
||||
|
||||
wc_t = rotl32 ((w9_t ^ w4_t ^ we_t ^ wc_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, wc_t);
|
||||
wd_t = rotl32 ((wa_t ^ w5_t ^ wf_t ^ wd_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, wd_t);
|
||||
we_t = rotl32 ((wb_t ^ w6_t ^ w0_t ^ we_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, we_t);
|
||||
wf_t = rotl32 ((wc_t ^ w7_t ^ w1_t ^ wf_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, wf_t);
|
||||
w0_t = rotl32 ((wd_t ^ w8_t ^ w2_t ^ w0_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w0_t);
|
||||
w1_t = rotl32 ((we_t ^ w9_t ^ w3_t ^ w1_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w1_t);
|
||||
w2_t = rotl32 ((wf_t ^ wa_t ^ w4_t ^ w2_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, w2_t);
|
||||
w3_t = rotl32 ((w0_t ^ wb_t ^ w5_t ^ w3_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w3_t);
|
||||
w4_t = rotl32 ((w1_t ^ wc_t ^ w6_t ^ w4_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w4_t);
|
||||
w5_t = rotl32 ((w2_t ^ wd_t ^ w7_t ^ w5_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w5_t);
|
||||
w6_t = rotl32 ((w3_t ^ we_t ^ w8_t ^ w6_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w6_t);
|
||||
w7_t = rotl32 ((w4_t ^ wf_t ^ w9_t ^ w7_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, w7_t);
|
||||
w8_t = rotl32 ((w5_t ^ w0_t ^ wa_t ^ w8_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w8_t);
|
||||
w9_t = rotl32 ((w6_t ^ w1_t ^ wb_t ^ w9_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w9_t);
|
||||
wa_t = rotl32 ((w7_t ^ w2_t ^ wc_t ^ wa_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, wa_t);
|
||||
wb_t = rotl32 ((w8_t ^ w3_t ^ wd_t ^ wb_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, wb_t);
|
||||
wc_t = rotl32 ((w9_t ^ w4_t ^ we_t ^ wc_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, wc_t);
|
||||
wd_t = rotl32 ((wa_t ^ w5_t ^ wf_t ^ wd_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, wd_t);
|
||||
we_t = rotl32 ((wb_t ^ w6_t ^ w0_t ^ we_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, we_t);
|
||||
wf_t = rotl32 ((wc_t ^ w7_t ^ w1_t ^ wf_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, wf_t);
|
||||
|
||||
COMPARE_M_SIMD (d, e, c, b);
|
||||
}
|
||||
}
|
||||
|
||||
__kernel void m00134_m08 (__global pw_t *pws, __global kernel_rule_t *rules_buf, __global comb_t *combs_buf, __global bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global u32 *bitmaps_buf_s1_a, __global u32 *bitmaps_buf_s1_b, __global u32 *bitmaps_buf_s1_c, __global u32 *bitmaps_buf_s1_d, __global u32 *bitmaps_buf_s2_a, __global u32 *bitmaps_buf_s2_b, __global u32 *bitmaps_buf_s2_c, __global u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global digest_t *digests_buf, __global u32 *hashes_shown, __global salt_t *salt_bufs, __global void *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
|
||||
{
|
||||
}
|
||||
|
||||
__kernel void m00134_m16 (__global pw_t *pws, __global kernel_rule_t *rules_buf, __global comb_t *combs_buf, __global bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global u32 *bitmaps_buf_s1_a, __global u32 *bitmaps_buf_s1_b, __global u32 *bitmaps_buf_s1_c, __global u32 *bitmaps_buf_s1_d, __global u32 *bitmaps_buf_s2_a, __global u32 *bitmaps_buf_s2_b, __global u32 *bitmaps_buf_s2_c, __global u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global digest_t *digests_buf, __global u32 *hashes_shown, __global salt_t *salt_bufs, __global void *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
|
||||
{
|
||||
}
|
||||
|
||||
__kernel void m00134_s04 (__global pw_t *pws, __global kernel_rule_t *rules_buf, __global comb_t *combs_buf, __global bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global u32 *bitmaps_buf_s1_a, __global u32 *bitmaps_buf_s1_b, __global u32 *bitmaps_buf_s1_c, __global u32 *bitmaps_buf_s1_d, __global u32 *bitmaps_buf_s2_a, __global u32 *bitmaps_buf_s2_b, __global u32 *bitmaps_buf_s2_c, __global u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global digest_t *digests_buf, __global u32 *hashes_shown, __global salt_t *salt_bufs, __global void *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
|
||||
{
|
||||
/**
|
||||
* modifier
|
||||
*/
|
||||
|
||||
const u32 lid = get_local_id (0);
|
||||
|
||||
/**
|
||||
* base
|
||||
*/
|
||||
|
||||
const u32 gid = get_global_id (0);
|
||||
|
||||
if (gid >= gid_max) return;
|
||||
|
||||
u32 pw_buf0[4];
|
||||
u32 pw_buf1[4];
|
||||
|
||||
pw_buf0[0] = pws[gid].i[0];
|
||||
pw_buf0[1] = pws[gid].i[1];
|
||||
pw_buf0[2] = pws[gid].i[2];
|
||||
pw_buf0[3] = pws[gid].i[3];
|
||||
pw_buf1[0] = pws[gid].i[4];
|
||||
pw_buf1[1] = pws[gid].i[5];
|
||||
pw_buf1[2] = pws[gid].i[6];
|
||||
pw_buf1[3] = pws[gid].i[7];
|
||||
|
||||
const u32 pw_l_len = pws[gid].pw_len;
|
||||
|
||||
/**
|
||||
* salt
|
||||
*/
|
||||
|
||||
u32 salt_buf0[4];
|
||||
u32 salt_buf1[4];
|
||||
u32 salt_buf2[4];
|
||||
u32 salt_buf3[4];
|
||||
|
||||
salt_buf0[0] = salt_bufs[salt_pos].salt_buf[ 0];
|
||||
salt_buf0[1] = salt_bufs[salt_pos].salt_buf[ 1];
|
||||
salt_buf0[2] = salt_bufs[salt_pos].salt_buf[ 2];
|
||||
salt_buf0[3] = salt_bufs[salt_pos].salt_buf[ 3];
|
||||
salt_buf1[0] = salt_bufs[salt_pos].salt_buf[ 4];
|
||||
salt_buf1[1] = salt_bufs[salt_pos].salt_buf[ 5];
|
||||
salt_buf1[2] = salt_bufs[salt_pos].salt_buf[ 6];
|
||||
salt_buf1[3] = salt_bufs[salt_pos].salt_buf[ 7];
|
||||
salt_buf2[0] = salt_bufs[salt_pos].salt_buf[ 8];
|
||||
salt_buf2[1] = salt_bufs[salt_pos].salt_buf[ 9];
|
||||
salt_buf2[2] = salt_bufs[salt_pos].salt_buf[10];
|
||||
salt_buf2[3] = salt_bufs[salt_pos].salt_buf[11];
|
||||
salt_buf3[0] = salt_bufs[salt_pos].salt_buf[12];
|
||||
salt_buf3[1] = salt_bufs[salt_pos].salt_buf[13];
|
||||
salt_buf3[2] = salt_bufs[salt_pos].salt_buf[14];
|
||||
salt_buf3[3] = salt_bufs[salt_pos].salt_buf[15];
|
||||
|
||||
const u32 salt_len = salt_bufs[salt_pos].salt_len;
|
||||
|
||||
/**
|
||||
* 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]
|
||||
};
|
||||
|
||||
/**
|
||||
* reverse
|
||||
*/
|
||||
|
||||
const u32 e_rev = rotl32_S (search[1], 2u);
|
||||
|
||||
/**
|
||||
* loop
|
||||
*/
|
||||
|
||||
for (u32 il_pos = 0; il_pos < il_cnt; il_pos += VECT_SIZE)
|
||||
{
|
||||
const u32x pw_r_len = pwlenx_create_combt (combs_buf, il_pos);
|
||||
|
||||
const u32x pw_len = pw_l_len + pw_r_len;
|
||||
|
||||
/**
|
||||
* concat password candidate
|
||||
*/
|
||||
|
||||
u32x wordl0[4] = { 0 };
|
||||
u32x wordl1[4] = { 0 };
|
||||
u32x wordl2[4] = { 0 };
|
||||
u32x wordl3[4] = { 0 };
|
||||
|
||||
wordl0[0] = pw_buf0[0];
|
||||
wordl0[1] = pw_buf0[1];
|
||||
wordl0[2] = pw_buf0[2];
|
||||
wordl0[3] = pw_buf0[3];
|
||||
wordl1[0] = pw_buf1[0];
|
||||
wordl1[1] = pw_buf1[1];
|
||||
wordl1[2] = pw_buf1[2];
|
||||
wordl1[3] = pw_buf1[3];
|
||||
|
||||
u32x wordr0[4] = { 0 };
|
||||
u32x wordr1[4] = { 0 };
|
||||
u32x wordr2[4] = { 0 };
|
||||
u32x wordr3[4] = { 0 };
|
||||
|
||||
wordr0[0] = ix_create_combt (combs_buf, il_pos, 0);
|
||||
wordr0[1] = ix_create_combt (combs_buf, il_pos, 1);
|
||||
wordr0[2] = ix_create_combt (combs_buf, il_pos, 2);
|
||||
wordr0[3] = ix_create_combt (combs_buf, il_pos, 3);
|
||||
wordr1[0] = ix_create_combt (combs_buf, il_pos, 4);
|
||||
wordr1[1] = ix_create_combt (combs_buf, il_pos, 5);
|
||||
wordr1[2] = ix_create_combt (combs_buf, il_pos, 6);
|
||||
wordr1[3] = ix_create_combt (combs_buf, il_pos, 7);
|
||||
|
||||
if (combs_mode == COMBINATOR_MODE_BASE_LEFT)
|
||||
{
|
||||
switch_buffer_by_offset_le_VV (wordr0, wordr1, wordr2, wordr3, pw_l_len);
|
||||
}
|
||||
else
|
||||
{
|
||||
switch_buffer_by_offset_le_VV (wordl0, wordl1, wordl2, wordl3, pw_r_len);
|
||||
}
|
||||
|
||||
u32x w0[4];
|
||||
u32x w1[4];
|
||||
u32x w2[4];
|
||||
u32x w3[4];
|
||||
|
||||
w0[0] = wordl0[0] | wordr0[0];
|
||||
w0[1] = wordl0[1] | wordr0[1];
|
||||
w0[2] = wordl0[2] | wordr0[2];
|
||||
w0[3] = wordl0[3] | wordr0[3];
|
||||
w1[0] = wordl1[0] | wordr1[0];
|
||||
w1[1] = wordl1[1] | wordr1[1];
|
||||
w1[2] = wordl1[2] | wordr1[2];
|
||||
w1[3] = wordl1[3] | wordr1[3];
|
||||
w2[0] = wordl2[0] | wordr2[0];
|
||||
w2[1] = wordl2[1] | wordr2[1];
|
||||
w2[2] = wordl2[2] | wordr2[2];
|
||||
w2[3] = wordl2[3] | wordr2[3];
|
||||
w3[0] = wordl3[0] | wordr3[0];
|
||||
w3[1] = wordl3[1] | wordr3[1];
|
||||
w3[2] = wordl3[2] | wordr3[2];
|
||||
w3[3] = wordl3[3] | wordr3[3];
|
||||
|
||||
make_unicode (w1, w2, w3);
|
||||
make_unicode (w0, w0, w1);
|
||||
|
||||
const u32x pw_len2 = pw_len * 2;
|
||||
|
||||
/**
|
||||
* prepend salt
|
||||
*/
|
||||
|
||||
switch_buffer_by_offset_le (w0, w1, w2, w3, salt_len);
|
||||
|
||||
const u32x pw_salt_len = pw_len2 + salt_len;
|
||||
|
||||
w0[0] |= salt_buf0[0];
|
||||
w0[1] |= salt_buf0[1];
|
||||
w0[2] |= salt_buf0[2];
|
||||
w0[3] |= salt_buf0[3];
|
||||
w1[0] |= salt_buf1[0];
|
||||
w1[1] |= salt_buf1[1];
|
||||
w1[2] |= salt_buf1[2];
|
||||
w1[3] |= salt_buf1[3];
|
||||
w2[0] |= salt_buf2[0];
|
||||
w2[1] |= salt_buf2[1];
|
||||
w2[2] |= salt_buf2[2];
|
||||
w2[3] |= salt_buf2[3];
|
||||
w3[0] |= salt_buf3[0];
|
||||
w3[1] |= salt_buf3[1];
|
||||
w3[2] |= salt_buf3[2];
|
||||
w3[3] |= salt_buf3[3];
|
||||
|
||||
/**
|
||||
* sha1
|
||||
*/
|
||||
|
||||
u32x w0_t = swap32 (w0[0]);
|
||||
u32x w1_t = swap32 (w0[1]);
|
||||
u32x w2_t = swap32 (w0[2]);
|
||||
u32x w3_t = swap32 (w0[3]);
|
||||
u32x w4_t = swap32 (w1[0]);
|
||||
u32x w5_t = swap32 (w1[1]);
|
||||
u32x w6_t = swap32 (w1[2]);
|
||||
u32x w7_t = swap32 (w1[3]);
|
||||
u32x w8_t = swap32 (w2[0]);
|
||||
u32x w9_t = swap32 (w2[1]);
|
||||
u32x wa_t = swap32 (w2[2]);
|
||||
u32x wb_t = swap32 (w2[3]);
|
||||
u32x wc_t = swap32 (w3[0]);
|
||||
u32x wd_t = swap32 (w3[1]);
|
||||
u32x we_t = 0;
|
||||
u32x wf_t = pw_salt_len * 8;
|
||||
|
||||
u32x a = SHA1M_A;
|
||||
u32x b = SHA1M_B;
|
||||
u32x c = SHA1M_C;
|
||||
u32x d = SHA1M_D;
|
||||
u32x e = SHA1M_E;
|
||||
|
||||
#undef K
|
||||
#define K SHA1C00
|
||||
|
||||
SHA1_STEP (SHA1_F0o, a, b, c, d, e, w0_t);
|
||||
SHA1_STEP (SHA1_F0o, e, a, b, c, d, w1_t);
|
||||
SHA1_STEP (SHA1_F0o, d, e, a, b, c, w2_t);
|
||||
SHA1_STEP (SHA1_F0o, c, d, e, a, b, w3_t);
|
||||
SHA1_STEP (SHA1_F0o, b, c, d, e, a, w4_t);
|
||||
SHA1_STEP (SHA1_F0o, a, b, c, d, e, w5_t);
|
||||
SHA1_STEP (SHA1_F0o, e, a, b, c, d, w6_t);
|
||||
SHA1_STEP (SHA1_F0o, d, e, a, b, c, w7_t);
|
||||
SHA1_STEP (SHA1_F0o, c, d, e, a, b, w8_t);
|
||||
SHA1_STEP (SHA1_F0o, b, c, d, e, a, w9_t);
|
||||
SHA1_STEP (SHA1_F0o, a, b, c, d, e, wa_t);
|
||||
SHA1_STEP (SHA1_F0o, e, a, b, c, d, wb_t);
|
||||
SHA1_STEP (SHA1_F0o, d, e, a, b, c, wc_t);
|
||||
SHA1_STEP (SHA1_F0o, c, d, e, a, b, wd_t);
|
||||
SHA1_STEP (SHA1_F0o, b, c, d, e, a, we_t);
|
||||
SHA1_STEP (SHA1_F0o, a, b, c, d, e, wf_t);
|
||||
w0_t = rotl32 ((wd_t ^ w8_t ^ w2_t ^ w0_t), 1u); SHA1_STEP (SHA1_F0o, e, a, b, c, d, w0_t);
|
||||
w1_t = rotl32 ((we_t ^ w9_t ^ w3_t ^ w1_t), 1u); SHA1_STEP (SHA1_F0o, d, e, a, b, c, w1_t);
|
||||
w2_t = rotl32 ((wf_t ^ wa_t ^ w4_t ^ w2_t), 1u); SHA1_STEP (SHA1_F0o, c, d, e, a, b, w2_t);
|
||||
w3_t = rotl32 ((w0_t ^ wb_t ^ w5_t ^ w3_t), 1u); SHA1_STEP (SHA1_F0o, b, c, d, e, a, w3_t);
|
||||
|
||||
#undef K
|
||||
#define K SHA1C01
|
||||
|
||||
w4_t = rotl32 ((w1_t ^ wc_t ^ w6_t ^ w4_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w4_t);
|
||||
w5_t = rotl32 ((w2_t ^ wd_t ^ w7_t ^ w5_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, w5_t);
|
||||
w6_t = rotl32 ((w3_t ^ we_t ^ w8_t ^ w6_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w6_t);
|
||||
w7_t = rotl32 ((w4_t ^ wf_t ^ w9_t ^ w7_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w7_t);
|
||||
w8_t = rotl32 ((w5_t ^ w0_t ^ wa_t ^ w8_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w8_t);
|
||||
w9_t = rotl32 ((w6_t ^ w1_t ^ wb_t ^ w9_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w9_t);
|
||||
wa_t = rotl32 ((w7_t ^ w2_t ^ wc_t ^ wa_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, wa_t);
|
||||
wb_t = rotl32 ((w8_t ^ w3_t ^ wd_t ^ wb_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, wb_t);
|
||||
wc_t = rotl32 ((w9_t ^ w4_t ^ we_t ^ wc_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, wc_t);
|
||||
wd_t = rotl32 ((wa_t ^ w5_t ^ wf_t ^ wd_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, wd_t);
|
||||
we_t = rotl32 ((wb_t ^ w6_t ^ w0_t ^ we_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, we_t);
|
||||
wf_t = rotl32 ((wc_t ^ w7_t ^ w1_t ^ wf_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, wf_t);
|
||||
w0_t = rotl32 ((wd_t ^ w8_t ^ w2_t ^ w0_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w0_t);
|
||||
w1_t = rotl32 ((we_t ^ w9_t ^ w3_t ^ w1_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w1_t);
|
||||
w2_t = rotl32 ((wf_t ^ wa_t ^ w4_t ^ w2_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w2_t);
|
||||
w3_t = rotl32 ((w0_t ^ wb_t ^ w5_t ^ w3_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w3_t);
|
||||
w4_t = rotl32 ((w1_t ^ wc_t ^ w6_t ^ w4_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, w4_t);
|
||||
w5_t = rotl32 ((w2_t ^ wd_t ^ w7_t ^ w5_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w5_t);
|
||||
w6_t = rotl32 ((w3_t ^ we_t ^ w8_t ^ w6_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w6_t);
|
||||
w7_t = rotl32 ((w4_t ^ wf_t ^ w9_t ^ w7_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w7_t);
|
||||
|
||||
#undef K
|
||||
#define K SHA1C02
|
||||
|
||||
w8_t = rotl32 ((w5_t ^ w0_t ^ wa_t ^ w8_t), 1u); SHA1_STEP (SHA1_F2o, a, b, c, d, e, w8_t);
|
||||
w9_t = rotl32 ((w6_t ^ w1_t ^ wb_t ^ w9_t), 1u); SHA1_STEP (SHA1_F2o, e, a, b, c, d, w9_t);
|
||||
wa_t = rotl32 ((w7_t ^ w2_t ^ wc_t ^ wa_t), 1u); SHA1_STEP (SHA1_F2o, d, e, a, b, c, wa_t);
|
||||
wb_t = rotl32 ((w8_t ^ w3_t ^ wd_t ^ wb_t), 1u); SHA1_STEP (SHA1_F2o, c, d, e, a, b, wb_t);
|
||||
wc_t = rotl32 ((w9_t ^ w4_t ^ we_t ^ wc_t), 1u); SHA1_STEP (SHA1_F2o, b, c, d, e, a, wc_t);
|
||||
wd_t = rotl32 ((wa_t ^ w5_t ^ wf_t ^ wd_t), 1u); SHA1_STEP (SHA1_F2o, a, b, c, d, e, wd_t);
|
||||
we_t = rotl32 ((wb_t ^ w6_t ^ w0_t ^ we_t), 1u); SHA1_STEP (SHA1_F2o, e, a, b, c, d, we_t);
|
||||
wf_t = rotl32 ((wc_t ^ w7_t ^ w1_t ^ wf_t), 1u); SHA1_STEP (SHA1_F2o, d, e, a, b, c, wf_t);
|
||||
w0_t = rotl32 ((wd_t ^ w8_t ^ w2_t ^ w0_t), 1u); SHA1_STEP (SHA1_F2o, c, d, e, a, b, w0_t);
|
||||
w1_t = rotl32 ((we_t ^ w9_t ^ w3_t ^ w1_t), 1u); SHA1_STEP (SHA1_F2o, b, c, d, e, a, w1_t);
|
||||
w2_t = rotl32 ((wf_t ^ wa_t ^ w4_t ^ w2_t), 1u); SHA1_STEP (SHA1_F2o, a, b, c, d, e, w2_t);
|
||||
w3_t = rotl32 ((w0_t ^ wb_t ^ w5_t ^ w3_t), 1u); SHA1_STEP (SHA1_F2o, e, a, b, c, d, w3_t);
|
||||
w4_t = rotl32 ((w1_t ^ wc_t ^ w6_t ^ w4_t), 1u); SHA1_STEP (SHA1_F2o, d, e, a, b, c, w4_t);
|
||||
w5_t = rotl32 ((w2_t ^ wd_t ^ w7_t ^ w5_t), 1u); SHA1_STEP (SHA1_F2o, c, d, e, a, b, w5_t);
|
||||
w6_t = rotl32 ((w3_t ^ we_t ^ w8_t ^ w6_t), 1u); SHA1_STEP (SHA1_F2o, b, c, d, e, a, w6_t);
|
||||
w7_t = rotl32 ((w4_t ^ wf_t ^ w9_t ^ w7_t), 1u); SHA1_STEP (SHA1_F2o, a, b, c, d, e, w7_t);
|
||||
w8_t = rotl32 ((w5_t ^ w0_t ^ wa_t ^ w8_t), 1u); SHA1_STEP (SHA1_F2o, e, a, b, c, d, w8_t);
|
||||
w9_t = rotl32 ((w6_t ^ w1_t ^ wb_t ^ w9_t), 1u); SHA1_STEP (SHA1_F2o, d, e, a, b, c, w9_t);
|
||||
wa_t = rotl32 ((w7_t ^ w2_t ^ wc_t ^ wa_t), 1u); SHA1_STEP (SHA1_F2o, c, d, e, a, b, wa_t);
|
||||
wb_t = rotl32 ((w8_t ^ w3_t ^ wd_t ^ wb_t), 1u); SHA1_STEP (SHA1_F2o, b, c, d, e, a, wb_t);
|
||||
|
||||
#undef K
|
||||
#define K SHA1C03
|
||||
|
||||
wc_t = rotl32 ((w9_t ^ w4_t ^ we_t ^ wc_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, wc_t);
|
||||
wd_t = rotl32 ((wa_t ^ w5_t ^ wf_t ^ wd_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, wd_t);
|
||||
we_t = rotl32 ((wb_t ^ w6_t ^ w0_t ^ we_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, we_t);
|
||||
wf_t = rotl32 ((wc_t ^ w7_t ^ w1_t ^ wf_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, wf_t);
|
||||
w0_t = rotl32 ((wd_t ^ w8_t ^ w2_t ^ w0_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w0_t);
|
||||
w1_t = rotl32 ((we_t ^ w9_t ^ w3_t ^ w1_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w1_t);
|
||||
w2_t = rotl32 ((wf_t ^ wa_t ^ w4_t ^ w2_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, w2_t);
|
||||
w3_t = rotl32 ((w0_t ^ wb_t ^ w5_t ^ w3_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w3_t);
|
||||
w4_t = rotl32 ((w1_t ^ wc_t ^ w6_t ^ w4_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w4_t);
|
||||
w5_t = rotl32 ((w2_t ^ wd_t ^ w7_t ^ w5_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w5_t);
|
||||
w6_t = rotl32 ((w3_t ^ we_t ^ w8_t ^ w6_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w6_t);
|
||||
w7_t = rotl32 ((w4_t ^ wf_t ^ w9_t ^ w7_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, w7_t);
|
||||
w8_t = rotl32 ((w5_t ^ w0_t ^ wa_t ^ w8_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w8_t);
|
||||
w9_t = rotl32 ((w6_t ^ w1_t ^ wb_t ^ w9_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w9_t);
|
||||
wa_t = rotl32 ((w7_t ^ w2_t ^ wc_t ^ wa_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, wa_t);
|
||||
wb_t = rotl32 ((w8_t ^ w3_t ^ wd_t ^ wb_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, wb_t);
|
||||
|
||||
if (MATCHES_NONE_VS (e, e_rev)) continue;
|
||||
|
||||
wc_t = rotl32 ((w9_t ^ w4_t ^ we_t ^ wc_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, wc_t);
|
||||
wd_t = rotl32 ((wa_t ^ w5_t ^ wf_t ^ wd_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, wd_t);
|
||||
we_t = rotl32 ((wb_t ^ w6_t ^ w0_t ^ we_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, we_t);
|
||||
wf_t = rotl32 ((wc_t ^ w7_t ^ w1_t ^ wf_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, wf_t);
|
||||
|
||||
COMPARE_S_SIMD (d, e, c, b);
|
||||
}
|
||||
}
|
||||
|
||||
__kernel void m00134_s08 (__global pw_t *pws, __global kernel_rule_t *rules_buf, __global comb_t *combs_buf, __global bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global u32 *bitmaps_buf_s1_a, __global u32 *bitmaps_buf_s1_b, __global u32 *bitmaps_buf_s1_c, __global u32 *bitmaps_buf_s1_d, __global u32 *bitmaps_buf_s2_a, __global u32 *bitmaps_buf_s2_b, __global u32 *bitmaps_buf_s2_c, __global u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global digest_t *digests_buf, __global u32 *hashes_shown, __global salt_t *salt_bufs, __global void *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
|
||||
{
|
||||
}
|
||||
|
||||
__kernel void m00134_s16 (__global pw_t *pws, __global kernel_rule_t *rules_buf, __global comb_t *combs_buf, __global bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global u32 *bitmaps_buf_s1_a, __global u32 *bitmaps_buf_s1_b, __global u32 *bitmaps_buf_s1_c, __global u32 *bitmaps_buf_s1_d, __global u32 *bitmaps_buf_s2_a, __global u32 *bitmaps_buf_s2_b, __global u32 *bitmaps_buf_s2_c, __global u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global digest_t *digests_buf, __global u32 *hashes_shown, __global salt_t *salt_bufs, __global void *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
|
||||
{
|
||||
}
|
774
OpenCL/m00134_a3.cl
Normal file
774
OpenCL/m00134_a3.cl
Normal file
@ -0,0 +1,774 @@
|
||||
/**
|
||||
* Author......: Jens Steube <jens.steube@gmail.com>
|
||||
* License.....: MIT
|
||||
*/
|
||||
|
||||
#define _SHA1_
|
||||
|
||||
#define NEW_SIMD_CODE
|
||||
|
||||
#include "include/constants.h"
|
||||
#include "include/kernel_vendor.h"
|
||||
|
||||
#define DGST_R0 3
|
||||
#define DGST_R1 4
|
||||
#define DGST_R2 2
|
||||
#define DGST_R3 1
|
||||
|
||||
#include "include/kernel_functions.c"
|
||||
#include "OpenCL/types_ocl.c"
|
||||
#include "OpenCL/common.c"
|
||||
#include "OpenCL/simd.c"
|
||||
|
||||
static void m00134m (u32 w0[4], u32 w1[4], u32 w2[4], u32 w3[4], const u32 pw_len, __global pw_t *pws, __global kernel_rule_t *rules_buf, __global comb_t *combs_buf, __global bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global u32 *bitmaps_buf_s1_a, __global u32 *bitmaps_buf_s1_b, __global u32 *bitmaps_buf_s1_c, __global u32 *bitmaps_buf_s1_d, __global u32 *bitmaps_buf_s2_a, __global u32 *bitmaps_buf_s2_b, __global u32 *bitmaps_buf_s2_c, __global u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global digest_t *digests_buf, __global u32 *hashes_shown, __global salt_t *salt_bufs, __global void *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset)
|
||||
{
|
||||
/**
|
||||
* modifier
|
||||
*/
|
||||
|
||||
const u32 gid = get_global_id (0);
|
||||
const u32 lid = get_local_id (0);
|
||||
|
||||
/**
|
||||
* salt
|
||||
*/
|
||||
|
||||
u32 salt_buf0[4];
|
||||
u32 salt_buf1[4];
|
||||
u32 salt_buf2[4];
|
||||
u32 salt_buf3[4];
|
||||
|
||||
salt_buf0[0] = swap32_S (salt_bufs[salt_pos].salt_buf[ 0]);
|
||||
salt_buf0[1] = swap32_S (salt_bufs[salt_pos].salt_buf[ 1]);
|
||||
salt_buf0[2] = swap32_S (salt_bufs[salt_pos].salt_buf[ 2]);
|
||||
salt_buf0[3] = swap32_S (salt_bufs[salt_pos].salt_buf[ 3]);
|
||||
salt_buf1[0] = swap32_S (salt_bufs[salt_pos].salt_buf[ 4]);
|
||||
salt_buf1[1] = swap32_S (salt_bufs[salt_pos].salt_buf[ 5]);
|
||||
salt_buf1[2] = swap32_S (salt_bufs[salt_pos].salt_buf[ 6]);
|
||||
salt_buf1[3] = swap32_S (salt_bufs[salt_pos].salt_buf[ 7]);
|
||||
salt_buf2[0] = swap32_S (salt_bufs[salt_pos].salt_buf[ 8]);
|
||||
salt_buf2[1] = swap32_S (salt_bufs[salt_pos].salt_buf[ 9]);
|
||||
salt_buf2[2] = swap32_S (salt_bufs[salt_pos].salt_buf[10]);
|
||||
salt_buf2[3] = swap32_S (salt_bufs[salt_pos].salt_buf[11]);
|
||||
salt_buf3[0] = swap32_S (salt_bufs[salt_pos].salt_buf[12]);
|
||||
salt_buf3[1] = swap32_S (salt_bufs[salt_pos].salt_buf[13]);
|
||||
salt_buf3[2] = swap32_S (salt_bufs[salt_pos].salt_buf[14]);
|
||||
salt_buf3[3] = swap32_S (salt_bufs[salt_pos].salt_buf[15]);
|
||||
|
||||
const u32 salt_len = salt_bufs[salt_pos].salt_len;
|
||||
|
||||
const u32 pw_salt_len = pw_len + salt_len;
|
||||
|
||||
/**
|
||||
* prepend salt
|
||||
*/
|
||||
|
||||
const u32 w0l = w0[0];
|
||||
|
||||
switch_buffer_by_offset_be_S (w0, w1, w2, w3, salt_len);
|
||||
|
||||
w0[0] |= salt_buf0[0];
|
||||
w0[1] |= salt_buf0[1];
|
||||
w0[2] |= salt_buf0[2];
|
||||
w0[3] |= salt_buf0[3];
|
||||
w1[0] |= salt_buf1[0];
|
||||
w1[1] |= salt_buf1[1];
|
||||
w1[2] |= salt_buf1[2];
|
||||
w1[3] |= salt_buf1[3];
|
||||
w2[0] |= salt_buf2[0];
|
||||
w2[1] |= salt_buf2[1];
|
||||
w2[2] |= salt_buf2[2];
|
||||
w2[3] |= salt_buf2[3];
|
||||
w3[0] |= salt_buf3[0];
|
||||
w3[1] |= salt_buf3[1];
|
||||
w3[2] |= salt_buf3[2];
|
||||
w3[3] |= salt_buf3[3];
|
||||
|
||||
u32x t0[4];
|
||||
u32x t1[4];
|
||||
u32x t2[4];
|
||||
u32x t3[4];
|
||||
|
||||
t0[0] = w0[0];
|
||||
t0[1] = w0[1];
|
||||
t0[2] = w0[2];
|
||||
t0[3] = w0[3];
|
||||
t1[0] = w1[0];
|
||||
t1[1] = w1[1];
|
||||
t1[2] = w1[2];
|
||||
t1[3] = w1[3];
|
||||
t2[0] = w2[0];
|
||||
t2[1] = w2[1];
|
||||
t2[2] = w2[2];
|
||||
t2[3] = w2[3];
|
||||
t3[0] = w3[0];
|
||||
t3[1] = w3[1];
|
||||
t3[2] = w3[2];
|
||||
t3[3] = w3[3];
|
||||
|
||||
/**
|
||||
* loop
|
||||
*/
|
||||
|
||||
for (u32 il_pos = 0; il_pos < il_cnt; il_pos += VECT_SIZE)
|
||||
{
|
||||
const u32x w0r = ix_create_bft (bfs_buf, il_pos);
|
||||
|
||||
const u32x w0lr = w0l | w0r;
|
||||
|
||||
overwrite_at_be_4x4 (t0, t1, t2, t3, w0lr, salt_len);
|
||||
|
||||
/**
|
||||
* sha1
|
||||
*/
|
||||
|
||||
u32x w0_t = t0[0];
|
||||
u32x w1_t = t0[1];
|
||||
u32x w2_t = t0[2];
|
||||
u32x w3_t = t0[3];
|
||||
u32x w4_t = t1[0];
|
||||
u32x w5_t = t1[1];
|
||||
u32x w6_t = t1[2];
|
||||
u32x w7_t = t1[3];
|
||||
u32x w8_t = t2[0];
|
||||
u32x w9_t = t2[1];
|
||||
u32x wa_t = t2[2];
|
||||
u32x wb_t = t2[3];
|
||||
u32x wc_t = t3[0];
|
||||
u32x wd_t = t3[1];
|
||||
u32x we_t = 0;
|
||||
u32x wf_t = pw_salt_len * 8;
|
||||
|
||||
u32x a = SHA1M_A;
|
||||
u32x b = SHA1M_B;
|
||||
u32x c = SHA1M_C;
|
||||
u32x d = SHA1M_D;
|
||||
u32x e = SHA1M_E;
|
||||
|
||||
#undef K
|
||||
#define K SHA1C00
|
||||
|
||||
SHA1_STEP (SHA1_F0o, a, b, c, d, e, w0_t);
|
||||
SHA1_STEP (SHA1_F0o, e, a, b, c, d, w1_t);
|
||||
SHA1_STEP (SHA1_F0o, d, e, a, b, c, w2_t);
|
||||
SHA1_STEP (SHA1_F0o, c, d, e, a, b, w3_t);
|
||||
SHA1_STEP (SHA1_F0o, b, c, d, e, a, w4_t);
|
||||
SHA1_STEP (SHA1_F0o, a, b, c, d, e, w5_t);
|
||||
SHA1_STEP (SHA1_F0o, e, a, b, c, d, w6_t);
|
||||
SHA1_STEP (SHA1_F0o, d, e, a, b, c, w7_t);
|
||||
SHA1_STEP (SHA1_F0o, c, d, e, a, b, w8_t);
|
||||
SHA1_STEP (SHA1_F0o, b, c, d, e, a, w9_t);
|
||||
SHA1_STEP (SHA1_F0o, a, b, c, d, e, wa_t);
|
||||
SHA1_STEP (SHA1_F0o, e, a, b, c, d, wb_t);
|
||||
SHA1_STEP (SHA1_F0o, d, e, a, b, c, wc_t);
|
||||
SHA1_STEP (SHA1_F0o, c, d, e, a, b, wd_t);
|
||||
SHA1_STEP (SHA1_F0o, b, c, d, e, a, we_t);
|
||||
SHA1_STEP (SHA1_F0o, a, b, c, d, e, wf_t);
|
||||
w0_t = rotl32 ((wd_t ^ w8_t ^ w2_t ^ w0_t), 1u); SHA1_STEP (SHA1_F0o, e, a, b, c, d, w0_t);
|
||||
w1_t = rotl32 ((we_t ^ w9_t ^ w3_t ^ w1_t), 1u); SHA1_STEP (SHA1_F0o, d, e, a, b, c, w1_t);
|
||||
w2_t = rotl32 ((wf_t ^ wa_t ^ w4_t ^ w2_t), 1u); SHA1_STEP (SHA1_F0o, c, d, e, a, b, w2_t);
|
||||
w3_t = rotl32 ((w0_t ^ wb_t ^ w5_t ^ w3_t), 1u); SHA1_STEP (SHA1_F0o, b, c, d, e, a, w3_t);
|
||||
|
||||
#undef K
|
||||
#define K SHA1C01
|
||||
|
||||
w4_t = rotl32 ((w1_t ^ wc_t ^ w6_t ^ w4_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w4_t);
|
||||
w5_t = rotl32 ((w2_t ^ wd_t ^ w7_t ^ w5_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, w5_t);
|
||||
w6_t = rotl32 ((w3_t ^ we_t ^ w8_t ^ w6_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w6_t);
|
||||
w7_t = rotl32 ((w4_t ^ wf_t ^ w9_t ^ w7_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w7_t);
|
||||
w8_t = rotl32 ((w5_t ^ w0_t ^ wa_t ^ w8_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w8_t);
|
||||
w9_t = rotl32 ((w6_t ^ w1_t ^ wb_t ^ w9_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w9_t);
|
||||
wa_t = rotl32 ((w7_t ^ w2_t ^ wc_t ^ wa_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, wa_t);
|
||||
wb_t = rotl32 ((w8_t ^ w3_t ^ wd_t ^ wb_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, wb_t);
|
||||
wc_t = rotl32 ((w9_t ^ w4_t ^ we_t ^ wc_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, wc_t);
|
||||
wd_t = rotl32 ((wa_t ^ w5_t ^ wf_t ^ wd_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, wd_t);
|
||||
we_t = rotl32 ((wb_t ^ w6_t ^ w0_t ^ we_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, we_t);
|
||||
wf_t = rotl32 ((wc_t ^ w7_t ^ w1_t ^ wf_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, wf_t);
|
||||
w0_t = rotl32 ((wd_t ^ w8_t ^ w2_t ^ w0_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w0_t);
|
||||
w1_t = rotl32 ((we_t ^ w9_t ^ w3_t ^ w1_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w1_t);
|
||||
w2_t = rotl32 ((wf_t ^ wa_t ^ w4_t ^ w2_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w2_t);
|
||||
w3_t = rotl32 ((w0_t ^ wb_t ^ w5_t ^ w3_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w3_t);
|
||||
w4_t = rotl32 ((w1_t ^ wc_t ^ w6_t ^ w4_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, w4_t);
|
||||
w5_t = rotl32 ((w2_t ^ wd_t ^ w7_t ^ w5_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w5_t);
|
||||
w6_t = rotl32 ((w3_t ^ we_t ^ w8_t ^ w6_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w6_t);
|
||||
w7_t = rotl32 ((w4_t ^ wf_t ^ w9_t ^ w7_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w7_t);
|
||||
|
||||
#undef K
|
||||
#define K SHA1C02
|
||||
|
||||
w8_t = rotl32 ((w5_t ^ w0_t ^ wa_t ^ w8_t), 1u); SHA1_STEP (SHA1_F2o, a, b, c, d, e, w8_t);
|
||||
w9_t = rotl32 ((w6_t ^ w1_t ^ wb_t ^ w9_t), 1u); SHA1_STEP (SHA1_F2o, e, a, b, c, d, w9_t);
|
||||
wa_t = rotl32 ((w7_t ^ w2_t ^ wc_t ^ wa_t), 1u); SHA1_STEP (SHA1_F2o, d, e, a, b, c, wa_t);
|
||||
wb_t = rotl32 ((w8_t ^ w3_t ^ wd_t ^ wb_t), 1u); SHA1_STEP (SHA1_F2o, c, d, e, a, b, wb_t);
|
||||
wc_t = rotl32 ((w9_t ^ w4_t ^ we_t ^ wc_t), 1u); SHA1_STEP (SHA1_F2o, b, c, d, e, a, wc_t);
|
||||
wd_t = rotl32 ((wa_t ^ w5_t ^ wf_t ^ wd_t), 1u); SHA1_STEP (SHA1_F2o, a, b, c, d, e, wd_t);
|
||||
we_t = rotl32 ((wb_t ^ w6_t ^ w0_t ^ we_t), 1u); SHA1_STEP (SHA1_F2o, e, a, b, c, d, we_t);
|
||||
wf_t = rotl32 ((wc_t ^ w7_t ^ w1_t ^ wf_t), 1u); SHA1_STEP (SHA1_F2o, d, e, a, b, c, wf_t);
|
||||
w0_t = rotl32 ((wd_t ^ w8_t ^ w2_t ^ w0_t), 1u); SHA1_STEP (SHA1_F2o, c, d, e, a, b, w0_t);
|
||||
w1_t = rotl32 ((we_t ^ w9_t ^ w3_t ^ w1_t), 1u); SHA1_STEP (SHA1_F2o, b, c, d, e, a, w1_t);
|
||||
w2_t = rotl32 ((wf_t ^ wa_t ^ w4_t ^ w2_t), 1u); SHA1_STEP (SHA1_F2o, a, b, c, d, e, w2_t);
|
||||
w3_t = rotl32 ((w0_t ^ wb_t ^ w5_t ^ w3_t), 1u); SHA1_STEP (SHA1_F2o, e, a, b, c, d, w3_t);
|
||||
w4_t = rotl32 ((w1_t ^ wc_t ^ w6_t ^ w4_t), 1u); SHA1_STEP (SHA1_F2o, d, e, a, b, c, w4_t);
|
||||
w5_t = rotl32 ((w2_t ^ wd_t ^ w7_t ^ w5_t), 1u); SHA1_STEP (SHA1_F2o, c, d, e, a, b, w5_t);
|
||||
w6_t = rotl32 ((w3_t ^ we_t ^ w8_t ^ w6_t), 1u); SHA1_STEP (SHA1_F2o, b, c, d, e, a, w6_t);
|
||||
w7_t = rotl32 ((w4_t ^ wf_t ^ w9_t ^ w7_t), 1u); SHA1_STEP (SHA1_F2o, a, b, c, d, e, w7_t);
|
||||
w8_t = rotl32 ((w5_t ^ w0_t ^ wa_t ^ w8_t), 1u); SHA1_STEP (SHA1_F2o, e, a, b, c, d, w8_t);
|
||||
w9_t = rotl32 ((w6_t ^ w1_t ^ wb_t ^ w9_t), 1u); SHA1_STEP (SHA1_F2o, d, e, a, b, c, w9_t);
|
||||
wa_t = rotl32 ((w7_t ^ w2_t ^ wc_t ^ wa_t), 1u); SHA1_STEP (SHA1_F2o, c, d, e, a, b, wa_t);
|
||||
wb_t = rotl32 ((w8_t ^ w3_t ^ wd_t ^ wb_t), 1u); SHA1_STEP (SHA1_F2o, b, c, d, e, a, wb_t);
|
||||
|
||||
#undef K
|
||||
#define K SHA1C03
|
||||
|
||||
wc_t = rotl32 ((w9_t ^ w4_t ^ we_t ^ wc_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, wc_t);
|
||||
wd_t = rotl32 ((wa_t ^ w5_t ^ wf_t ^ wd_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, wd_t);
|
||||
we_t = rotl32 ((wb_t ^ w6_t ^ w0_t ^ we_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, we_t);
|
||||
wf_t = rotl32 ((wc_t ^ w7_t ^ w1_t ^ wf_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, wf_t);
|
||||
w0_t = rotl32 ((wd_t ^ w8_t ^ w2_t ^ w0_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w0_t);
|
||||
w1_t = rotl32 ((we_t ^ w9_t ^ w3_t ^ w1_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w1_t);
|
||||
w2_t = rotl32 ((wf_t ^ wa_t ^ w4_t ^ w2_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, w2_t);
|
||||
w3_t = rotl32 ((w0_t ^ wb_t ^ w5_t ^ w3_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w3_t);
|
||||
w4_t = rotl32 ((w1_t ^ wc_t ^ w6_t ^ w4_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w4_t);
|
||||
w5_t = rotl32 ((w2_t ^ wd_t ^ w7_t ^ w5_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w5_t);
|
||||
w6_t = rotl32 ((w3_t ^ we_t ^ w8_t ^ w6_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w6_t);
|
||||
w7_t = rotl32 ((w4_t ^ wf_t ^ w9_t ^ w7_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, w7_t);
|
||||
w8_t = rotl32 ((w5_t ^ w0_t ^ wa_t ^ w8_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w8_t);
|
||||
w9_t = rotl32 ((w6_t ^ w1_t ^ wb_t ^ w9_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w9_t);
|
||||
wa_t = rotl32 ((w7_t ^ w2_t ^ wc_t ^ wa_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, wa_t);
|
||||
wb_t = rotl32 ((w8_t ^ w3_t ^ wd_t ^ wb_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, wb_t);
|
||||
wc_t = rotl32 ((w9_t ^ w4_t ^ we_t ^ wc_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, wc_t);
|
||||
wd_t = rotl32 ((wa_t ^ w5_t ^ wf_t ^ wd_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, wd_t);
|
||||
we_t = rotl32 ((wb_t ^ w6_t ^ w0_t ^ we_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, we_t);
|
||||
wf_t = rotl32 ((wc_t ^ w7_t ^ w1_t ^ wf_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, wf_t);
|
||||
|
||||
COMPARE_M_SIMD (d, e, c, b);
|
||||
}
|
||||
}
|
||||
|
||||
static void m00134s (u32 w0[4], u32 w1[4], u32 w2[4], u32 w3[4], const u32 pw_len, __global pw_t *pws, __global kernel_rule_t *rules_buf, __global comb_t *combs_buf, __global bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global u32 *bitmaps_buf_s1_a, __global u32 *bitmaps_buf_s1_b, __global u32 *bitmaps_buf_s1_c, __global u32 *bitmaps_buf_s1_d, __global u32 *bitmaps_buf_s2_a, __global u32 *bitmaps_buf_s2_b, __global u32 *bitmaps_buf_s2_c, __global u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global digest_t *digests_buf, __global u32 *hashes_shown, __global salt_t *salt_bufs, __global void *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset)
|
||||
{
|
||||
/**
|
||||
* modifier
|
||||
*/
|
||||
|
||||
const u32 gid = get_global_id (0);
|
||||
const u32 lid = get_local_id (0);
|
||||
|
||||
/**
|
||||
* 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]
|
||||
};
|
||||
|
||||
/**
|
||||
* reverse
|
||||
*/
|
||||
|
||||
const u32 e_rev = rotl32_S (search[1], 2u);
|
||||
|
||||
/**
|
||||
* salt
|
||||
*/
|
||||
|
||||
u32 salt_buf0[4];
|
||||
u32 salt_buf1[4];
|
||||
u32 salt_buf2[4];
|
||||
u32 salt_buf3[4];
|
||||
|
||||
salt_buf0[0] = swap32_S (salt_bufs[salt_pos].salt_buf[ 0]);
|
||||
salt_buf0[1] = swap32_S (salt_bufs[salt_pos].salt_buf[ 1]);
|
||||
salt_buf0[2] = swap32_S (salt_bufs[salt_pos].salt_buf[ 2]);
|
||||
salt_buf0[3] = swap32_S (salt_bufs[salt_pos].salt_buf[ 3]);
|
||||
salt_buf1[0] = swap32_S (salt_bufs[salt_pos].salt_buf[ 4]);
|
||||
salt_buf1[1] = swap32_S (salt_bufs[salt_pos].salt_buf[ 5]);
|
||||
salt_buf1[2] = swap32_S (salt_bufs[salt_pos].salt_buf[ 6]);
|
||||
salt_buf1[3] = swap32_S (salt_bufs[salt_pos].salt_buf[ 7]);
|
||||
salt_buf2[0] = swap32_S (salt_bufs[salt_pos].salt_buf[ 8]);
|
||||
salt_buf2[1] = swap32_S (salt_bufs[salt_pos].salt_buf[ 9]);
|
||||
salt_buf2[2] = swap32_S (salt_bufs[salt_pos].salt_buf[10]);
|
||||
salt_buf2[3] = swap32_S (salt_bufs[salt_pos].salt_buf[11]);
|
||||
salt_buf3[0] = swap32_S (salt_bufs[salt_pos].salt_buf[12]);
|
||||
salt_buf3[1] = swap32_S (salt_bufs[salt_pos].salt_buf[13]);
|
||||
salt_buf3[2] = swap32_S (salt_bufs[salt_pos].salt_buf[14]);
|
||||
salt_buf3[3] = swap32_S (salt_bufs[salt_pos].salt_buf[15]);
|
||||
|
||||
const u32 salt_len = salt_bufs[salt_pos].salt_len;
|
||||
|
||||
const u32 pw_salt_len = pw_len + salt_len;
|
||||
|
||||
/**
|
||||
* prepend salt
|
||||
*/
|
||||
|
||||
const u32 w0l = w0[0];
|
||||
|
||||
switch_buffer_by_offset_be_S (w0, w1, w2, w3, salt_len);
|
||||
|
||||
w0[0] |= salt_buf0[0];
|
||||
w0[1] |= salt_buf0[1];
|
||||
w0[2] |= salt_buf0[2];
|
||||
w0[3] |= salt_buf0[3];
|
||||
w1[0] |= salt_buf1[0];
|
||||
w1[1] |= salt_buf1[1];
|
||||
w1[2] |= salt_buf1[2];
|
||||
w1[3] |= salt_buf1[3];
|
||||
w2[0] |= salt_buf2[0];
|
||||
w2[1] |= salt_buf2[1];
|
||||
w2[2] |= salt_buf2[2];
|
||||
w2[3] |= salt_buf2[3];
|
||||
w3[0] |= salt_buf3[0];
|
||||
w3[1] |= salt_buf3[1];
|
||||
w3[2] |= salt_buf3[2];
|
||||
w3[3] |= salt_buf3[3];
|
||||
|
||||
u32x t0[4];
|
||||
u32x t1[4];
|
||||
u32x t2[4];
|
||||
u32x t3[4];
|
||||
|
||||
t0[0] = w0[0];
|
||||
t0[1] = w0[1];
|
||||
t0[2] = w0[2];
|
||||
t0[3] = w0[3];
|
||||
t1[0] = w1[0];
|
||||
t1[1] = w1[1];
|
||||
t1[2] = w1[2];
|
||||
t1[3] = w1[3];
|
||||
t2[0] = w2[0];
|
||||
t2[1] = w2[1];
|
||||
t2[2] = w2[2];
|
||||
t2[3] = w2[3];
|
||||
t3[0] = w3[0];
|
||||
t3[1] = w3[1];
|
||||
t3[2] = w3[2];
|
||||
t3[3] = w3[3];
|
||||
|
||||
/**
|
||||
* loop
|
||||
*/
|
||||
|
||||
for (u32 il_pos = 0; il_pos < il_cnt; il_pos += VECT_SIZE)
|
||||
{
|
||||
const u32x w0r = ix_create_bft (bfs_buf, il_pos);
|
||||
|
||||
const u32x w0lr = w0l | w0r;
|
||||
|
||||
overwrite_at_be_4x4 (t0, t1, t2, t3, w0lr, salt_len);
|
||||
|
||||
/**
|
||||
* sha1
|
||||
*/
|
||||
|
||||
u32x w0_t = t0[0];
|
||||
u32x w1_t = t0[1];
|
||||
u32x w2_t = t0[2];
|
||||
u32x w3_t = t0[3];
|
||||
u32x w4_t = t1[0];
|
||||
u32x w5_t = t1[1];
|
||||
u32x w6_t = t1[2];
|
||||
u32x w7_t = t1[3];
|
||||
u32x w8_t = t2[0];
|
||||
u32x w9_t = t2[1];
|
||||
u32x wa_t = t2[2];
|
||||
u32x wb_t = t2[3];
|
||||
u32x wc_t = t3[0];
|
||||
u32x wd_t = t3[1];
|
||||
u32x we_t = 0;
|
||||
u32x wf_t = pw_salt_len * 8;
|
||||
|
||||
u32x a = SHA1M_A;
|
||||
u32x b = SHA1M_B;
|
||||
u32x c = SHA1M_C;
|
||||
u32x d = SHA1M_D;
|
||||
u32x e = SHA1M_E;
|
||||
|
||||
#undef K
|
||||
#define K SHA1C00
|
||||
|
||||
SHA1_STEP (SHA1_F0o, a, b, c, d, e, w0_t);
|
||||
SHA1_STEP (SHA1_F0o, e, a, b, c, d, w1_t);
|
||||
SHA1_STEP (SHA1_F0o, d, e, a, b, c, w2_t);
|
||||
SHA1_STEP (SHA1_F0o, c, d, e, a, b, w3_t);
|
||||
SHA1_STEP (SHA1_F0o, b, c, d, e, a, w4_t);
|
||||
SHA1_STEP (SHA1_F0o, a, b, c, d, e, w5_t);
|
||||
SHA1_STEP (SHA1_F0o, e, a, b, c, d, w6_t);
|
||||
SHA1_STEP (SHA1_F0o, d, e, a, b, c, w7_t);
|
||||
SHA1_STEP (SHA1_F0o, c, d, e, a, b, w8_t);
|
||||
SHA1_STEP (SHA1_F0o, b, c, d, e, a, w9_t);
|
||||
SHA1_STEP (SHA1_F0o, a, b, c, d, e, wa_t);
|
||||
SHA1_STEP (SHA1_F0o, e, a, b, c, d, wb_t);
|
||||
SHA1_STEP (SHA1_F0o, d, e, a, b, c, wc_t);
|
||||
SHA1_STEP (SHA1_F0o, c, d, e, a, b, wd_t);
|
||||
SHA1_STEP (SHA1_F0o, b, c, d, e, a, we_t);
|
||||
SHA1_STEP (SHA1_F0o, a, b, c, d, e, wf_t);
|
||||
w0_t = rotl32 ((wd_t ^ w8_t ^ w2_t ^ w0_t), 1u); SHA1_STEP (SHA1_F0o, e, a, b, c, d, w0_t);
|
||||
w1_t = rotl32 ((we_t ^ w9_t ^ w3_t ^ w1_t), 1u); SHA1_STEP (SHA1_F0o, d, e, a, b, c, w1_t);
|
||||
w2_t = rotl32 ((wf_t ^ wa_t ^ w4_t ^ w2_t), 1u); SHA1_STEP (SHA1_F0o, c, d, e, a, b, w2_t);
|
||||
w3_t = rotl32 ((w0_t ^ wb_t ^ w5_t ^ w3_t), 1u); SHA1_STEP (SHA1_F0o, b, c, d, e, a, w3_t);
|
||||
|
||||
#undef K
|
||||
#define K SHA1C01
|
||||
|
||||
w4_t = rotl32 ((w1_t ^ wc_t ^ w6_t ^ w4_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w4_t);
|
||||
w5_t = rotl32 ((w2_t ^ wd_t ^ w7_t ^ w5_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, w5_t);
|
||||
w6_t = rotl32 ((w3_t ^ we_t ^ w8_t ^ w6_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w6_t);
|
||||
w7_t = rotl32 ((w4_t ^ wf_t ^ w9_t ^ w7_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w7_t);
|
||||
w8_t = rotl32 ((w5_t ^ w0_t ^ wa_t ^ w8_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w8_t);
|
||||
w9_t = rotl32 ((w6_t ^ w1_t ^ wb_t ^ w9_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w9_t);
|
||||
wa_t = rotl32 ((w7_t ^ w2_t ^ wc_t ^ wa_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, wa_t);
|
||||
wb_t = rotl32 ((w8_t ^ w3_t ^ wd_t ^ wb_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, wb_t);
|
||||
wc_t = rotl32 ((w9_t ^ w4_t ^ we_t ^ wc_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, wc_t);
|
||||
wd_t = rotl32 ((wa_t ^ w5_t ^ wf_t ^ wd_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, wd_t);
|
||||
we_t = rotl32 ((wb_t ^ w6_t ^ w0_t ^ we_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, we_t);
|
||||
wf_t = rotl32 ((wc_t ^ w7_t ^ w1_t ^ wf_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, wf_t);
|
||||
w0_t = rotl32 ((wd_t ^ w8_t ^ w2_t ^ w0_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w0_t);
|
||||
w1_t = rotl32 ((we_t ^ w9_t ^ w3_t ^ w1_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w1_t);
|
||||
w2_t = rotl32 ((wf_t ^ wa_t ^ w4_t ^ w2_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w2_t);
|
||||
w3_t = rotl32 ((w0_t ^ wb_t ^ w5_t ^ w3_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w3_t);
|
||||
w4_t = rotl32 ((w1_t ^ wc_t ^ w6_t ^ w4_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, w4_t);
|
||||
w5_t = rotl32 ((w2_t ^ wd_t ^ w7_t ^ w5_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w5_t);
|
||||
w6_t = rotl32 ((w3_t ^ we_t ^ w8_t ^ w6_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w6_t);
|
||||
w7_t = rotl32 ((w4_t ^ wf_t ^ w9_t ^ w7_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w7_t);
|
||||
|
||||
#undef K
|
||||
#define K SHA1C02
|
||||
|
||||
w8_t = rotl32 ((w5_t ^ w0_t ^ wa_t ^ w8_t), 1u); SHA1_STEP (SHA1_F2o, a, b, c, d, e, w8_t);
|
||||
w9_t = rotl32 ((w6_t ^ w1_t ^ wb_t ^ w9_t), 1u); SHA1_STEP (SHA1_F2o, e, a, b, c, d, w9_t);
|
||||
wa_t = rotl32 ((w7_t ^ w2_t ^ wc_t ^ wa_t), 1u); SHA1_STEP (SHA1_F2o, d, e, a, b, c, wa_t);
|
||||
wb_t = rotl32 ((w8_t ^ w3_t ^ wd_t ^ wb_t), 1u); SHA1_STEP (SHA1_F2o, c, d, e, a, b, wb_t);
|
||||
wc_t = rotl32 ((w9_t ^ w4_t ^ we_t ^ wc_t), 1u); SHA1_STEP (SHA1_F2o, b, c, d, e, a, wc_t);
|
||||
wd_t = rotl32 ((wa_t ^ w5_t ^ wf_t ^ wd_t), 1u); SHA1_STEP (SHA1_F2o, a, b, c, d, e, wd_t);
|
||||
we_t = rotl32 ((wb_t ^ w6_t ^ w0_t ^ we_t), 1u); SHA1_STEP (SHA1_F2o, e, a, b, c, d, we_t);
|
||||
wf_t = rotl32 ((wc_t ^ w7_t ^ w1_t ^ wf_t), 1u); SHA1_STEP (SHA1_F2o, d, e, a, b, c, wf_t);
|
||||
w0_t = rotl32 ((wd_t ^ w8_t ^ w2_t ^ w0_t), 1u); SHA1_STEP (SHA1_F2o, c, d, e, a, b, w0_t);
|
||||
w1_t = rotl32 ((we_t ^ w9_t ^ w3_t ^ w1_t), 1u); SHA1_STEP (SHA1_F2o, b, c, d, e, a, w1_t);
|
||||
w2_t = rotl32 ((wf_t ^ wa_t ^ w4_t ^ w2_t), 1u); SHA1_STEP (SHA1_F2o, a, b, c, d, e, w2_t);
|
||||
w3_t = rotl32 ((w0_t ^ wb_t ^ w5_t ^ w3_t), 1u); SHA1_STEP (SHA1_F2o, e, a, b, c, d, w3_t);
|
||||
w4_t = rotl32 ((w1_t ^ wc_t ^ w6_t ^ w4_t), 1u); SHA1_STEP (SHA1_F2o, d, e, a, b, c, w4_t);
|
||||
w5_t = rotl32 ((w2_t ^ wd_t ^ w7_t ^ w5_t), 1u); SHA1_STEP (SHA1_F2o, c, d, e, a, b, w5_t);
|
||||
w6_t = rotl32 ((w3_t ^ we_t ^ w8_t ^ w6_t), 1u); SHA1_STEP (SHA1_F2o, b, c, d, e, a, w6_t);
|
||||
w7_t = rotl32 ((w4_t ^ wf_t ^ w9_t ^ w7_t), 1u); SHA1_STEP (SHA1_F2o, a, b, c, d, e, w7_t);
|
||||
w8_t = rotl32 ((w5_t ^ w0_t ^ wa_t ^ w8_t), 1u); SHA1_STEP (SHA1_F2o, e, a, b, c, d, w8_t);
|
||||
w9_t = rotl32 ((w6_t ^ w1_t ^ wb_t ^ w9_t), 1u); SHA1_STEP (SHA1_F2o, d, e, a, b, c, w9_t);
|
||||
wa_t = rotl32 ((w7_t ^ w2_t ^ wc_t ^ wa_t), 1u); SHA1_STEP (SHA1_F2o, c, d, e, a, b, wa_t);
|
||||
wb_t = rotl32 ((w8_t ^ w3_t ^ wd_t ^ wb_t), 1u); SHA1_STEP (SHA1_F2o, b, c, d, e, a, wb_t);
|
||||
|
||||
#undef K
|
||||
#define K SHA1C03
|
||||
|
||||
wc_t = rotl32 ((w9_t ^ w4_t ^ we_t ^ wc_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, wc_t);
|
||||
wd_t = rotl32 ((wa_t ^ w5_t ^ wf_t ^ wd_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, wd_t);
|
||||
we_t = rotl32 ((wb_t ^ w6_t ^ w0_t ^ we_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, we_t);
|
||||
wf_t = rotl32 ((wc_t ^ w7_t ^ w1_t ^ wf_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, wf_t);
|
||||
w0_t = rotl32 ((wd_t ^ w8_t ^ w2_t ^ w0_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w0_t);
|
||||
w1_t = rotl32 ((we_t ^ w9_t ^ w3_t ^ w1_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w1_t);
|
||||
w2_t = rotl32 ((wf_t ^ wa_t ^ w4_t ^ w2_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, w2_t);
|
||||
w3_t = rotl32 ((w0_t ^ wb_t ^ w5_t ^ w3_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w3_t);
|
||||
w4_t = rotl32 ((w1_t ^ wc_t ^ w6_t ^ w4_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w4_t);
|
||||
w5_t = rotl32 ((w2_t ^ wd_t ^ w7_t ^ w5_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w5_t);
|
||||
w6_t = rotl32 ((w3_t ^ we_t ^ w8_t ^ w6_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w6_t);
|
||||
w7_t = rotl32 ((w4_t ^ wf_t ^ w9_t ^ w7_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, w7_t);
|
||||
w8_t = rotl32 ((w5_t ^ w0_t ^ wa_t ^ w8_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w8_t);
|
||||
w9_t = rotl32 ((w6_t ^ w1_t ^ wb_t ^ w9_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w9_t);
|
||||
wa_t = rotl32 ((w7_t ^ w2_t ^ wc_t ^ wa_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, wa_t);
|
||||
wb_t = rotl32 ((w8_t ^ w3_t ^ wd_t ^ wb_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, wb_t);
|
||||
|
||||
if (MATCHES_NONE_VS (e, e_rev)) continue;
|
||||
|
||||
wc_t = rotl32 ((w9_t ^ w4_t ^ we_t ^ wc_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, wc_t);
|
||||
wd_t = rotl32 ((wa_t ^ w5_t ^ wf_t ^ wd_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, wd_t);
|
||||
we_t = rotl32 ((wb_t ^ w6_t ^ w0_t ^ we_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, we_t);
|
||||
wf_t = rotl32 ((wc_t ^ w7_t ^ w1_t ^ wf_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, wf_t);
|
||||
|
||||
COMPARE_S_SIMD (d, e, c, b);
|
||||
}
|
||||
}
|
||||
|
||||
__kernel void m00134_m04 (__global pw_t *pws, __global kernel_rule_t *rules_buf, __global comb_t *combs_buf, __global bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global u32 *bitmaps_buf_s1_a, __global u32 *bitmaps_buf_s1_b, __global u32 *bitmaps_buf_s1_c, __global u32 *bitmaps_buf_s1_d, __global u32 *bitmaps_buf_s2_a, __global u32 *bitmaps_buf_s2_b, __global u32 *bitmaps_buf_s2_c, __global u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global digest_t *digests_buf, __global u32 *hashes_shown, __global salt_t *salt_bufs, __global void *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
|
||||
{
|
||||
/**
|
||||
* base
|
||||
*/
|
||||
|
||||
const u32 gid = get_global_id (0);
|
||||
|
||||
if (gid >= gid_max) return;
|
||||
|
||||
u32 w0[4];
|
||||
|
||||
w0[0] = pws[gid].i[ 0];
|
||||
w0[1] = pws[gid].i[ 1];
|
||||
w0[2] = pws[gid].i[ 2];
|
||||
w0[3] = pws[gid].i[ 3];
|
||||
|
||||
u32 w1[4];
|
||||
|
||||
w1[0] = 0;
|
||||
w1[1] = 0;
|
||||
w1[2] = 0;
|
||||
w1[3] = 0;
|
||||
|
||||
u32 w2[4];
|
||||
|
||||
w2[0] = 0;
|
||||
w2[1] = 0;
|
||||
w2[2] = 0;
|
||||
w2[3] = 0;
|
||||
|
||||
u32 w3[4];
|
||||
|
||||
w3[0] = 0;
|
||||
w3[1] = 0;
|
||||
w3[2] = 0;
|
||||
w3[3] = 0;
|
||||
|
||||
const u32 pw_len = pws[gid].pw_len;
|
||||
|
||||
/**
|
||||
* main
|
||||
*/
|
||||
|
||||
m00134m (w0, w1, w2, w3, pw_len, pws, rules_buf, combs_buf, bfs_buf, tmps, hooks, bitmaps_buf_s1_a, bitmaps_buf_s1_b, bitmaps_buf_s1_c, bitmaps_buf_s1_d, bitmaps_buf_s2_a, bitmaps_buf_s2_b, bitmaps_buf_s2_c, bitmaps_buf_s2_d, plains_buf, digests_buf, hashes_shown, salt_bufs, esalt_bufs, d_return_buf, d_scryptV_buf, bitmap_mask, bitmap_shift1, bitmap_shift2, salt_pos, loop_pos, loop_cnt, il_cnt, digests_cnt, digests_offset);
|
||||
}
|
||||
|
||||
__kernel void m00134_m08 (__global pw_t *pws, __global kernel_rule_t *rules_buf, __global comb_t *combs_buf, __global bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global u32 *bitmaps_buf_s1_a, __global u32 *bitmaps_buf_s1_b, __global u32 *bitmaps_buf_s1_c, __global u32 *bitmaps_buf_s1_d, __global u32 *bitmaps_buf_s2_a, __global u32 *bitmaps_buf_s2_b, __global u32 *bitmaps_buf_s2_c, __global u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global digest_t *digests_buf, __global u32 *hashes_shown, __global salt_t *salt_bufs, __global void *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
|
||||
{
|
||||
/**
|
||||
* base
|
||||
*/
|
||||
|
||||
const u32 gid = get_global_id (0);
|
||||
|
||||
if (gid >= gid_max) return;
|
||||
|
||||
u32 w0[4];
|
||||
|
||||
w0[0] = pws[gid].i[ 0];
|
||||
w0[1] = pws[gid].i[ 1];
|
||||
w0[2] = pws[gid].i[ 2];
|
||||
w0[3] = pws[gid].i[ 3];
|
||||
|
||||
u32 w1[4];
|
||||
|
||||
w1[0] = pws[gid].i[ 4];
|
||||
w1[1] = pws[gid].i[ 5];
|
||||
w1[2] = pws[gid].i[ 6];
|
||||
w1[3] = pws[gid].i[ 7];
|
||||
|
||||
u32 w2[4];
|
||||
|
||||
w2[0] = 0;
|
||||
w2[1] = 0;
|
||||
w2[2] = 0;
|
||||
w2[3] = 0;
|
||||
|
||||
u32 w3[4];
|
||||
|
||||
w3[0] = 0;
|
||||
w3[1] = 0;
|
||||
w3[2] = 0;
|
||||
w3[3] = 0;
|
||||
|
||||
const u32 pw_len = pws[gid].pw_len;
|
||||
|
||||
/**
|
||||
* main
|
||||
*/
|
||||
|
||||
m00134m (w0, w1, w2, w3, pw_len, pws, rules_buf, combs_buf, bfs_buf, tmps, hooks, bitmaps_buf_s1_a, bitmaps_buf_s1_b, bitmaps_buf_s1_c, bitmaps_buf_s1_d, bitmaps_buf_s2_a, bitmaps_buf_s2_b, bitmaps_buf_s2_c, bitmaps_buf_s2_d, plains_buf, digests_buf, hashes_shown, salt_bufs, esalt_bufs, d_return_buf, d_scryptV_buf, bitmap_mask, bitmap_shift1, bitmap_shift2, salt_pos, loop_pos, loop_cnt, il_cnt, digests_cnt, digests_offset);
|
||||
}
|
||||
|
||||
__kernel void m00134_m16 (__global pw_t *pws, __global kernel_rule_t *rules_buf, __global comb_t *combs_buf, __global bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global u32 *bitmaps_buf_s1_a, __global u32 *bitmaps_buf_s1_b, __global u32 *bitmaps_buf_s1_c, __global u32 *bitmaps_buf_s1_d, __global u32 *bitmaps_buf_s2_a, __global u32 *bitmaps_buf_s2_b, __global u32 *bitmaps_buf_s2_c, __global u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global digest_t *digests_buf, __global u32 *hashes_shown, __global salt_t *salt_bufs, __global void *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
|
||||
{
|
||||
/**
|
||||
* base
|
||||
*/
|
||||
|
||||
const u32 gid = get_global_id (0);
|
||||
|
||||
if (gid >= gid_max) return;
|
||||
|
||||
u32 w0[4];
|
||||
|
||||
w0[0] = pws[gid].i[ 0];
|
||||
w0[1] = pws[gid].i[ 1];
|
||||
w0[2] = pws[gid].i[ 2];
|
||||
w0[3] = pws[gid].i[ 3];
|
||||
|
||||
u32 w1[4];
|
||||
|
||||
w1[0] = pws[gid].i[ 4];
|
||||
w1[1] = pws[gid].i[ 5];
|
||||
w1[2] = pws[gid].i[ 6];
|
||||
w1[3] = pws[gid].i[ 7];
|
||||
|
||||
u32 w2[4];
|
||||
|
||||
w2[0] = pws[gid].i[ 8];
|
||||
w2[1] = pws[gid].i[ 9];
|
||||
w2[2] = pws[gid].i[10];
|
||||
w2[3] = pws[gid].i[11];
|
||||
|
||||
u32 w3[4];
|
||||
|
||||
w3[0] = pws[gid].i[12];
|
||||
w3[1] = pws[gid].i[13];
|
||||
w3[2] = 0;
|
||||
w3[3] = 0;
|
||||
|
||||
const u32 pw_len = pws[gid].pw_len;
|
||||
|
||||
/**
|
||||
* main
|
||||
*/
|
||||
|
||||
m00134m (w0, w1, w2, w3, pw_len, pws, rules_buf, combs_buf, bfs_buf, tmps, hooks, bitmaps_buf_s1_a, bitmaps_buf_s1_b, bitmaps_buf_s1_c, bitmaps_buf_s1_d, bitmaps_buf_s2_a, bitmaps_buf_s2_b, bitmaps_buf_s2_c, bitmaps_buf_s2_d, plains_buf, digests_buf, hashes_shown, salt_bufs, esalt_bufs, d_return_buf, d_scryptV_buf, bitmap_mask, bitmap_shift1, bitmap_shift2, salt_pos, loop_pos, loop_cnt, il_cnt, digests_cnt, digests_offset);
|
||||
}
|
||||
|
||||
__kernel void m00134_s04 (__global pw_t *pws, __global kernel_rule_t *rules_buf, __global comb_t *combs_buf, __global bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global u32 *bitmaps_buf_s1_a, __global u32 *bitmaps_buf_s1_b, __global u32 *bitmaps_buf_s1_c, __global u32 *bitmaps_buf_s1_d, __global u32 *bitmaps_buf_s2_a, __global u32 *bitmaps_buf_s2_b, __global u32 *bitmaps_buf_s2_c, __global u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global digest_t *digests_buf, __global u32 *hashes_shown, __global salt_t *salt_bufs, __global void *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
|
||||
{
|
||||
/**
|
||||
* base
|
||||
*/
|
||||
|
||||
const u32 gid = get_global_id (0);
|
||||
|
||||
if (gid >= gid_max) return;
|
||||
|
||||
u32 w0[4];
|
||||
|
||||
w0[0] = pws[gid].i[ 0];
|
||||
w0[1] = pws[gid].i[ 1];
|
||||
w0[2] = pws[gid].i[ 2];
|
||||
w0[3] = pws[gid].i[ 3];
|
||||
|
||||
u32 w1[4];
|
||||
|
||||
w1[0] = 0;
|
||||
w1[1] = 0;
|
||||
w1[2] = 0;
|
||||
w1[3] = 0;
|
||||
|
||||
u32 w2[4];
|
||||
|
||||
w2[0] = 0;
|
||||
w2[1] = 0;
|
||||
w2[2] = 0;
|
||||
w2[3] = 0;
|
||||
|
||||
u32 w3[4];
|
||||
|
||||
w3[0] = 0;
|
||||
w3[1] = 0;
|
||||
w3[2] = 0;
|
||||
w3[3] = 0;
|
||||
|
||||
const u32 pw_len = pws[gid].pw_len;
|
||||
|
||||
/**
|
||||
* main
|
||||
*/
|
||||
|
||||
m00134s (w0, w1, w2, w3, pw_len, pws, rules_buf, combs_buf, bfs_buf, tmps, hooks, bitmaps_buf_s1_a, bitmaps_buf_s1_b, bitmaps_buf_s1_c, bitmaps_buf_s1_d, bitmaps_buf_s2_a, bitmaps_buf_s2_b, bitmaps_buf_s2_c, bitmaps_buf_s2_d, plains_buf, digests_buf, hashes_shown, salt_bufs, esalt_bufs, d_return_buf, d_scryptV_buf, bitmap_mask, bitmap_shift1, bitmap_shift2, salt_pos, loop_pos, loop_cnt, il_cnt, digests_cnt, digests_offset);
|
||||
}
|
||||
|
||||
__kernel void m00134_s08 (__global pw_t *pws, __global kernel_rule_t *rules_buf, __global comb_t *combs_buf, __global bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global u32 *bitmaps_buf_s1_a, __global u32 *bitmaps_buf_s1_b, __global u32 *bitmaps_buf_s1_c, __global u32 *bitmaps_buf_s1_d, __global u32 *bitmaps_buf_s2_a, __global u32 *bitmaps_buf_s2_b, __global u32 *bitmaps_buf_s2_c, __global u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global digest_t *digests_buf, __global u32 *hashes_shown, __global salt_t *salt_bufs, __global void *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
|
||||
{
|
||||
/**
|
||||
* base
|
||||
*/
|
||||
|
||||
const u32 gid = get_global_id (0);
|
||||
|
||||
if (gid >= gid_max) return;
|
||||
|
||||
u32 w0[4];
|
||||
|
||||
w0[0] = pws[gid].i[ 0];
|
||||
w0[1] = pws[gid].i[ 1];
|
||||
w0[2] = pws[gid].i[ 2];
|
||||
w0[3] = pws[gid].i[ 3];
|
||||
|
||||
u32 w1[4];
|
||||
|
||||
w1[0] = pws[gid].i[ 4];
|
||||
w1[1] = pws[gid].i[ 5];
|
||||
w1[2] = pws[gid].i[ 6];
|
||||
w1[3] = pws[gid].i[ 7];
|
||||
|
||||
u32 w2[4];
|
||||
|
||||
w2[0] = 0;
|
||||
w2[1] = 0;
|
||||
w2[2] = 0;
|
||||
w2[3] = 0;
|
||||
|
||||
u32 w3[4];
|
||||
|
||||
w3[0] = 0;
|
||||
w3[1] = 0;
|
||||
w3[2] = 0;
|
||||
w3[3] = 0;
|
||||
|
||||
const u32 pw_len = pws[gid].pw_len;
|
||||
|
||||
/**
|
||||
* main
|
||||
*/
|
||||
|
||||
m00134s (w0, w1, w2, w3, pw_len, pws, rules_buf, combs_buf, bfs_buf, tmps, hooks, bitmaps_buf_s1_a, bitmaps_buf_s1_b, bitmaps_buf_s1_c, bitmaps_buf_s1_d, bitmaps_buf_s2_a, bitmaps_buf_s2_b, bitmaps_buf_s2_c, bitmaps_buf_s2_d, plains_buf, digests_buf, hashes_shown, salt_bufs, esalt_bufs, d_return_buf, d_scryptV_buf, bitmap_mask, bitmap_shift1, bitmap_shift2, salt_pos, loop_pos, loop_cnt, il_cnt, digests_cnt, digests_offset);
|
||||
}
|
||||
|
||||
__kernel void m00134_s16 (__global pw_t *pws, __global kernel_rule_t *rules_buf, __global comb_t *combs_buf, __global bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global u32 *bitmaps_buf_s1_a, __global u32 *bitmaps_buf_s1_b, __global u32 *bitmaps_buf_s1_c, __global u32 *bitmaps_buf_s1_d, __global u32 *bitmaps_buf_s2_a, __global u32 *bitmaps_buf_s2_b, __global u32 *bitmaps_buf_s2_c, __global u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global digest_t *digests_buf, __global u32 *hashes_shown, __global salt_t *salt_bufs, __global void *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
|
||||
{
|
||||
/**
|
||||
* base
|
||||
*/
|
||||
|
||||
const u32 gid = get_global_id (0);
|
||||
|
||||
if (gid >= gid_max) return;
|
||||
|
||||
u32 w0[4];
|
||||
|
||||
w0[0] = pws[gid].i[ 0];
|
||||
w0[1] = pws[gid].i[ 1];
|
||||
w0[2] = pws[gid].i[ 2];
|
||||
w0[3] = pws[gid].i[ 3];
|
||||
|
||||
u32 w1[4];
|
||||
|
||||
w1[0] = pws[gid].i[ 4];
|
||||
w1[1] = pws[gid].i[ 5];
|
||||
w1[2] = pws[gid].i[ 6];
|
||||
w1[3] = pws[gid].i[ 7];
|
||||
|
||||
u32 w2[4];
|
||||
|
||||
w2[0] = pws[gid].i[ 8];
|
||||
w2[1] = pws[gid].i[ 9];
|
||||
w2[2] = pws[gid].i[10];
|
||||
w2[3] = pws[gid].i[11];
|
||||
|
||||
u32 w3[4];
|
||||
|
||||
w3[0] = pws[gid].i[12];
|
||||
w3[1] = pws[gid].i[13];
|
||||
w3[2] = 0;
|
||||
w3[3] = 0;
|
||||
|
||||
const u32 pw_len = pws[gid].pw_len;
|
||||
|
||||
/**
|
||||
* main
|
||||
*/
|
||||
|
||||
m00134s (w0, w1, w2, w3, pw_len, pws, rules_buf, combs_buf, bfs_buf, tmps, hooks, bitmaps_buf_s1_a, bitmaps_buf_s1_b, bitmaps_buf_s1_c, bitmaps_buf_s1_d, bitmaps_buf_s2_a, bitmaps_buf_s2_b, bitmaps_buf_s2_c, bitmaps_buf_s2_d, plains_buf, digests_buf, hashes_shown, salt_bufs, esalt_bufs, d_return_buf, d_scryptV_buf, bitmap_mask, bitmap_shift1, bitmap_shift2, salt_pos, loop_pos, loop_cnt, il_cnt, digests_cnt, digests_offset);
|
||||
}
|
@ -1801,3 +1801,7 @@ Trac: #197
|
||||
Type: Change
|
||||
File: Host
|
||||
Desc: new default status-timer value is 10 seconds instead of 1 minute
|
||||
|
||||
Type: Feature
|
||||
File: Kernel
|
||||
Desc: Added new hash mode -m 13500 = PeopleSoft PS_TOKEN
|
||||
|
@ -355,6 +355,7 @@ extern hc_thread_mutex_t mux_display;
|
||||
#define HT_13200 "AxCrypt"
|
||||
#define HT_13300 "AxCrypt in memory SHA1"
|
||||
#define HT_13400 "Keepass 1 (AES/Twofish) and Keepass 2 (AES)"
|
||||
#define HT_13500 "PeopleSoft PS_TOKEN"
|
||||
|
||||
#define HT_00011 "Joomla < 2.5.18"
|
||||
#define HT_00012 "PostgreSQL"
|
||||
@ -697,6 +698,8 @@ extern hc_thread_mutex_t mux_display;
|
||||
#define DISPLAY_LEN_MAX_13300 1 + 12 + 1 + 40
|
||||
#define DISPLAY_LEN_MIN_13400 1 + 7 + 1 + 1 + 1 + 1 + 1 + 1 + 32 + 1 + 64 + 1 + 32 + 1 + 64 + 1 + 1 + 1 + 1
|
||||
#define DISPLAY_LEN_MAX_13400 1 + 7 + 1 + 1 + 10 + 1 + 3 + 1 + 64 + 1 + 64 + 1 + 32 + 1 + 64 + 1 + 4 + 1 + 600000 + 1 + 2 + 1 + 64
|
||||
#define DISPLAY_LEN_MIN_13500 40 + 1 + 32
|
||||
#define DISPLAY_LEN_MAX_13500 40 + 1 + 1024
|
||||
|
||||
#define DISPLAY_LEN_MIN_11 32 + 1 + 16
|
||||
#define DISPLAY_LEN_MAX_11 32 + 1 + 32
|
||||
@ -1601,6 +1604,7 @@ int androidfde_samsung_parse_hash (char *input_buf, uint input_len, hash_t *hash
|
||||
int axcrypt_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
|
||||
int sha1axcrypt_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
|
||||
int keepass_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
|
||||
int pstoken_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
|
||||
|
||||
void load_kernel (const char *kernel_file, int num_devices, size_t *kernel_lengths, const u8 **kernel_sources);
|
||||
void writeProgramBin (char *dst, u8 *binary, size_t binary_size);
|
||||
|
@ -702,6 +702,13 @@ typedef struct
|
||||
|
||||
} psafe3_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
u32 salt_buf[128];
|
||||
u32 salt_len;
|
||||
|
||||
} pstoken_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
char plain_buf[256];
|
||||
|
@ -148,7 +148,7 @@ double TARGET_MS_PROFILE[3] = { 8, 16, 96 };
|
||||
|
||||
#define MAX_DICTSTAT 10000
|
||||
|
||||
#define NUM_DEFAULT_BENCHMARK_ALGORITHMS 135
|
||||
#define NUM_DEFAULT_BENCHMARK_ALGORITHMS 136
|
||||
|
||||
#define global_free(attr) \
|
||||
{ \
|
||||
@ -268,6 +268,7 @@ static uint default_benchmark_algorithms[NUM_DEFAULT_BENCHMARK_ALGORITHMS] =
|
||||
8700,
|
||||
9100,
|
||||
133,
|
||||
13500,
|
||||
11600,
|
||||
12500,
|
||||
13000,
|
||||
@ -696,6 +697,7 @@ const char *USAGE_BIG[] =
|
||||
" 8700 = Lotus Notes/Domino 6",
|
||||
" 9100 = Lotus Notes/Domino 8",
|
||||
" 133 = PeopleSoft",
|
||||
" 13500 = PeopleSoft Token",
|
||||
"",
|
||||
"[[ Archives ]]",
|
||||
"",
|
||||
@ -5971,7 +5973,7 @@ int main (int argc, char **argv)
|
||||
return (-1);
|
||||
}
|
||||
|
||||
if (hash_mode_chgd && hash_mode > 13400) // just added to remove compiler warnings for hash_mode_chgd
|
||||
if (hash_mode_chgd && hash_mode > 13500) // just added to remove compiler warnings for hash_mode_chgd
|
||||
{
|
||||
log_error ("ERROR: Invalid hash-type specified");
|
||||
|
||||
@ -10297,6 +10299,28 @@ int main (int argc, char **argv)
|
||||
dgst_pos3 = 3;
|
||||
break;
|
||||
|
||||
case 13500: hash_type = HASH_TYPE_SHA1;
|
||||
salt_type = SALT_TYPE_EMBEDDED;
|
||||
attack_exec = ATTACK_EXEC_INSIDE_KERNEL;
|
||||
opts_type = OPTS_TYPE_PT_GENERATE_BE
|
||||
| OPTS_TYPE_PT_UNICODE
|
||||
| OPTS_TYPE_PT_ADD80;
|
||||
kern_type = KERN_TYPE_SHA1_SLTPWU;
|
||||
dgst_size = DGST_SIZE_4_5;
|
||||
parse_func = pstoken_parse_hash;
|
||||
sort_by_digest = sort_by_digest_4_5;
|
||||
opti_type = OPTI_TYPE_ZERO_BYTE
|
||||
| OPTI_TYPE_PRECOMPUTE_INIT
|
||||
| OPTI_TYPE_EARLY_SKIP
|
||||
| OPTI_TYPE_NOT_ITERATED
|
||||
| OPTI_TYPE_PREPENDED_SALT
|
||||
| OPTI_TYPE_RAW_HASH;
|
||||
dgst_pos0 = 3;
|
||||
dgst_pos1 = 4;
|
||||
dgst_pos2 = 2;
|
||||
dgst_pos3 = 1;
|
||||
break;
|
||||
|
||||
default: usage_mini_print (PROGNAME); return (-1);
|
||||
}
|
||||
|
||||
@ -10402,6 +10426,7 @@ int main (int argc, char **argv)
|
||||
case 13000: esalt_size = sizeof (rar5_t); break;
|
||||
case 13100: esalt_size = sizeof (krb5tgs_t); break;
|
||||
case 13400: esalt_size = sizeof (keepass_t); break;
|
||||
case 13500: esalt_size = sizeof (pstoken_t); break;
|
||||
}
|
||||
|
||||
data.esalt_size = esalt_size;
|
||||
|
74
src/shared.c
74
src/shared.c
@ -5853,6 +5853,7 @@ char *strhashtype (const uint hash_mode)
|
||||
case 13200: return ((char *) HT_13200); break;
|
||||
case 13300: return ((char *) HT_13300); break;
|
||||
case 13400: return ((char *) HT_13400); break;
|
||||
case 13500: return ((char *) HT_13500); break;
|
||||
}
|
||||
|
||||
return ((char *) "Unknown");
|
||||
@ -8479,6 +8480,31 @@ void ascii_digest (char *out_buf, uint salt_pos, uint digest_pos)
|
||||
sprintf (ptr_data, "%08x", ptr_keyfile[i]);
|
||||
}
|
||||
}
|
||||
else if (hash_mode == 13500)
|
||||
{
|
||||
pstoken_t *pstokens = (pstoken_t *) data.esalts_buf;
|
||||
pstoken_t *pstoken = &pstokens[salt_pos];
|
||||
|
||||
uint mysalt = pstoken->salt_len > 512 ? 512 : pstoken->salt_len;
|
||||
|
||||
char pstoken_tmp[1024 + 1];
|
||||
u8 *salt_buf_ptr = (u8 *) pstoken->salt_buf;
|
||||
|
||||
memset(pstoken_tmp, 0, sizeof (pstoken_tmp));
|
||||
|
||||
for (uint i = 0; i < mysalt; i++)
|
||||
{
|
||||
snprintf(&pstoken_tmp[i*2], 2, "%02x", salt_buf_ptr[i]);
|
||||
}
|
||||
|
||||
snprintf (out_buf, len-1, "%08x%08x%08x%08x%08x:%s",
|
||||
digest_buf[0],
|
||||
digest_buf[1],
|
||||
digest_buf[2],
|
||||
digest_buf[3],
|
||||
digest_buf[4],
|
||||
pstoken_tmp);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (hash_type == HASH_TYPE_MD4)
|
||||
@ -11755,6 +11781,54 @@ int sha1s_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf)
|
||||
return (PARSER_OK);
|
||||
}
|
||||
|
||||
int pstoken_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf)
|
||||
{
|
||||
if (data.opts_type & OPTS_TYPE_ST_HEX)
|
||||
{
|
||||
if ((input_len < DISPLAY_LEN_MIN_13500) || (input_len > DISPLAY_LEN_MAX_13500)) return (PARSER_GLOBAL_LENGTH);
|
||||
}
|
||||
else
|
||||
{
|
||||
if ((input_len < DISPLAY_LEN_MIN_13500) || (input_len > DISPLAY_LEN_MAX_13500)) return (PARSER_GLOBAL_LENGTH);
|
||||
}
|
||||
|
||||
u32 *digest = (u32 *) hash_buf->digest;
|
||||
salt_t *salt = hash_buf->salt;
|
||||
pstoken_t *pstoken = (pstoken_t *) hash_buf->esalt;
|
||||
u8 pstoken_tmp[DISPLAY_LEN_MAX_13500 - 40 - 1];
|
||||
|
||||
memset(pstoken_tmp, 0, DISPLAY_LEN_MAX_13500 - 40 - 1);
|
||||
|
||||
digest[0] = hex_to_u32 ((const u8 *) &input_buf[ 0]);
|
||||
digest[1] = hex_to_u32 ((const u8 *) &input_buf[ 8]);
|
||||
digest[2] = hex_to_u32 ((const u8 *) &input_buf[16]);
|
||||
digest[3] = hex_to_u32 ((const u8 *) &input_buf[24]);
|
||||
digest[4] = hex_to_u32 ((const u8 *) &input_buf[32]);
|
||||
|
||||
if (input_buf[40] != data.separator) return (PARSER_SEPARATOR_UNMATCHED);
|
||||
|
||||
uint salt_len = input_len - 40 - 1;
|
||||
|
||||
char *salt_buf = input_buf + 40 + 1;
|
||||
|
||||
if (salt_len == UINT_MAX || salt_len % 2 != 0) return (PARSER_SALT_LENGTH);
|
||||
|
||||
for (uint i = 0; i < salt_len / 2; i++)
|
||||
{
|
||||
pstoken_tmp[i] = hex_to_u8 ((const u8 *) &salt_buf[i * 2]);
|
||||
}
|
||||
|
||||
salt_len /= 2;
|
||||
salt->salt_len = salt_len;
|
||||
pstoken->salt_len = salt_len;
|
||||
|
||||
memcpy(salt->salt_buf, pstoken_tmp, 16);
|
||||
memcpy(pstoken->salt_buf, pstoken_tmp, salt_len);
|
||||
|
||||
return (PARSER_OK);
|
||||
}
|
||||
|
||||
|
||||
int sha1b64_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf)
|
||||
{
|
||||
if ((input_len < DISPLAY_LEN_MIN_101) || (input_len > DISPLAY_LEN_MAX_101)) return (PARSER_GLOBAL_LENGTH);
|
||||
|
@ -18,7 +18,7 @@ use Digest::HMAC_MD5 qw (hmac_md5);
|
||||
use Digest::CRC qw (crc32);
|
||||
use Crypt::PBKDF2;
|
||||
use Crypt::DES;
|
||||
use Crypt::ECB qw (encrypt PADDING_AUTO PADDING_NONE);
|
||||
use Crypt::ECB 2.00, qw (encrypt);
|
||||
use Crypt::CBC;
|
||||
use Crypt::Eksblowfish::Bcrypt qw (bcrypt en_base64);
|
||||
use Crypt::Digest::RIPEMD160 qw (ripemd160_hex);
|
||||
@ -45,11 +45,11 @@ my $hashcat = "./oclHashcat";
|
||||
|
||||
my $MAX_LEN = 55;
|
||||
|
||||
my @modes = (0, 10, 11, 12, 20, 21, 22, 23, 30, 40, 50, 60, 100, 101, 110, 111, 112, 120, 121, 122, 125, 130, 131, 132, 140, 141, 150, 160, 190, 200, 300, 400, 500, 900, 1000, 1100, 1400, 1410, 1420, 1430, 1440, 1441, 1450, 1460, 1500, 1600, 1700, 1710, 1711, 1720, 1730, 1740, 1722, 1731, 1750, 1760, 1800, 2100, 2400, 2410, 2500, 2600, 2611, 2612, 2711, 2811, 3000, 3100, 3200, 3710, 3711, 3300, 3500, 3610, 3720, 3800, 3910, 4010, 4110, 4210, 4300, 4400, 4500, 4600, 4700, 4800, 4900, 5000, 5100, 5300, 5400, 5500, 5600, 5700, 5800, 6000, 6100, 6300, 6400, 6500, 6600, 6700, 6800, 6900, 7100, 7200, 7300, 7400, 7500, 7600, 7700, 7800, 7900, 8000, 8100, 8200, 8300, 8400, 8500, 8600, 8700, 8900, 9100, 9200, 9300, 9400, 9500, 9600, 9700, 9800, 9900, 10000, 10100, 10200, 10300, 10400, 10500, 10600, 10700, 10800, 10900, 11000, 11100, 11200, 11300, 11400, 11500, 11600, 11900, 12000, 12100, 12200, 12300, 12400, 12600, 12700, 12800, 12900, 13000, 13100, 13200, 13300, 13400);
|
||||
my @modes = (0, 10, 11, 12, 20, 21, 22, 23, 30, 40, 50, 60, 100, 101, 110, 111, 112, 120, 121, 122, 125, 130, 131, 132, 140, 141, 150, 160, 190, 200, 300, 400, 500, 900, 1000, 1100, 1400, 1410, 1420, 1430, 1440, 1441, 1450, 1460, 1500, 1600, 1700, 1710, 1711, 1720, 1730, 1740, 1722, 1731, 1750, 1760, 1800, 2100, 2400, 2410, 2500, 2600, 2611, 2612, 2711, 2811, 3000, 3100, 3200, 3710, 3711, 3300, 3500, 3610, 3720, 3800, 3910, 4010, 4110, 4210, 4300, 4400, 4500, 4600, 4700, 4800, 4900, 5000, 5100, 5300, 5400, 5500, 5600, 5700, 5800, 6000, 6100, 6300, 6400, 6500, 6600, 6700, 6800, 6900, 7100, 7200, 7300, 7400, 7500, 7600, 7700, 7800, 7900, 8000, 8100, 8200, 8300, 8400, 8500, 8600, 8700, 8900, 9100, 9200, 9300, 9400, 9500, 9600, 9700, 9800, 9900, 10000, 10100, 10200, 10300, 10400, 10500, 10600, 10700, 10800, 10900, 11000, 11100, 11200, 11300, 11400, 11500, 11600, 11900, 12000, 12100, 12200, 12300, 12400, 12600, 12700, 12800, 12900, 13000, 13100, 13200, 13300, 13400, 13500);
|
||||
|
||||
my %is_unicode = map { $_ => 1 } qw(30 40 130 131 132 133 140 141 1000 1100 1430 1440 1441 1730 1740 1731 5500 5600 8000 9400 9500 9600 9700 9800);
|
||||
my %is_unicode = map { $_ => 1 } qw(30 40 130 131 132 133 140 141 1000 1100 1430 1440 1441 1730 1740 1731 5500 5600 8000 9400 9500 9600 9700 9800 13500);
|
||||
my %less_fifteen = map { $_ => 1 } qw(500 1600 1800 2400 2410 3200 6300 7400 10500 10700);
|
||||
my %allow_long_salt = map { $_ => 1 } qw(2500 5500 5600 7100 7200 7300 9400 9500 9600 9700 9800 10400 10500 10600 10700 1100 11000 11200 11300 11400 11600 12600);
|
||||
my %allow_long_salt = map { $_ => 1 } qw(2500 5500 5600 7100 7200 7300 9400 9500 9600 9700 9800 10400 10500 10600 10700 1100 11000 11200 11300 11400 11600 12600 13500);
|
||||
|
||||
my @lotus_magic_table =
|
||||
(
|
||||
@ -226,7 +226,7 @@ sub verify
|
||||
$word = substr ($line, $index + 1);
|
||||
}
|
||||
# hash:salt
|
||||
elsif ($mode == 10 || $mode == 11 || $mode == 12 || $mode == 20 || $mode == 21 || $mode == 22 || $mode == 23 || $mode == 30 || $mode == 40 || $mode == 50 || $mode == 60 || $mode == 110 || $mode == 112 || $mode == 120 || $mode == 121 || $mode == 130 || $mode == 140 || $mode == 150 || $mode == 160 || $mode == 1100 || $mode == 1410 || $mode == 1420 || $mode == 1430 || $mode == 1440 || $mode == 1450 || $mode == 1460 || $mode == 1710 || $mode == 1720 || $mode == 1730 || $mode == 1740 || $mode == 1750 || $mode == 1760 || $mode == 2410 || $mode == 2611 || $mode == 2711 || $mode == 2811 || $mode == 3100 || $mode == 3610 || $mode == 3710 || $mode == 3720 || $mode == 3800 || $mode == 3910 || $mode == 4010 || $mode == 4110 || $mode == 4210 || $mode == 4900 || $mode == 5800 || $mode == 7600 || $mode == 8400 || $mode == 11000 || $mode == 12600)
|
||||
elsif ($mode == 10 || $mode == 11 || $mode == 12 || $mode == 20 || $mode == 21 || $mode == 22 || $mode == 23 || $mode == 30 || $mode == 40 || $mode == 50 || $mode == 60 || $mode == 110 || $mode == 112 || $mode == 120 || $mode == 121 || $mode == 130 || $mode == 140 || $mode == 150 || $mode == 160 || $mode == 1100 || $mode == 1410 || $mode == 1420 || $mode == 1430 || $mode == 1440 || $mode == 1450 || $mode == 1460 || $mode == 1710 || $mode == 1720 || $mode == 1730 || $mode == 1740 || $mode == 1750 || $mode == 1760 || $mode == 2410 || $mode == 2611 || $mode == 2711 || $mode == 2811 || $mode == 3100 || $mode == 3610 || $mode == 3710 || $mode == 3720 || $mode == 3800 || $mode == 3910 || $mode == 4010 || $mode == 4110 || $mode == 4210 || $mode == 4900 || $mode == 5800 || $mode == 7600 || $mode == 8400 || $mode == 11000 || $mode == 12600 || $mode == 13500)
|
||||
{
|
||||
# get hash
|
||||
my $index1 = index ($line, ":");
|
||||
@ -3117,6 +3117,12 @@ sub passthrough
|
||||
|
||||
$tmp_hash = gen_hash ($mode, $word_buf, $salt_buf);
|
||||
}
|
||||
elsif ($mode == 13500)
|
||||
{
|
||||
$salt_buf = get_pstoken_salt ();
|
||||
|
||||
$tmp_hash = gen_hash ($mode, $word_buf, $salt_buf);
|
||||
}
|
||||
else
|
||||
{
|
||||
print "ERROR: Unsupported hash type\n";
|
||||
@ -3886,6 +3892,20 @@ sub single
|
||||
}
|
||||
}
|
||||
}
|
||||
elsif ($mode == 13500)
|
||||
{
|
||||
for (my $i = 1; $i < 16; $i++)
|
||||
{
|
||||
if ($len != 0)
|
||||
{
|
||||
rnd ($mode, $len, 16);
|
||||
}
|
||||
else
|
||||
{
|
||||
rnd ($mode, $i, 16);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -4842,9 +4862,9 @@ sub gen_hash
|
||||
|
||||
my $nthash = Authen::Passphrase::NTHash->new (passphrase => $word_buf)->hash . "\x00" x 5;
|
||||
|
||||
$ntresp .= Crypt::ECB::encrypt (setup_des_key (substr ($nthash, 0, 7)), "DES", $challenge, PADDING_NONE);
|
||||
$ntresp .= Crypt::ECB::encrypt (setup_des_key (substr ($nthash, 7, 7)), "DES", $challenge, PADDING_NONE);
|
||||
$ntresp .= Crypt::ECB::encrypt (setup_des_key (substr ($nthash, 14, 7)), "DES", $challenge, PADDING_NONE);
|
||||
$ntresp .= Crypt::ECB::encrypt (setup_des_key (substr ($nthash, 0, 7)), "DES", $challenge, "none");
|
||||
$ntresp .= Crypt::ECB::encrypt (setup_des_key (substr ($nthash, 7, 7)), "DES", $challenge, "none");
|
||||
$ntresp .= Crypt::ECB::encrypt (setup_des_key (substr ($nthash, 14, 7)), "DES", $challenge, "none");
|
||||
|
||||
$tmp_hash = sprintf ("%s::%s:%s:%s:%s", $user, $domain, $c_challenge_hex, unpack ("H*", $ntresp), $s_challenge_hex);
|
||||
}
|
||||
@ -7134,6 +7154,12 @@ END_CODE
|
||||
$keyfile_attributes);
|
||||
}
|
||||
}
|
||||
elsif ($mode == 13500)
|
||||
{
|
||||
$hash_buf = sha1_hex (pack("H*",$salt_buf) . encode ("UTF-16LE", $word_buf));
|
||||
|
||||
$tmp_hash = sprintf ("%s:%s", $hash_buf, $salt_buf);
|
||||
}
|
||||
|
||||
return ($tmp_hash);
|
||||
}
|
||||
@ -7240,6 +7266,10 @@ sub rnd
|
||||
{
|
||||
$salt_buf = get_random_keepass_salt ();
|
||||
}
|
||||
elsif ($mode == 13500)
|
||||
{
|
||||
$salt_buf = get_pstoken_salt ();
|
||||
}
|
||||
else
|
||||
{
|
||||
my @salt_arr;
|
||||
@ -8627,6 +8657,23 @@ sub get_random_keepass_salt
|
||||
return $salt_buf;
|
||||
}
|
||||
|
||||
sub get_pstoken_salt
|
||||
{
|
||||
# Cannot be fully random because of the salt structure, will use a constant salt.
|
||||
my $pstoken_const =
|
||||
"\x71\x00\x00\x00\x04\x03\x02\x01\x01\x00\x00\x00\xbc\x02" .
|
||||
"\x00\x00\x00\x00\x00\x00\x10\x50\x00\x50\x00\x57\x00\x45" .
|
||||
"\x00\x42\x00\x45\x00\x58\x00\x54\x00\x06\x45\x00\x4e\x00" .
|
||||
"\x47\x00\x0e\x50\x00\x53\x00\x46\x00\x54\x00\x5f\x00\x48" .
|
||||
"\x00\x52\x00\x34\x32\x00\x30\x00\x31\x00\x36\x00\x2d\x00" .
|
||||
"\x30\x00\x34\x00\x2d\x00\x30\x00\x38\x00\x2d\x00\x31\x00" .
|
||||
"\x39\x00\x2e\x00\x32\x00\x37\x00\x2e\x00\x30\x00\x35\x00" .
|
||||
"\x2e\x00\x30\x00\x30\x00\x30\x00\x30\x00\x30\x00\x32\x00" .
|
||||
"\x00";
|
||||
|
||||
return unpack ("H*", $pstoken_const);
|
||||
}
|
||||
|
||||
sub get_random_md5chap_salt
|
||||
{
|
||||
my $salt_buf = shift;
|
||||
|
@ -10,7 +10,7 @@
|
||||
|
||||
# missing hash types: 5200,6211,6221,6231,6241,6251,6261,6271,6281
|
||||
|
||||
HASH_TYPES="0 10 11 12 20 21 22 23 30 40 50 60 100 101 110 111 112 120 121 122 125 130 131 132 133 140 141 150 160 190 200 300 400 500 900 1000 1100 1400 1410 1420 1430 1440 1441 1450 1460 1500 1600 1700 1710 1711 1720 1722 1730 1731 1740 1750 1760 1800 2100 2400 2410 2500 2600 2611 2612 2711 2811 3000 3100 3200 3710 3711 3800 4300 4400 4500 4700 4800 4900 5000 5100 5300 5400 5500 5600 5700 5800 6000 6100 6300 6400 6500 6600 6700 6800 6900 7100 7200 7300 7400 7500 7600 7700 7800 7900 8000 8100 8200 8300 8400 8500 8600 8700 8900 9100 9200 9300 9400 9500 9600 9700 9800 9900 10000 10100 10200 10300 10400 10500 10600 10700 10800 10900 11000 11100 11200 11300 11400 11500 11600 11900 12000 12100 12200 12300 12400 12600 12800 12900 13000 13100 13200 13300 13400"
|
||||
HASH_TYPES="0 10 11 12 20 21 22 23 30 40 50 60 100 101 110 111 112 120 121 122 125 130 131 132 133 140 141 150 160 190 200 300 400 500 900 1000 1100 1400 1410 1420 1430 1440 1441 1450 1460 1500 1600 1700 1710 1711 1720 1722 1730 1731 1740 1750 1760 1800 2100 2400 2410 2500 2600 2611 2612 2711 2811 3000 3100 3200 3710 3711 3800 4300 4400 4500 4700 4800 4900 5000 5100 5300 5400 5500 5600 5700 5800 6000 6100 6300 6400 6500 6600 6700 6800 6900 7100 7200 7300 7400 7500 7600 7700 7800 7900 8000 8100 8200 8300 8400 8500 8600 8700 8900 9100 9200 9300 9400 9500 9600 9700 9800 9900 10000 10100 10200 10300 10400 10500 10600 10700 10800 10900 11000 11100 11200 11300 11400 11500 11600 11900 12000 12100 12200 12300 12400 12600 12800 12900 13000 13100 13200 13300 13400 13500"
|
||||
|
||||
#ATTACK_MODES="0 1 3 6 7"
|
||||
ATTACK_MODES="0 1 3 7"
|
||||
@ -23,7 +23,7 @@ HASHFILE_ONLY="2500"
|
||||
|
||||
NEVER_CRACK="11600"
|
||||
|
||||
SLOW_ALGOS="400 500 501 1600 1800 2100 2500 3200 5200 5800 6211 6221 6231 6241 6251 6261 6271 6281 6300 6400 6500 6600 6700 6800 7100 7200 7400 7900 8200 8800 8900 9000 9100 9200 9300 9400 9500 9600 10000 10300 10500 10700 10900 11300 11600 11900 12000 12100 12200 12300 12400 12500 12800 12900 13000 13200 13400"
|
||||
SLOW_ALGOS="400 500 501 1600 1800 2100 2500 3200 5200 5800 6211 6221 6231 6241 6251 6261 6271 6281 6300 6400 6500 6600 6700 6800 7100 7200 7400 7900 8200 8800 8900 9000 9100 9200 9300 9400 9500 9600 10000 10300 10500 10700 10900 11300 11600 11900 12000 12100 12200 12300 12400 12500 12800 12900 13000 13200 13400 13500"
|
||||
|
||||
OPTS="--quiet --force --potfile-disable --runtime 200 --gpu-temp-disable --weak-hash-threshold=0 -u 1024 -n 128"
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user