From: jsteube Date: Tue, 22 Dec 2015 22:43:39 +0000 (+0100) Subject: Increase bcrypt speed for NV X-Git-Tag: v3.00-beta~584^2~32 X-Git-Url: https://www.flypig.org.uk/git/?a=commitdiff_plain;h=84568e5b3d8a24a360fc03f10f8e295bf4a6645e;p=hashcat.git Increase bcrypt speed for NV --- diff --git a/OpenCL/m03200.cl b/OpenCL/m03200.cl index dd5c522..a086d98 100644 --- a/OpenCL/m03200.cl +++ b/OpenCL/m03200.cl @@ -354,7 +354,7 @@ __constant u32 c_sbox3[256] = L ^= P[17]; \ } -static void expand_key (u32 E[34], const u32 W[16], const u32 len) +static void expand_key (u32 E[18], const u32 W[16], const u32 len) { u8 *E_cur = (u8 *) E; u8 *E_stop = E_cur + 72; @@ -406,7 +406,7 @@ __kernel void __attribute__((reqd_work_group_size (8, 1, 1))) m03200_init (__glo w[14] = pws[gid].i[14]; w[15] = pws[gid].i[15]; - u32 E[34]; + u32 E[18]; expand_key (E, w, pw_len); @@ -429,6 +429,11 @@ __kernel void __attribute__((reqd_work_group_size (8, 1, 1))) m03200_init (__glo E[16] = swap32 (E[16]); E[17] = swap32 (E[17]); + for (u32 i = 0; i < 18; i++) + { + tmps[gid].E[i] = E[i]; + } + /** * salt */ @@ -619,33 +624,19 @@ __kernel void __attribute__((reqd_work_group_size (8, 1, 1))) m03200_loop (__glo w[14] = pws[gid].i[14]; w[15] = pws[gid].i[15]; - u32 E[34]; + // load - expand_key (E, w, pw_len); + u32 E[18]; - E[ 0] = swap32 (E[ 0]); - E[ 1] = swap32 (E[ 1]); - E[ 2] = swap32 (E[ 2]); - E[ 3] = swap32 (E[ 3]); - E[ 4] = swap32 (E[ 4]); - E[ 5] = swap32 (E[ 5]); - E[ 6] = swap32 (E[ 6]); - E[ 7] = swap32 (E[ 7]); - E[ 8] = swap32 (E[ 8]); - E[ 9] = swap32 (E[ 9]); - E[10] = swap32 (E[10]); - E[11] = swap32 (E[11]); - E[12] = swap32 (E[12]); - E[13] = swap32 (E[13]); - E[14] = swap32 (E[14]); - E[15] = swap32 (E[15]); - E[16] = swap32 (E[16]); - E[17] = swap32 (E[17]); - - // load + #pragma unroll + for (u32 i = 0; i < 18; i++) + { + E[i] = tmps[gid].E[i]; + } u32 P[18]; + #pragma unroll for (u32 i = 0; i < 18; i++) { P[i] = tmps[gid].P[i]; diff --git a/OpenCL/types_ocl.c b/OpenCL/types_ocl.c index 481aaa3..3ac84b4 100644 --- a/OpenCL/types_ocl.c +++ b/OpenCL/types_ocl.c @@ -652,6 +652,8 @@ typedef struct typedef struct { + u32 E[18]; + u32 P[18]; u32 S0[256]; diff --git a/include/types.h b/include/types.h index 36de62d..78798fd 100644 --- a/include/types.h +++ b/include/types.h @@ -298,6 +298,8 @@ typedef struct typedef struct { + uint E[18]; + uint P[18]; uint S0[256];