1
0
mirror of https://github.com/hashcat/hashcat.git synced 2024-11-25 17:38:23 +00:00

Fixed build failed for 13772 and 13773 with Apple Metal

This commit is contained in:
Gabriele Gristina 2023-05-20 14:02:25 +02:00
parent c100ad7be2
commit 44d58f9a45
3 changed files with 217 additions and 84 deletions

View File

@ -357,15 +357,16 @@ KERNEL_FQ void m13772_init (KERN_ATTR_TMPS_ESALT (vc64_sbog_tmp_t, vc_t))
streebog512_hmac_update_global_swap (&streebog512_hmac_ctx, salt_bufs[SALT_POS_HOST].salt_buf, 64);
for (u32 i = 0, j = 1; i < 16; i += 8, j += 1)
{
streebog512_hmac_ctx_t streebog512_hmac_ctx2 = streebog512_hmac_ctx;
u32 i = 0;
u32 j = 1;
u32 w0[4];
u32 w1[4];
u32 w2[4];
u32 w3[4];
streebog512_hmac_ctx_t streebog512_hmac_ctx_v1 = streebog512_hmac_ctx;
w0[0] = j;
w0[1] = 0;
w0[2] = 0;
@ -383,18 +384,62 @@ KERNEL_FQ void m13772_init (KERN_ATTR_TMPS_ESALT (vc64_sbog_tmp_t, vc_t))
w3[2] = 0;
w3[3] = 0;
streebog512_hmac_update_64 (&streebog512_hmac_ctx2, w0, w1, w2, w3, 4);
streebog512_hmac_update_64 (&streebog512_hmac_ctx_v1, w0, w1, w2, w3, 4);
streebog512_hmac_final (&streebog512_hmac_ctx2);
streebog512_hmac_final (&streebog512_hmac_ctx_v1);
tmps[gid].dgst[i + 0] = streebog512_hmac_ctx2.opad.h[0];
tmps[gid].dgst[i + 1] = streebog512_hmac_ctx2.opad.h[1];
tmps[gid].dgst[i + 2] = streebog512_hmac_ctx2.opad.h[2];
tmps[gid].dgst[i + 3] = streebog512_hmac_ctx2.opad.h[3];
tmps[gid].dgst[i + 4] = streebog512_hmac_ctx2.opad.h[4];
tmps[gid].dgst[i + 5] = streebog512_hmac_ctx2.opad.h[5];
tmps[gid].dgst[i + 6] = streebog512_hmac_ctx2.opad.h[6];
tmps[gid].dgst[i + 7] = streebog512_hmac_ctx2.opad.h[7];
tmps[gid].dgst[i + 0] = streebog512_hmac_ctx_v1.opad.h[0];
tmps[gid].dgst[i + 1] = streebog512_hmac_ctx_v1.opad.h[1];
tmps[gid].dgst[i + 2] = streebog512_hmac_ctx_v1.opad.h[2];
tmps[gid].dgst[i + 3] = streebog512_hmac_ctx_v1.opad.h[3];
tmps[gid].dgst[i + 4] = streebog512_hmac_ctx_v1.opad.h[4];
tmps[gid].dgst[i + 5] = streebog512_hmac_ctx_v1.opad.h[5];
tmps[gid].dgst[i + 6] = streebog512_hmac_ctx_v1.opad.h[6];
tmps[gid].dgst[i + 7] = streebog512_hmac_ctx_v1.opad.h[7];
tmps[gid].out[i + 0] = tmps[gid].dgst[i + 0];
tmps[gid].out[i + 1] = tmps[gid].dgst[i + 1];
tmps[gid].out[i + 2] = tmps[gid].dgst[i + 2];
tmps[gid].out[i + 3] = tmps[gid].dgst[i + 3];
tmps[gid].out[i + 4] = tmps[gid].dgst[i + 4];
tmps[gid].out[i + 5] = tmps[gid].dgst[i + 5];
tmps[gid].out[i + 6] = tmps[gid].dgst[i + 6];
tmps[gid].out[i + 7] = tmps[gid].dgst[i + 7];
i=8;
j=2;
streebog512_hmac_ctx_t streebog512_hmac_ctx_v2 = streebog512_hmac_ctx;
w0[0] = j;
w0[1] = 0;
w0[2] = 0;
w0[3] = 0;
w1[0] = 0;
w1[1] = 0;
w1[2] = 0;
w1[3] = 0;
w2[0] = 0;
w2[1] = 0;
w2[2] = 0;
w2[3] = 0;
w3[0] = 0;
w3[1] = 0;
w3[2] = 0;
w3[3] = 0;
streebog512_hmac_update_64 (&streebog512_hmac_ctx_v2, w0, w1, w2, w3, 4);
streebog512_hmac_final (&streebog512_hmac_ctx_v2);
tmps[gid].dgst[i + 0] = streebog512_hmac_ctx_v2.opad.h[0];
tmps[gid].dgst[i + 1] = streebog512_hmac_ctx_v2.opad.h[1];
tmps[gid].dgst[i + 2] = streebog512_hmac_ctx_v2.opad.h[2];
tmps[gid].dgst[i + 3] = streebog512_hmac_ctx_v2.opad.h[3];
tmps[gid].dgst[i + 4] = streebog512_hmac_ctx_v2.opad.h[4];
tmps[gid].dgst[i + 5] = streebog512_hmac_ctx_v2.opad.h[5];
tmps[gid].dgst[i + 6] = streebog512_hmac_ctx_v2.opad.h[6];
tmps[gid].dgst[i + 7] = streebog512_hmac_ctx_v2.opad.h[7];
tmps[gid].out[i + 0] = tmps[gid].dgst[i + 0];
tmps[gid].out[i + 1] = tmps[gid].dgst[i + 1];
@ -404,7 +449,6 @@ KERNEL_FQ void m13772_init (KERN_ATTR_TMPS_ESALT (vc64_sbog_tmp_t, vc_t))
tmps[gid].out[i + 5] = tmps[gid].dgst[i + 5];
tmps[gid].out[i + 6] = tmps[gid].dgst[i + 6];
tmps[gid].out[i + 7] = tmps[gid].dgst[i + 7];
}
}
KERNEL_FQ void m13772_loop (KERN_ATTR_TMPS_ESALT (vc64_sbog_tmp_t, vc_t))

View File

@ -422,15 +422,16 @@ KERNEL_FQ void m13773_init (KERN_ATTR_TMPS_ESALT (vc64_sbog_tmp_t, vc_t))
streebog512_hmac_update_global_swap (&streebog512_hmac_ctx, salt_bufs[SALT_POS_HOST].salt_buf, 64);
for (u32 i = 0, j = 1; i < 24; i += 8, j += 1)
{
streebog512_hmac_ctx_t streebog512_hmac_ctx2 = streebog512_hmac_ctx;
u32 i = 0;
u32 j = 1;
u32 w0[4];
u32 w1[4];
u32 w2[4];
u32 w3[4];
streebog512_hmac_ctx_t streebog512_hmac_ctx_v1 = streebog512_hmac_ctx;
w0[0] = j;
w0[1] = 0;
w0[2] = 0;
@ -448,18 +449,106 @@ KERNEL_FQ void m13773_init (KERN_ATTR_TMPS_ESALT (vc64_sbog_tmp_t, vc_t))
w3[2] = 0;
w3[3] = 0;
streebog512_hmac_update_64 (&streebog512_hmac_ctx2, w0, w1, w2, w3, 4);
streebog512_hmac_update_64 (&streebog512_hmac_ctx_v1, w0, w1, w2, w3, 4);
streebog512_hmac_final (&streebog512_hmac_ctx2);
streebog512_hmac_final (&streebog512_hmac_ctx_v1);
tmps[gid].dgst[i + 0] = streebog512_hmac_ctx2.opad.h[0];
tmps[gid].dgst[i + 1] = streebog512_hmac_ctx2.opad.h[1];
tmps[gid].dgst[i + 2] = streebog512_hmac_ctx2.opad.h[2];
tmps[gid].dgst[i + 3] = streebog512_hmac_ctx2.opad.h[3];
tmps[gid].dgst[i + 4] = streebog512_hmac_ctx2.opad.h[4];
tmps[gid].dgst[i + 5] = streebog512_hmac_ctx2.opad.h[5];
tmps[gid].dgst[i + 6] = streebog512_hmac_ctx2.opad.h[6];
tmps[gid].dgst[i + 7] = streebog512_hmac_ctx2.opad.h[7];
tmps[gid].dgst[i + 0] = streebog512_hmac_ctx_v1.opad.h[0];
tmps[gid].dgst[i + 1] = streebog512_hmac_ctx_v1.opad.h[1];
tmps[gid].dgst[i + 2] = streebog512_hmac_ctx_v1.opad.h[2];
tmps[gid].dgst[i + 3] = streebog512_hmac_ctx_v1.opad.h[3];
tmps[gid].dgst[i + 4] = streebog512_hmac_ctx_v1.opad.h[4];
tmps[gid].dgst[i + 5] = streebog512_hmac_ctx_v1.opad.h[5];
tmps[gid].dgst[i + 6] = streebog512_hmac_ctx_v1.opad.h[6];
tmps[gid].dgst[i + 7] = streebog512_hmac_ctx_v1.opad.h[7];
tmps[gid].out[i + 0] = tmps[gid].dgst[i + 0];
tmps[gid].out[i + 1] = tmps[gid].dgst[i + 1];
tmps[gid].out[i + 2] = tmps[gid].dgst[i + 2];
tmps[gid].out[i + 3] = tmps[gid].dgst[i + 3];
tmps[gid].out[i + 4] = tmps[gid].dgst[i + 4];
tmps[gid].out[i + 5] = tmps[gid].dgst[i + 5];
tmps[gid].out[i + 6] = tmps[gid].dgst[i + 6];
tmps[gid].out[i + 7] = tmps[gid].dgst[i + 7];
i = 8;
j = 2;
streebog512_hmac_ctx_t streebog512_hmac_ctx_v2 = streebog512_hmac_ctx;
w0[0] = j;
w0[1] = 0;
w0[2] = 0;
w0[3] = 0;
w1[0] = 0;
w1[1] = 0;
w1[2] = 0;
w1[3] = 0;
w2[0] = 0;
w2[1] = 0;
w2[2] = 0;
w2[3] = 0;
w3[0] = 0;
w3[1] = 0;
w3[2] = 0;
w3[3] = 0;
streebog512_hmac_update_64 (&streebog512_hmac_ctx_v2, w0, w1, w2, w3, 4);
streebog512_hmac_final (&streebog512_hmac_ctx_v2);
tmps[gid].dgst[i + 0] = streebog512_hmac_ctx_v2.opad.h[0];
tmps[gid].dgst[i + 1] = streebog512_hmac_ctx_v2.opad.h[1];
tmps[gid].dgst[i + 2] = streebog512_hmac_ctx_v2.opad.h[2];
tmps[gid].dgst[i + 3] = streebog512_hmac_ctx_v2.opad.h[3];
tmps[gid].dgst[i + 4] = streebog512_hmac_ctx_v2.opad.h[4];
tmps[gid].dgst[i + 5] = streebog512_hmac_ctx_v2.opad.h[5];
tmps[gid].dgst[i + 6] = streebog512_hmac_ctx_v2.opad.h[6];
tmps[gid].dgst[i + 7] = streebog512_hmac_ctx_v2.opad.h[7];
tmps[gid].out[i + 0] = tmps[gid].dgst[i + 0];
tmps[gid].out[i + 1] = tmps[gid].dgst[i + 1];
tmps[gid].out[i + 2] = tmps[gid].dgst[i + 2];
tmps[gid].out[i + 3] = tmps[gid].dgst[i + 3];
tmps[gid].out[i + 4] = tmps[gid].dgst[i + 4];
tmps[gid].out[i + 5] = tmps[gid].dgst[i + 5];
tmps[gid].out[i + 6] = tmps[gid].dgst[i + 6];
tmps[gid].out[i + 7] = tmps[gid].dgst[i + 7];
i = 16;
j = 3;
streebog512_hmac_ctx_t streebog512_hmac_ctx_v3 = streebog512_hmac_ctx;
w0[0] = j;
w0[1] = 0;
w0[2] = 0;
w0[3] = 0;
w1[0] = 0;
w1[1] = 0;
w1[2] = 0;
w1[3] = 0;
w2[0] = 0;
w2[1] = 0;
w2[2] = 0;
w2[3] = 0;
w3[0] = 0;
w3[1] = 0;
w3[2] = 0;
w3[3] = 0;
streebog512_hmac_update_64 (&streebog512_hmac_ctx_v3, w0, w1, w2, w3, 4);
streebog512_hmac_final (&streebog512_hmac_ctx_v3);
tmps[gid].dgst[i + 0] = streebog512_hmac_ctx_v3.opad.h[0];
tmps[gid].dgst[i + 1] = streebog512_hmac_ctx_v3.opad.h[1];
tmps[gid].dgst[i + 2] = streebog512_hmac_ctx_v3.opad.h[2];
tmps[gid].dgst[i + 3] = streebog512_hmac_ctx_v3.opad.h[3];
tmps[gid].dgst[i + 4] = streebog512_hmac_ctx_v3.opad.h[4];
tmps[gid].dgst[i + 5] = streebog512_hmac_ctx_v3.opad.h[5];
tmps[gid].dgst[i + 6] = streebog512_hmac_ctx_v3.opad.h[6];
tmps[gid].dgst[i + 7] = streebog512_hmac_ctx_v3.opad.h[7];
tmps[gid].out[i + 0] = tmps[gid].dgst[i + 0];
tmps[gid].out[i + 1] = tmps[gid].dgst[i + 1];
@ -469,7 +558,6 @@ KERNEL_FQ void m13773_init (KERN_ATTR_TMPS_ESALT (vc64_sbog_tmp_t, vc_t))
tmps[gid].out[i + 5] = tmps[gid].dgst[i + 5];
tmps[gid].out[i + 6] = tmps[gid].dgst[i + 6];
tmps[gid].out[i + 7] = tmps[gid].dgst[i + 7];
}
}
KERNEL_FQ void m13773_loop (KERN_ATTR_TMPS_ESALT (vc64_sbog_tmp_t, vc_t))

View File

@ -60,6 +60,7 @@
- Fixed bug in input_tokenizer when TOKEN_ATTR_FIXED_LENGTH is used and refactor modules
- Added verification of token buffer length when using TOKEN_ATTR_FIXED_LENGTH
- Fixed build failed for 4410 with vector width > 1
- Fixed build failed for 13772 and 13773 with Apple Metal
- Fixed build failed for 18400 with Apple Metal
- Fixed build failed for 18600 with Apple Metal
- Fixed build failed for 31700 with Apple Metal