From fdd3fae7a5f84a3fdacf1863c25180aee6c3beef Mon Sep 17 00:00:00 2001 From: Gabriele Gristina Date: Thu, 8 Dec 2022 17:40:41 +0100 Subject: [PATCH] Fix module 3730, Metal build errors --- OpenCL/m03730_a0-pure.cl | 4 ++-- OpenCL/m03730_a3-pure.cl | 22 ++++++++++++++++++++-- 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/OpenCL/m03730_a0-pure.cl b/OpenCL/m03730_a0-pure.cl index 23a21e5a9..d3713e572 100644 --- a/OpenCL/m03730_a0-pure.cl +++ b/OpenCL/m03730_a0-pure.cl @@ -98,7 +98,7 @@ KERNEL_FQ void m03730_mxx (KERN_ATTR_ESALT (md5_double_salt_t)) md5_ctx_t ctx1 = ctx0; - md5_update(&ctx1, pws[gid].i, pws[gid].pw_len); + md5_update_global (&ctx1, pws[gid].i, pws[gid].pw_len); md5_final (&ctx1); @@ -228,7 +228,7 @@ KERNEL_FQ void m03730_sxx (KERN_ATTR_ESALT (md5_double_salt_t)) md5_ctx_t ctx1 = ctx0; - md5_update (&ctx1, pws[gid].i, pws[gid].pw_len); + md5_update_global (&ctx1, pws[gid].i, pws[gid].pw_len); md5_final (&ctx1); diff --git a/OpenCL/m03730_a3-pure.cl b/OpenCL/m03730_a3-pure.cl index 197f006a1..58f8b4410 100644 --- a/OpenCL/m03730_a3-pure.cl +++ b/OpenCL/m03730_a3-pure.cl @@ -87,11 +87,20 @@ KERNEL_FQ void m03730_mxx (KERN_ATTR_VECTOR_ESALT (md5_double_salt_t)) s[idx] = esalt_bufs[DIGESTS_OFFSET_HOST].salt1_buf[idx]; } + const u32 salt_len2 = esalt_bufs[DIGESTS_OFFSET_HOST].salt2_len; + + u32 s2[64] = { 0 }; + + for (u32 i = 0, idx = 0; i < salt_len2; i += 4, idx += 1) + { + s2[idx] = esalt_bufs[DIGESTS_OFFSET_HOST].salt2_buf[idx]; + } + md5_ctx_vector_t ctx0; md5_init_vector (&ctx0); - md5_update_vector (&ctx0, esalt_bufs[DIGESTS_OFFSET_HOST].salt2_buf, esalt_bufs[DIGESTS_OFFSET_HOST].salt2_len); + md5_update_vector (&ctx0, s2, salt_len2); /** * loop @@ -230,11 +239,20 @@ KERNEL_FQ void m03730_sxx (KERN_ATTR_VECTOR_ESALT (md5_double_salt_t)) s[idx] = esalt_bufs[DIGESTS_OFFSET_HOST].salt1_buf[idx]; } + const u32 salt_len2 = esalt_bufs[DIGESTS_OFFSET_HOST].salt2_len; + + u32 s2[64] = { 0 }; + + for (u32 i = 0, idx = 0; i < salt_len2; i += 4, idx += 1) + { + s2[idx] = esalt_bufs[DIGESTS_OFFSET_HOST].salt2_buf[idx]; + } + md5_ctx_vector_t ctx0; md5_init_vector (&ctx0); - md5_update_vector (&ctx0, esalt_bufs[DIGESTS_OFFSET_HOST].salt2_buf, esalt_bufs[DIGESTS_OFFSET_HOST].salt2_len); + md5_update_vector (&ctx0, s2, salt_len2); /** * loop