1
0
mirror of https://github.com/hashcat/hashcat.git synced 2024-11-22 08:08:10 +00:00

-m 30700: set the IV outside of the loop

This commit is contained in:
hops 2022-12-14 21:27:29 +01:00
parent 7edda7c82f
commit 9f823dc564
2 changed files with 52 additions and 76 deletions

View File

@ -33,14 +33,18 @@ KERNEL_FQ void m30700_mxx (KERN_ATTR_RULES ())
COPY_PW (pws[gid]);
const u32 IV_A = salt_bufs[SALT_POS_HOST].salt_buf_pc[0];
const u32 IV_B = salt_bufs[SALT_POS_HOST].salt_buf_pc[1];
const u32 IV_C = salt_bufs[SALT_POS_HOST].salt_buf_pc[2];
const u32 IV_D = salt_bufs[SALT_POS_HOST].salt_buf_pc[3];
const u32 IV_E = salt_bufs[SALT_POS_HOST].salt_buf_pc[4];
const u32 IV_F = salt_bufs[SALT_POS_HOST].salt_buf_pc[5];
const u32 IV_G = salt_bufs[SALT_POS_HOST].salt_buf_pc[6];
const u32 IV_H = salt_bufs[SALT_POS_HOST].salt_buf_pc[7];
sha256_ctx_t ctx0;
sha256_init (&ctx0);
ctx0.h[0] = salt_bufs[SALT_POS_HOST].salt_buf_pc[0];
ctx0.h[1] = salt_bufs[SALT_POS_HOST].salt_buf_pc[1];
ctx0.h[2] = salt_bufs[SALT_POS_HOST].salt_buf_pc[2];
ctx0.h[3] = salt_bufs[SALT_POS_HOST].salt_buf_pc[3];
ctx0.h[4] = salt_bufs[SALT_POS_HOST].salt_buf_pc[4];
ctx0.h[5] = salt_bufs[SALT_POS_HOST].salt_buf_pc[5];
ctx0.h[6] = salt_bufs[SALT_POS_HOST].salt_buf_pc[6];
ctx0.h[7] = salt_bufs[SALT_POS_HOST].salt_buf_pc[7];
/**
* loop
@ -52,18 +56,7 @@ KERNEL_FQ void m30700_mxx (KERN_ATTR_RULES ())
tmp.pw_len = apply_rules (rules_buf[il_pos].cmds, tmp.i, tmp.pw_len);
sha256_ctx_t ctx;
sha256_init (&ctx);
ctx.h[0] = IV_A;
ctx.h[1] = IV_B;
ctx.h[2] = IV_C;
ctx.h[3] = IV_D;
ctx.h[4] = IV_E;
ctx.h[5] = IV_F;
ctx.h[6] = IV_G;
ctx.h[7] = IV_H;
sha256_ctx_t ctx = ctx0;
sha256_update_swap (&ctx, tmp.i, tmp.pw_len);
@ -107,14 +100,18 @@ KERNEL_FQ void m30700_sxx (KERN_ATTR_RULES ())
COPY_PW (pws[gid]);
const u32 IV_A = salt_bufs[SALT_POS_HOST].salt_buf_pc[0];
const u32 IV_B = salt_bufs[SALT_POS_HOST].salt_buf_pc[1];
const u32 IV_C = salt_bufs[SALT_POS_HOST].salt_buf_pc[2];
const u32 IV_D = salt_bufs[SALT_POS_HOST].salt_buf_pc[3];
const u32 IV_E = salt_bufs[SALT_POS_HOST].salt_buf_pc[4];
const u32 IV_F = salt_bufs[SALT_POS_HOST].salt_buf_pc[5];
const u32 IV_G = salt_bufs[SALT_POS_HOST].salt_buf_pc[6];
const u32 IV_H = salt_bufs[SALT_POS_HOST].salt_buf_pc[7];
sha256_ctx_t ctx0;
sha256_init (&ctx0);
ctx0.h[0] = salt_bufs[SALT_POS_HOST].salt_buf_pc[0];
ctx0.h[1] = salt_bufs[SALT_POS_HOST].salt_buf_pc[1];
ctx0.h[2] = salt_bufs[SALT_POS_HOST].salt_buf_pc[2];
ctx0.h[3] = salt_bufs[SALT_POS_HOST].salt_buf_pc[3];
ctx0.h[4] = salt_bufs[SALT_POS_HOST].salt_buf_pc[4];
ctx0.h[5] = salt_bufs[SALT_POS_HOST].salt_buf_pc[5];
ctx0.h[6] = salt_bufs[SALT_POS_HOST].salt_buf_pc[6];
ctx0.h[7] = salt_bufs[SALT_POS_HOST].salt_buf_pc[7];
/**
* loop
@ -126,18 +123,7 @@ KERNEL_FQ void m30700_sxx (KERN_ATTR_RULES ())
tmp.pw_len = apply_rules (rules_buf[il_pos].cmds, tmp.i, tmp.pw_len);
sha256_ctx_t ctx;
sha256_init (&ctx);
ctx.h[0] = IV_A;
ctx.h[1] = IV_B;
ctx.h[2] = IV_C;
ctx.h[3] = IV_D;
ctx.h[4] = IV_E;
ctx.h[5] = IV_F;
ctx.h[6] = IV_G;
ctx.h[7] = IV_H;
sha256_ctx_t ctx = ctx0;
sha256_update_swap (&ctx, tmp.i, tmp.pw_len);

View File

@ -38,14 +38,18 @@ KERNEL_FQ void m30700_mxx (KERN_ATTR_VECTOR ())
w[idx] = pws[gid].i[idx];
}
const u32 IV_A = salt_bufs[SALT_POS_HOST].salt_buf_pc[0];
const u32 IV_B = salt_bufs[SALT_POS_HOST].salt_buf_pc[1];
const u32 IV_C = salt_bufs[SALT_POS_HOST].salt_buf_pc[2];
const u32 IV_D = salt_bufs[SALT_POS_HOST].salt_buf_pc[3];
const u32 IV_E = salt_bufs[SALT_POS_HOST].salt_buf_pc[4];
const u32 IV_F = salt_bufs[SALT_POS_HOST].salt_buf_pc[5];
const u32 IV_G = salt_bufs[SALT_POS_HOST].salt_buf_pc[6];
const u32 IV_H = salt_bufs[SALT_POS_HOST].salt_buf_pc[7];
sha256_ctx_t ctx0;
sha256_init (&ctx0);
ctx0.h[0] = salt_bufs[SALT_POS_HOST].salt_buf_pc[0];
ctx0.h[1] = salt_bufs[SALT_POS_HOST].salt_buf_pc[1];
ctx0.h[2] = salt_bufs[SALT_POS_HOST].salt_buf_pc[2];
ctx0.h[3] = salt_bufs[SALT_POS_HOST].salt_buf_pc[3];
ctx0.h[4] = salt_bufs[SALT_POS_HOST].salt_buf_pc[4];
ctx0.h[5] = salt_bufs[SALT_POS_HOST].salt_buf_pc[5];
ctx0.h[6] = salt_bufs[SALT_POS_HOST].salt_buf_pc[6];
ctx0.h[7] = salt_bufs[SALT_POS_HOST].salt_buf_pc[7];
/**
* loop
@ -63,16 +67,7 @@ KERNEL_FQ void m30700_mxx (KERN_ATTR_VECTOR ())
sha256_ctx_vector_t ctx;
sha256_init_vector (&ctx);
ctx.h[0] = IV_A;
ctx.h[1] = IV_B;
ctx.h[2] = IV_C;
ctx.h[3] = IV_D;
ctx.h[4] = IV_E;
ctx.h[5] = IV_F;
ctx.h[6] = IV_G;
ctx.h[7] = IV_H;
sha256_init_vector_from_scalar (&ctx, &ctx0);
sha256_update_vector (&ctx, w, pw_len);
@ -123,14 +118,18 @@ KERNEL_FQ void m30700_sxx (KERN_ATTR_VECTOR ())
w[idx] = pws[gid].i[idx];
}
const u32 IV_A = salt_bufs[SALT_POS_HOST].salt_buf_pc[0];
const u32 IV_B = salt_bufs[SALT_POS_HOST].salt_buf_pc[1];
const u32 IV_C = salt_bufs[SALT_POS_HOST].salt_buf_pc[2];
const u32 IV_D = salt_bufs[SALT_POS_HOST].salt_buf_pc[3];
const u32 IV_E = salt_bufs[SALT_POS_HOST].salt_buf_pc[4];
const u32 IV_F = salt_bufs[SALT_POS_HOST].salt_buf_pc[5];
const u32 IV_G = salt_bufs[SALT_POS_HOST].salt_buf_pc[6];
const u32 IV_H = salt_bufs[SALT_POS_HOST].salt_buf_pc[7];
sha256_ctx_t ctx0;
sha256_init (&ctx0);
ctx0.h[0] = salt_bufs[SALT_POS_HOST].salt_buf_pc[0];
ctx0.h[1] = salt_bufs[SALT_POS_HOST].salt_buf_pc[1];
ctx0.h[2] = salt_bufs[SALT_POS_HOST].salt_buf_pc[2];
ctx0.h[3] = salt_bufs[SALT_POS_HOST].salt_buf_pc[3];
ctx0.h[4] = salt_bufs[SALT_POS_HOST].salt_buf_pc[4];
ctx0.h[5] = salt_bufs[SALT_POS_HOST].salt_buf_pc[5];
ctx0.h[6] = salt_bufs[SALT_POS_HOST].salt_buf_pc[6];
ctx0.h[7] = salt_bufs[SALT_POS_HOST].salt_buf_pc[7];
/**
* loop
@ -148,16 +147,7 @@ KERNEL_FQ void m30700_sxx (KERN_ATTR_VECTOR ())
sha256_ctx_vector_t ctx;
sha256_init_vector (&ctx);
ctx.h[0] = IV_A;
ctx.h[1] = IV_B;
ctx.h[2] = IV_C;
ctx.h[3] = IV_D;
ctx.h[4] = IV_E;
ctx.h[5] = IV_F;
ctx.h[6] = IV_G;
ctx.h[7] = IV_H;
sha256_init_vector_from_scalar (&ctx, &ctx0);
sha256_update_vector (&ctx, w, pw_len);