diff --git a/OpenCL/m27200_a0-pure.cl b/OpenCL/m27200_a0-pure.cl index c5ec0c903..7b60e4440 100644 --- a/OpenCL/m27200_a0-pure.cl +++ b/OpenCL/m27200_a0-pure.cl @@ -39,7 +39,11 @@ KERNEL_FQ void m27200_mxx (KERN_ATTR_RULES ()) sha1_init (&ctx0); - sha1_update (&ctx0, dash, 2); + ctx0.w0[0] = dash[0]; + ctx0.w0[1] = dash[1]; + + ctx0.len = 2; + sha1_update_global_swap (&ctx0, salt_bufs[SALT_POS].salt_buf, salt_bufs[SALT_POS].salt_len); sha1_update (&ctx0, dash, 2); @@ -103,7 +107,11 @@ KERNEL_FQ void m27200_sxx (KERN_ATTR_RULES ()) sha1_init (&ctx0); - sha1_update (&ctx0, dash, 2); + ctx0.w0[0] = dash[0]; + ctx0.w0[1] = dash[1]; + + ctx0.len = 2; + sha1_update_global_swap (&ctx0, salt_bufs[SALT_POS].salt_buf, salt_bufs[SALT_POS].salt_len); sha1_update (&ctx0, dash, 2); diff --git a/OpenCL/m27200_a1-pure.cl b/OpenCL/m27200_a1-pure.cl index 726498260..dca979941 100644 --- a/OpenCL/m27200_a1-pure.cl +++ b/OpenCL/m27200_a1-pure.cl @@ -35,7 +35,11 @@ KERNEL_FQ void m27200_mxx (KERN_ATTR_BASIC ()) sha1_init (&ctx0); - sha1_update (&ctx0, dash, 2); + ctx0.w0[0] = dash[0]; + ctx0.w0[1] = dash[1]; + + ctx0.len = 2; + sha1_update_global_swap (&ctx0, salt_bufs[SALT_POS].salt_buf, salt_bufs[SALT_POS].salt_len); sha1_update (&ctx0, dash, 2); @@ -95,7 +99,11 @@ KERNEL_FQ void m27200_sxx (KERN_ATTR_BASIC ()) sha1_init (&ctx0); - sha1_update (&ctx0, dash, 2); + ctx0.w0[0] = dash[0]; + ctx0.w0[1] = dash[1]; + + ctx0.len = 2; + sha1_update_global_swap (&ctx0, salt_bufs[SALT_POS].salt_buf, salt_bufs[SALT_POS].salt_len); sha1_update (&ctx0, dash, 2); diff --git a/OpenCL/m27200_a3-optimized.cl b/OpenCL/m27200_a3-optimized.cl index a426519df..a7cf11877 100644 --- a/OpenCL/m27200_a3-optimized.cl +++ b/OpenCL/m27200_a3-optimized.cl @@ -338,7 +338,7 @@ DECLSPEC void m27200s (u32 *w0, u32 *w1, u32 *w2, u32 *w3, const u32 pw_len, KER * salt */ - u32 salt_buf0[4] = { 0x2d2d, 0, 0, 0 }; + u32 salt_buf0[4] = { 0x2d2d0000, 0, 0, 0 }; u32 salt_buf1[4]; u32 salt_buf2[4]; u32 salt_buf3[4] = { 0 }; @@ -354,7 +354,7 @@ DECLSPEC void m27200s (u32 *w0, u32 *w1, u32 *w2, u32 *w3, const u32 pw_len, KER salt_buf2[0] = hc_swap32_S (salt_bufs[SALT_POS].salt_buf[ 7] >> 16 | salt_bufs[SALT_POS].salt_buf[ 8] << 16); salt_buf2[1] = hc_swap32_S (salt_bufs[SALT_POS].salt_buf[ 8] >> 16 | salt_bufs[SALT_POS].salt_buf[ 9] << 16); salt_buf2[2] = hc_swap32_S (salt_bufs[SALT_POS].salt_buf[ 9] >> 16 | 0x2d2d0000); - salt_buf2[3] = hc_swap32_S (salt_bufs[SALT_POS].salt_buf[10]); + salt_buf2[3] = 0; const u32 salt_len = 44; diff --git a/OpenCL/m27200_a3-pure.cl b/OpenCL/m27200_a3-pure.cl index 081cbdf76..4d7b9215f 100644 --- a/OpenCL/m27200_a3-pure.cl +++ b/OpenCL/m27200_a3-pure.cl @@ -25,7 +25,8 @@ KERNEL_FQ void m27200_mxx (KERN_ATTR_VECTOR ()) if (gid >= gid_max) return; - const u32x dash[16] = { 0x2d2d0000, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; + const u32x dash_vector[16] = { 0x2d2d0000, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; + const u32 dash_scalar[16] = { 0x2d2d0000, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; /** * base @@ -44,9 +45,13 @@ KERNEL_FQ void m27200_mxx (KERN_ATTR_VECTOR ()) sha1_init (&ctx0); - sha1_update (&ctx0, dash, 2); + ctx0.w0[0] = dash_scalar[0]; + ctx0.w0[1] = dash_scalar[1]; + + ctx0.len = 2; + sha1_update_global_swap (&ctx0, salt_bufs[SALT_POS].salt_buf, salt_bufs[SALT_POS].salt_len); - sha1_update (&ctx0, dash, 2); + sha1_update (&ctx0, dash_scalar, 2); /** * loop @@ -67,7 +72,7 @@ KERNEL_FQ void m27200_mxx (KERN_ATTR_VECTOR ()) sha1_init_vector_from_scalar (&ctx, &ctx0); sha1_update_vector (&ctx, w, pw_len); - sha1_update_vector (&ctx, dash, 2); + sha1_update_vector (&ctx, dash_vector, 2); sha1_final_vector (&ctx); @@ -91,7 +96,8 @@ KERNEL_FQ void m27200_sxx (KERN_ATTR_VECTOR ()) if (gid >= gid_max) return; - const u32x dash[16] = { 0x2d2d0000, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; + const u32x dash_vector[16] = { 0x2d2d0000, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; + const u32 dash_scalar[16] = { 0x2d2d0000, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; /** * digest @@ -122,9 +128,13 @@ KERNEL_FQ void m27200_sxx (KERN_ATTR_VECTOR ()) sha1_init (&ctx0); - sha1_update (&ctx0, dash, 2); + ctx0.w0[0] = dash_scalar[0]; + ctx0.w0[1] = dash_scalar[1]; + + ctx0.len = 2; + sha1_update_global_swap (&ctx0, salt_bufs[SALT_POS].salt_buf, salt_bufs[SALT_POS].salt_len); - sha1_update (&ctx0, dash, 2); + sha1_update (&ctx0, dash_scalar, 2); /** * loop @@ -145,7 +155,7 @@ KERNEL_FQ void m27200_sxx (KERN_ATTR_VECTOR ()) sha1_init_vector_from_scalar (&ctx, &ctx0); sha1_update_vector (&ctx, w, pw_len); - sha1_update_vector (&ctx, dash, 2); + sha1_update_vector (&ctx, dash_vector, 2); sha1_final_vector (&ctx); diff --git a/src/modules/module_27200.c b/src/modules/module_27200.c index 7c5d785d1..a9c6c62bd 100644 --- a/src/modules/module_27200.c +++ b/src/modules/module_27200.c @@ -53,7 +53,7 @@ u32 module_pw_max (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED con if (optimized_kernel == true) { - pw_max = 29; + pw_max = 9; } return pw_max; diff --git a/tools/test_modules/m27200.pm b/tools/test_modules/m27200.pm index e43ba77d5..d0966d6ee 100644 --- a/tools/test_modules/m27200.pm +++ b/tools/test_modules/m27200.pm @@ -10,7 +10,7 @@ use warnings; use Digest::SHA qw (sha1_hex); -sub module_constraints { [[0, 256], [40, 40], [0, 29], [40, 40], [-1, -1]] } +sub module_constraints { [[0, 256], [40, 40], [0, 9], [40, 40], [-1, -1]] } sub module_generate_hash {