|
|
|
@ -5,6 +5,9 @@
|
|
|
|
|
|
|
|
|
|
#define _KRB5PA_
|
|
|
|
|
|
|
|
|
|
//shared mem too small
|
|
|
|
|
//#define NEW_SIMD_CODE
|
|
|
|
|
|
|
|
|
|
#include "include/constants.h"
|
|
|
|
|
#include "include/kernel_vendor.h"
|
|
|
|
|
|
|
|
|
@ -16,6 +19,7 @@
|
|
|
|
|
#include "include/kernel_functions.c"
|
|
|
|
|
#include "OpenCL/types_ocl.c"
|
|
|
|
|
#include "OpenCL/common.c"
|
|
|
|
|
#include "OpenCL/simd.c"
|
|
|
|
|
|
|
|
|
|
typedef struct
|
|
|
|
|
{
|
|
|
|
@ -548,52 +552,30 @@ __kernel void m07500_m04 (__global pw_t *pws, __global kernel_rule_t *rules_buf,
|
|
|
|
|
* modifier
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
__local RC4_KEY rc4_keys[64];
|
|
|
|
|
|
|
|
|
|
const u32 gid = get_global_id (0);
|
|
|
|
|
const u32 lid = get_local_id (0);
|
|
|
|
|
|
|
|
|
|
if (gid >= gid_max) return;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* base
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
u32 wordl0[4];
|
|
|
|
|
|
|
|
|
|
wordl0[0] = pws[gid].i[ 0];
|
|
|
|
|
wordl0[1] = pws[gid].i[ 1];
|
|
|
|
|
wordl0[2] = pws[gid].i[ 2];
|
|
|
|
|
wordl0[3] = pws[gid].i[ 3];
|
|
|
|
|
|
|
|
|
|
u32 wordl1[4];
|
|
|
|
|
|
|
|
|
|
wordl1[0] = pws[gid].i[ 4];
|
|
|
|
|
wordl1[1] = pws[gid].i[ 5];
|
|
|
|
|
wordl1[2] = pws[gid].i[ 6];
|
|
|
|
|
wordl1[3] = pws[gid].i[ 7];
|
|
|
|
|
|
|
|
|
|
u32 wordl2[4];
|
|
|
|
|
const u32 gid = get_global_id (0);
|
|
|
|
|
|
|
|
|
|
wordl2[0] = 0;
|
|
|
|
|
wordl2[1] = 0;
|
|
|
|
|
wordl2[2] = 0;
|
|
|
|
|
wordl2[3] = 0;
|
|
|
|
|
if (gid >= gid_max) return;
|
|
|
|
|
|
|
|
|
|
u32 wordl3[4];
|
|
|
|
|
u32 pw_buf0[4];
|
|
|
|
|
u32 pw_buf1[4];
|
|
|
|
|
|
|
|
|
|
wordl3[0] = 0;
|
|
|
|
|
wordl3[1] = 0;
|
|
|
|
|
wordl3[2] = 0;
|
|
|
|
|
wordl3[3] = 0;
|
|
|
|
|
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;
|
|
|
|
|
|
|
|
|
|
if (combs_mode == COMBINATOR_MODE_BASE_RIGHT)
|
|
|
|
|
{
|
|
|
|
|
switch_buffer_by_offset_le (wordl0, wordl1, wordl2, wordl3, combs_buf[0].pw_len);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* salt
|
|
|
|
|
*/
|
|
|
|
@ -617,76 +599,74 @@ __kernel void m07500_m04 (__global pw_t *pws, __global kernel_rule_t *rules_buf,
|
|
|
|
|
timestamp_ct[7] = krb5pa_bufs[salt_pos].timestamp[7];
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* loop
|
|
|
|
|
* shared
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
for (u32 il_pos = 0; il_pos < il_cnt; il_pos++)
|
|
|
|
|
{
|
|
|
|
|
const u32 pw_r_len = combs_buf[il_pos].pw_len;
|
|
|
|
|
|
|
|
|
|
const u32 pw_len = pw_l_len + pw_r_len;
|
|
|
|
|
|
|
|
|
|
u32 wordr0[4];
|
|
|
|
|
|
|
|
|
|
wordr0[0] = combs_buf[il_pos].i[0];
|
|
|
|
|
wordr0[1] = combs_buf[il_pos].i[1];
|
|
|
|
|
wordr0[2] = combs_buf[il_pos].i[2];
|
|
|
|
|
wordr0[3] = combs_buf[il_pos].i[3];
|
|
|
|
|
|
|
|
|
|
u32 wordr1[4];
|
|
|
|
|
__local RC4_KEY rc4_keys[64];
|
|
|
|
|
|
|
|
|
|
wordr1[0] = combs_buf[il_pos].i[4];
|
|
|
|
|
wordr1[1] = combs_buf[il_pos].i[5];
|
|
|
|
|
wordr1[2] = combs_buf[il_pos].i[6];
|
|
|
|
|
wordr1[3] = combs_buf[il_pos].i[7];
|
|
|
|
|
/**
|
|
|
|
|
* loop
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
u32 wordr2[4];
|
|
|
|
|
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);
|
|
|
|
|
|
|
|
|
|
wordr2[0] = 0;
|
|
|
|
|
wordr2[1] = 0;
|
|
|
|
|
wordr2[2] = 0;
|
|
|
|
|
wordr2[3] = 0;
|
|
|
|
|
const u32x pw_len = pw_l_len + pw_r_len;
|
|
|
|
|
|
|
|
|
|
u32 wordr3[4];
|
|
|
|
|
/**
|
|
|
|
|
* concat password candidate
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
wordr3[0] = 0;
|
|
|
|
|
wordr3[1] = 0;
|
|
|
|
|
wordr3[2] = 0;
|
|
|
|
|
wordr3[3] = 0;
|
|
|
|
|
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 (wordr0, wordr1, wordr2, wordr3, pw_l_len);
|
|
|
|
|
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);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
u32 w0[4];
|
|
|
|
|
u32x w0[4];
|
|
|
|
|
u32x w1[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];
|
|
|
|
|
|
|
|
|
|
u32 w1[4];
|
|
|
|
|
|
|
|
|
|
w1[0] = wordl1[0] | wordr1[0];
|
|
|
|
|
w1[1] = wordl1[1] | wordr1[1];
|
|
|
|
|
w1[2] = wordl1[2] | wordr1[2];
|
|
|
|
|
w1[3] = wordl1[3] | wordr1[3];
|
|
|
|
|
|
|
|
|
|
u32 w2[4];
|
|
|
|
|
|
|
|
|
|
w2[0] = wordl2[0] | wordr2[0];
|
|
|
|
|
w2[1] = wordl2[1] | wordr2[1];
|
|
|
|
|
w2[2] = wordl2[2] | wordr2[2];
|
|
|
|
|
w2[3] = wordl2[3] | wordr2[3];
|
|
|
|
|
|
|
|
|
|
u32 w3[4];
|
|
|
|
|
|
|
|
|
|
w3[0] = wordl3[0] | wordr3[0];
|
|
|
|
|
w3[1] = wordl3[1] | wordr3[1];
|
|
|
|
|
w3[2] = 0;
|
|
|
|
|
w3[3] = 0;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* kerberos
|
|
|
|
|
*/
|
|
|
|
@ -725,52 +705,30 @@ __kernel void m07500_s04 (__global pw_t *pws, __global kernel_rule_t *rules_buf,
|
|
|
|
|
* modifier
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
__local RC4_KEY rc4_keys[64];
|
|
|
|
|
|
|
|
|
|
const u32 gid = get_global_id (0);
|
|
|
|
|
const u32 lid = get_local_id (0);
|
|
|
|
|
|
|
|
|
|
if (gid >= gid_max) return;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* base
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
u32 wordl0[4];
|
|
|
|
|
|
|
|
|
|
wordl0[0] = pws[gid].i[ 0];
|
|
|
|
|
wordl0[1] = pws[gid].i[ 1];
|
|
|
|
|
wordl0[2] = pws[gid].i[ 2];
|
|
|
|
|
wordl0[3] = pws[gid].i[ 3];
|
|
|
|
|
|
|
|
|
|
u32 wordl1[4];
|
|
|
|
|
|
|
|
|
|
wordl1[0] = pws[gid].i[ 4];
|
|
|
|
|
wordl1[1] = pws[gid].i[ 5];
|
|
|
|
|
wordl1[2] = pws[gid].i[ 6];
|
|
|
|
|
wordl1[3] = pws[gid].i[ 7];
|
|
|
|
|
|
|
|
|
|
u32 wordl2[4];
|
|
|
|
|
const u32 gid = get_global_id (0);
|
|
|
|
|
|
|
|
|
|
wordl2[0] = 0;
|
|
|
|
|
wordl2[1] = 0;
|
|
|
|
|
wordl2[2] = 0;
|
|
|
|
|
wordl2[3] = 0;
|
|
|
|
|
if (gid >= gid_max) return;
|
|
|
|
|
|
|
|
|
|
u32 wordl3[4];
|
|
|
|
|
u32 pw_buf0[4];
|
|
|
|
|
u32 pw_buf1[4];
|
|
|
|
|
|
|
|
|
|
wordl3[0] = 0;
|
|
|
|
|
wordl3[1] = 0;
|
|
|
|
|
wordl3[2] = 0;
|
|
|
|
|
wordl3[3] = 0;
|
|
|
|
|
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;
|
|
|
|
|
|
|
|
|
|
if (combs_mode == COMBINATOR_MODE_BASE_RIGHT)
|
|
|
|
|
{
|
|
|
|
|
switch_buffer_by_offset_le (wordl0, wordl1, wordl2, wordl3, combs_buf[0].pw_len);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* salt
|
|
|
|
|
*/
|
|
|
|
@ -794,76 +752,74 @@ __kernel void m07500_s04 (__global pw_t *pws, __global kernel_rule_t *rules_buf,
|
|
|
|
|
timestamp_ct[7] = krb5pa_bufs[salt_pos].timestamp[7];
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* loop
|
|
|
|
|
* shared
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
for (u32 il_pos = 0; il_pos < il_cnt; il_pos++)
|
|
|
|
|
{
|
|
|
|
|
const u32 pw_r_len = combs_buf[il_pos].pw_len;
|
|
|
|
|
|
|
|
|
|
const u32 pw_len = pw_l_len + pw_r_len;
|
|
|
|
|
|
|
|
|
|
u32 wordr0[4];
|
|
|
|
|
|
|
|
|
|
wordr0[0] = combs_buf[il_pos].i[0];
|
|
|
|
|
wordr0[1] = combs_buf[il_pos].i[1];
|
|
|
|
|
wordr0[2] = combs_buf[il_pos].i[2];
|
|
|
|
|
wordr0[3] = combs_buf[il_pos].i[3];
|
|
|
|
|
|
|
|
|
|
u32 wordr1[4];
|
|
|
|
|
__local RC4_KEY rc4_keys[64];
|
|
|
|
|
|
|
|
|
|
wordr1[0] = combs_buf[il_pos].i[4];
|
|
|
|
|
wordr1[1] = combs_buf[il_pos].i[5];
|
|
|
|
|
wordr1[2] = combs_buf[il_pos].i[6];
|
|
|
|
|
wordr1[3] = combs_buf[il_pos].i[7];
|
|
|
|
|
/**
|
|
|
|
|
* loop
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
u32 wordr2[4];
|
|
|
|
|
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);
|
|
|
|
|
|
|
|
|
|
wordr2[0] = 0;
|
|
|
|
|
wordr2[1] = 0;
|
|
|
|
|
wordr2[2] = 0;
|
|
|
|
|
wordr2[3] = 0;
|
|
|
|
|
const u32x pw_len = pw_l_len + pw_r_len;
|
|
|
|
|
|
|
|
|
|
u32 wordr3[4];
|
|
|
|
|
/**
|
|
|
|
|
* concat password candidate
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
wordr3[0] = 0;
|
|
|
|
|
wordr3[1] = 0;
|
|
|
|
|
wordr3[2] = 0;
|
|
|
|
|
wordr3[3] = 0;
|
|
|
|
|
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 (wordr0, wordr1, wordr2, wordr3, pw_l_len);
|
|
|
|
|
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);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
u32 w0[4];
|
|
|
|
|
u32x w0[4];
|
|
|
|
|
u32x w1[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];
|
|
|
|
|
|
|
|
|
|
u32 w1[4];
|
|
|
|
|
|
|
|
|
|
w1[0] = wordl1[0] | wordr1[0];
|
|
|
|
|
w1[1] = wordl1[1] | wordr1[1];
|
|
|
|
|
w1[2] = wordl1[2] | wordr1[2];
|
|
|
|
|
w1[3] = wordl1[3] | wordr1[3];
|
|
|
|
|
|
|
|
|
|
u32 w2[4];
|
|
|
|
|
|
|
|
|
|
w2[0] = wordl2[0] | wordr2[0];
|
|
|
|
|
w2[1] = wordl2[1] | wordr2[1];
|
|
|
|
|
w2[2] = wordl2[2] | wordr2[2];
|
|
|
|
|
w2[3] = wordl2[3] | wordr2[3];
|
|
|
|
|
|
|
|
|
|
u32 w3[4];
|
|
|
|
|
|
|
|
|
|
w3[0] = wordl3[0] | wordr3[0];
|
|
|
|
|
w3[1] = wordl3[1] | wordr3[1];
|
|
|
|
|
w3[2] = 0;
|
|
|
|
|
w3[3] = 0;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* kerberos
|
|
|
|
|
*/
|
|
|
|
|