mirror of
https://github.com/hashcat/hashcat.git
synced 2024-11-22 08:08:10 +00:00
Reenable SIMD mode for -m 13600
This commit is contained in:
parent
b627536c45
commit
c258aa4111
@ -3,7 +3,7 @@
|
||||
* License.....: MIT
|
||||
*/
|
||||
|
||||
//#define NEW_SIMD_CODE
|
||||
#define NEW_SIMD_CODE
|
||||
|
||||
#ifdef KERNEL_STATIC
|
||||
#include "inc_vendor.h"
|
||||
@ -43,7 +43,7 @@ typedef struct zip2
|
||||
|
||||
} zip2_t;
|
||||
|
||||
DECLSPEC void hmac_sha1_run (u32 *w0, u32 *w1, u32 *w2, u32 *w3, u32 *ipad, u32 *opad, u32 *digest)
|
||||
DECLSPEC void hmac_sha1_run_V (u32x *w0, u32x *w1, u32x *w2, u32x *w3, u32x *ipad, u32x *opad, u32x *digest)
|
||||
{
|
||||
digest[0] = ipad[0];
|
||||
digest[1] = ipad[1];
|
||||
@ -51,7 +51,7 @@ DECLSPEC void hmac_sha1_run (u32 *w0, u32 *w1, u32 *w2, u32 *w3, u32 *ipad, u32
|
||||
digest[3] = ipad[3];
|
||||
digest[4] = ipad[4];
|
||||
|
||||
sha1_transform (w0, w1, w2, w3, digest);
|
||||
sha1_transform_vector (w0, w1, w2, w3, digest);
|
||||
|
||||
w0[0] = digest[0];
|
||||
w0[1] = digest[1];
|
||||
@ -76,7 +76,7 @@ DECLSPEC void hmac_sha1_run (u32 *w0, u32 *w1, u32 *w2, u32 *w3, u32 *ipad, u32
|
||||
digest[3] = opad[3];
|
||||
digest[4] = opad[4];
|
||||
|
||||
sha1_transform (w0, w1, w2, w3, digest);
|
||||
sha1_transform_vector (w0, w1, w2, w3, digest);
|
||||
}
|
||||
|
||||
KERNEL_FQ void m13600_init (KERN_ATTR_TMPS_ESALT (pbkdf2_sha1_tmp_t, zip2_t))
|
||||
@ -192,22 +192,22 @@ KERNEL_FQ void m13600_loop (KERN_ATTR_TMPS_ESALT (pbkdf2_sha1_tmp_t, zip2_t))
|
||||
{
|
||||
const u64 gid = get_global_id (0);
|
||||
|
||||
if (gid >= gid_max) return;
|
||||
if ((gid * VECT_SIZE) >= gid_max) return;
|
||||
|
||||
u32 ipad[5];
|
||||
u32 opad[5];
|
||||
u32x ipad[5];
|
||||
u32x opad[5];
|
||||
|
||||
ipad[0] = tmps[gid].ipad[0];
|
||||
ipad[1] = tmps[gid].ipad[1];
|
||||
ipad[2] = tmps[gid].ipad[2];
|
||||
ipad[3] = tmps[gid].ipad[3];
|
||||
ipad[4] = tmps[gid].ipad[4];
|
||||
ipad[0] = packv (tmps, ipad, gid, 0);
|
||||
ipad[1] = packv (tmps, ipad, gid, 1);
|
||||
ipad[2] = packv (tmps, ipad, gid, 2);
|
||||
ipad[3] = packv (tmps, ipad, gid, 3);
|
||||
ipad[4] = packv (tmps, ipad, gid, 4);
|
||||
|
||||
opad[0] = tmps[gid].opad[0];
|
||||
opad[1] = tmps[gid].opad[1];
|
||||
opad[2] = tmps[gid].opad[2];
|
||||
opad[3] = tmps[gid].opad[3];
|
||||
opad[4] = tmps[gid].opad[4];
|
||||
opad[0] = packv (tmps, opad, gid, 0);
|
||||
opad[1] = packv (tmps, opad, gid, 1);
|
||||
opad[2] = packv (tmps, opad, gid, 2);
|
||||
opad[3] = packv (tmps, opad, gid, 3);
|
||||
opad[4] = packv (tmps, opad, gid, 4);
|
||||
|
||||
const u32 verify_bytes = esalt_bufs[digests_offset].verify_bytes;
|
||||
|
||||
@ -233,27 +233,27 @@ KERNEL_FQ void m13600_loop (KERN_ATTR_TMPS_ESALT (pbkdf2_sha1_tmp_t, zip2_t))
|
||||
{
|
||||
const u32 i5 = i * 5;
|
||||
|
||||
u32 dgst[5];
|
||||
u32 out[5];
|
||||
u32x dgst[5];
|
||||
u32x out[5];
|
||||
|
||||
dgst[0] = tmps[gid].dgst[i5 + 0];
|
||||
dgst[1] = tmps[gid].dgst[i5 + 1];
|
||||
dgst[2] = tmps[gid].dgst[i5 + 2];
|
||||
dgst[3] = tmps[gid].dgst[i5 + 3];
|
||||
dgst[4] = tmps[gid].dgst[i5 + 4];
|
||||
dgst[0] = packv (tmps, dgst, gid, i5 + 0);
|
||||
dgst[1] = packv (tmps, dgst, gid, i5 + 1);
|
||||
dgst[2] = packv (tmps, dgst, gid, i5 + 2);
|
||||
dgst[3] = packv (tmps, dgst, gid, i5 + 3);
|
||||
dgst[4] = packv (tmps, dgst, gid, i5 + 4);
|
||||
|
||||
out[0] = tmps[gid].out[i5 + 0];
|
||||
out[1] = tmps[gid].out[i5 + 1];
|
||||
out[2] = tmps[gid].out[i5 + 2];
|
||||
out[3] = tmps[gid].out[i5 + 3];
|
||||
out[4] = tmps[gid].out[i5 + 4];
|
||||
out[0] = packv (tmps, out, gid, i5 + 0);
|
||||
out[1] = packv (tmps, out, gid, i5 + 1);
|
||||
out[2] = packv (tmps, out, gid, i5 + 2);
|
||||
out[3] = packv (tmps, out, gid, i5 + 3);
|
||||
out[4] = packv (tmps, out, gid, i5 + 4);
|
||||
|
||||
for (u32 j = 0; j < loop_cnt; j++)
|
||||
{
|
||||
u32 w0[4];
|
||||
u32 w1[4];
|
||||
u32 w2[4];
|
||||
u32 w3[4];
|
||||
u32x w0[4];
|
||||
u32x w1[4];
|
||||
u32x w2[4];
|
||||
u32x w3[4];
|
||||
|
||||
w0[0] = dgst[0];
|
||||
w0[1] = dgst[1];
|
||||
@ -272,7 +272,7 @@ KERNEL_FQ void m13600_loop (KERN_ATTR_TMPS_ESALT (pbkdf2_sha1_tmp_t, zip2_t))
|
||||
w3[2] = 0;
|
||||
w3[3] = (64 + 20) * 8;
|
||||
|
||||
hmac_sha1_run (w0, w1, w2, w3, ipad, opad, dgst);
|
||||
hmac_sha1_run_V (w0, w1, w2, w3, ipad, opad, dgst);
|
||||
|
||||
out[0] ^= dgst[0];
|
||||
out[1] ^= dgst[1];
|
||||
@ -283,22 +283,22 @@ KERNEL_FQ void m13600_loop (KERN_ATTR_TMPS_ESALT (pbkdf2_sha1_tmp_t, zip2_t))
|
||||
|
||||
if (i == iter_stop - 1) // 2 byte optimization check
|
||||
{
|
||||
if (mode == 1) if ((out[3] >> 16) != verify_bytes) break;
|
||||
if (mode == 2) if ((out[2] >> 16) != verify_bytes) break;
|
||||
if (mode == 3) if ((out[1] >> 16) != verify_bytes) break;
|
||||
if (mode == 1) if (MATCHES_NONE_VS ((out[3] >> 16), verify_bytes)) break;
|
||||
if (mode == 2) if (MATCHES_NONE_VS ((out[2] >> 16), verify_bytes)) break;
|
||||
if (mode == 3) if (MATCHES_NONE_VS ((out[1] >> 16), verify_bytes)) break;
|
||||
}
|
||||
|
||||
tmps[gid].dgst[i5 + 0] = dgst[0];
|
||||
tmps[gid].dgst[i5 + 1] = dgst[1];
|
||||
tmps[gid].dgst[i5 + 2] = dgst[2];
|
||||
tmps[gid].dgst[i5 + 3] = dgst[3];
|
||||
tmps[gid].dgst[i5 + 4] = dgst[4];
|
||||
unpackv (tmps, dgst, gid, i5 + 0, dgst[0]);
|
||||
unpackv (tmps, dgst, gid, i5 + 1, dgst[1]);
|
||||
unpackv (tmps, dgst, gid, i5 + 2, dgst[2]);
|
||||
unpackv (tmps, dgst, gid, i5 + 3, dgst[3]);
|
||||
unpackv (tmps, dgst, gid, i5 + 4, dgst[4]);
|
||||
|
||||
tmps[gid].out[i5 + 0] = out[0];
|
||||
tmps[gid].out[i5 + 1] = out[1];
|
||||
tmps[gid].out[i5 + 2] = out[2];
|
||||
tmps[gid].out[i5 + 3] = out[3];
|
||||
tmps[gid].out[i5 + 4] = out[4];
|
||||
unpackv (tmps, out, gid, i5 + 0, out[0]);
|
||||
unpackv (tmps, out, gid, i5 + 1, out[1]);
|
||||
unpackv (tmps, out, gid, i5 + 2, out[2]);
|
||||
unpackv (tmps, out, gid, i5 + 3, out[3]);
|
||||
unpackv (tmps, out, gid, i5 + 4, out[4]);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -19,7 +19,8 @@ static const u32 DGST_SIZE = DGST_SIZE_4_4;
|
||||
static const u32 HASH_CATEGORY = HASH_CATEGORY_ARCHIVE;
|
||||
static const char *HASH_NAME = "WinZip";
|
||||
static const u64 KERN_TYPE = 13600;
|
||||
static const u32 OPTI_TYPE = OPTI_TYPE_ZERO_BYTE;
|
||||
static const u32 OPTI_TYPE = OPTI_TYPE_ZERO_BYTE
|
||||
| OPTI_TYPE_SLOW_HASH_SIMD_LOOP;
|
||||
static const u64 OPTS_TYPE = OPTS_TYPE_PT_GENERATE_LE;
|
||||
static const u32 SALT_TYPE = SALT_TYPE_EMBEDDED;
|
||||
static const char *ST_PASS = "hashcat";
|
||||
|
Loading…
Reference in New Issue
Block a user