From 78a1048670287b767dfb4acb350e5cee54242989 Mon Sep 17 00:00:00 2001 From: Jens Steube Date: Sun, 17 Apr 2022 11:47:33 +0200 Subject: [PATCH] Fixed false negative on hash-types 8900, 15700, 22700, 27700 and 28200 if using the HIP backend --- OpenCL/m08900-pure.cl | 6 +++--- OpenCL/m15700-pure.cl | 6 +++--- OpenCL/m22700-pure.cl | 6 +++--- OpenCL/m27700-pure.cl | 6 +++--- OpenCL/m28200-pure.cl | 6 +++--- docs/changes.txt | 1 + 6 files changed, 16 insertions(+), 15 deletions(-) diff --git a/OpenCL/m08900-pure.cl b/OpenCL/m08900-pure.cl index 3e87dd01b..5f96f8ec4 100644 --- a/OpenCL/m08900-pure.cl +++ b/OpenCL/m08900-pure.cl @@ -324,7 +324,7 @@ KERNEL_FQ void m08900_init (KERN_ATTR_TMPS (scrypt_tmp_t)) digest[6] = sha256_hmac_ctx2.opad.h[6]; digest[7] = sha256_hmac_ctx2.opad.h[7]; - #if defined IS_CUDA + #if defined IS_CUDA || defined IS_HIP const uint4 tmp0 = make_uint4 (digest[0], digest[1], digest[2], digest[3]); const uint4 tmp1 = make_uint4 (digest[4], digest[5], digest[6], digest[7]); #else @@ -352,7 +352,7 @@ KERNEL_FQ void m08900_init (KERN_ATTR_TMPS (scrypt_tmp_t)) uint4 X[4]; - #if defined IS_CUDA + #if defined IS_CUDA || defined IS_HIP X[0] = make_uint4 (T[0].x, T[1].y, T[2].z, T[3].w); X[1] = make_uint4 (T[1].x, T[2].y, T[3].z, T[0].w); X[2] = make_uint4 (T[2].x, T[3].y, T[0].z, T[1].w); @@ -462,7 +462,7 @@ KERNEL_FQ void m08900_comp (KERN_ATTR_TMPS (scrypt_tmp_t)) uint4 T[4]; - #if defined IS_CUDA + #if defined IS_CUDA || defined IS_HIP T[0] = make_uint4 (X[0].x, X[3].y, X[2].z, X[1].w); T[1] = make_uint4 (X[1].x, X[0].y, X[3].z, X[2].w); T[2] = make_uint4 (X[2].x, X[1].y, X[0].z, X[3].w); diff --git a/OpenCL/m15700-pure.cl b/OpenCL/m15700-pure.cl index 93a91094b..20cab27d1 100644 --- a/OpenCL/m15700-pure.cl +++ b/OpenCL/m15700-pure.cl @@ -460,7 +460,7 @@ KERNEL_FQ void m15700_init (KERN_ATTR_TMPS_ESALT (scrypt_tmp_t, ethereum_scrypt_ digest[6] = sha256_hmac_ctx2.opad.h[6]; digest[7] = sha256_hmac_ctx2.opad.h[7]; - #if defined IS_CUDA + #if defined IS_CUDA || defined IS_HIP const uint4 tmp0 = make_uint4 (digest[0], digest[1], digest[2], digest[3]); const uint4 tmp1 = make_uint4 (digest[4], digest[5], digest[6], digest[7]); #else @@ -488,7 +488,7 @@ KERNEL_FQ void m15700_init (KERN_ATTR_TMPS_ESALT (scrypt_tmp_t, ethereum_scrypt_ uint4 X[4]; - #if defined IS_CUDA + #if defined IS_CUDA || defined IS_HIP X[0] = make_uint4 (T[0].x, T[1].y, T[2].z, T[3].w); X[1] = make_uint4 (T[1].x, T[2].y, T[3].z, T[0].w); X[2] = make_uint4 (T[2].x, T[3].y, T[0].z, T[1].w); @@ -598,7 +598,7 @@ KERNEL_FQ void m15700_comp (KERN_ATTR_TMPS_ESALT (scrypt_tmp_t, ethereum_scrypt_ uint4 T[4]; - #if defined IS_CUDA + #if defined IS_CUDA || defined IS_HIP T[0] = make_uint4 (X[0].x, X[3].y, X[2].z, X[1].w); T[1] = make_uint4 (X[1].x, X[0].y, X[3].z, X[2].w); T[2] = make_uint4 (X[2].x, X[1].y, X[0].z, X[3].w); diff --git a/OpenCL/m22700-pure.cl b/OpenCL/m22700-pure.cl index d574e9c2d..7b4ac655b 100644 --- a/OpenCL/m22700-pure.cl +++ b/OpenCL/m22700-pure.cl @@ -397,7 +397,7 @@ KERNEL_FQ void m22700_init (KERN_ATTR_TMPS (scrypt_tmp_t)) digest[6] = sha256_hmac_ctx2.opad.h[6]; digest[7] = sha256_hmac_ctx2.opad.h[7]; - #if defined IS_CUDA + #if defined IS_CUDA || defined IS_HIP const uint4 tmp0 = make_uint4 (digest[0], digest[1], digest[2], digest[3]); const uint4 tmp1 = make_uint4 (digest[4], digest[5], digest[6], digest[7]); #else @@ -425,7 +425,7 @@ KERNEL_FQ void m22700_init (KERN_ATTR_TMPS (scrypt_tmp_t)) uint4 X[4]; - #if defined IS_CUDA + #if defined IS_CUDA || defined IS_HIP X[0] = make_uint4 (T[0].x, T[1].y, T[2].z, T[3].w); X[1] = make_uint4 (T[1].x, T[2].y, T[3].z, T[0].w); X[2] = make_uint4 (T[2].x, T[3].y, T[0].z, T[1].w); @@ -600,7 +600,7 @@ KERNEL_FQ void m22700_comp (KERN_ATTR_TMPS (scrypt_tmp_t)) uint4 T[4]; - #if defined IS_CUDA + #if defined IS_CUDA || defined IS_HIP T[0] = make_uint4 (X[0].x, X[3].y, X[2].z, X[1].w); T[1] = make_uint4 (X[1].x, X[0].y, X[3].z, X[2].w); T[2] = make_uint4 (X[2].x, X[1].y, X[0].z, X[3].w); diff --git a/OpenCL/m27700-pure.cl b/OpenCL/m27700-pure.cl index dc58e5210..6997647b2 100644 --- a/OpenCL/m27700-pure.cl +++ b/OpenCL/m27700-pure.cl @@ -348,7 +348,7 @@ KERNEL_FQ void m27700_init (KERN_ATTR_TMPS (scrypt_tmp_t)) digest[6] = sha256_hmac_ctx2.opad.h[6]; digest[7] = sha256_hmac_ctx2.opad.h[7]; - #if defined IS_CUDA + #if defined IS_CUDA || defined IS_HIP const uint4 tmp0 = make_uint4 (digest[0], digest[1], digest[2], digest[3]); const uint4 tmp1 = make_uint4 (digest[4], digest[5], digest[6], digest[7]); #else @@ -376,7 +376,7 @@ KERNEL_FQ void m27700_init (KERN_ATTR_TMPS (scrypt_tmp_t)) uint4 X[4]; - #if defined IS_CUDA + #if defined IS_CUDA || defined IS_HIP X[0] = make_uint4 (T[0].x, T[1].y, T[2].z, T[3].w); X[1] = make_uint4 (T[1].x, T[2].y, T[3].z, T[0].w); X[2] = make_uint4 (T[2].x, T[3].y, T[0].z, T[1].w); @@ -552,7 +552,7 @@ KERNEL_FQ void m27700_comp (KERN_ATTR_TMPS (scrypt_tmp_t)) uint4 T[4]; - #if defined IS_CUDA + #if defined IS_CUDA || defined IS_HIP T[0] = make_uint4 (X[0].x, X[3].y, X[2].z, X[1].w); T[1] = make_uint4 (X[1].x, X[0].y, X[3].z, X[2].w); T[2] = make_uint4 (X[2].x, X[1].y, X[0].z, X[3].w); diff --git a/OpenCL/m28200-pure.cl b/OpenCL/m28200-pure.cl index 5e8df55ea..0cfec89d7 100644 --- a/OpenCL/m28200-pure.cl +++ b/OpenCL/m28200-pure.cl @@ -334,7 +334,7 @@ KERNEL_FQ void m28200_init (KERN_ATTR_TMPS_ESALT (exodus_tmp_t, exodus_t)) digest[6] = sha256_hmac_ctx2.opad.h[6]; digest[7] = sha256_hmac_ctx2.opad.h[7]; - #ifdef IS_CUDA + #if defined IS_CUDA || defined IS_HIP const uint4 tmp0 = make_uint4 (digest[0], digest[1], digest[2], digest[3]); const uint4 tmp1 = make_uint4 (digest[4], digest[5], digest[6], digest[7]); #else @@ -362,7 +362,7 @@ KERNEL_FQ void m28200_init (KERN_ATTR_TMPS_ESALT (exodus_tmp_t, exodus_t)) uint4 X[4]; - #ifdef IS_CUDA + #if defined IS_CUDA || defined IS_HIP X[0] = make_uint4 (T[0].x, T[1].y, T[2].z, T[3].w); X[1] = make_uint4 (T[1].x, T[2].y, T[3].z, T[0].w); X[2] = make_uint4 (T[2].x, T[3].y, T[0].z, T[1].w); @@ -520,7 +520,7 @@ KERNEL_FQ void m28200_comp (KERN_ATTR_TMPS_ESALT (exodus_tmp_t, exodus_t)) uint4 T[4]; - #ifdef IS_CUDA + #if defined IS_CUDA || defined IS_HIP T[0] = make_uint4 (X[0].x, X[3].y, X[2].z, X[1].w); T[1] = make_uint4 (X[1].x, X[0].y, X[3].z, X[2].w); T[2] = make_uint4 (X[2].x, X[1].y, X[0].z, X[3].w); diff --git a/docs/changes.txt b/docs/changes.txt index 4fc0276d5..f35d0f0bc 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -39,6 +39,7 @@ - Fixed false negative on hash-types 4510 and 4710 for hashes with long salts - Fixed false negative on Unit Test in case of out-of-memory with grep in single mode - Fixed false negative on Unit Test with hash-type 25400 +- Fixed false negative on hash-types 8900, 15700, 22700, 27700 and 28200 if using the HIP backend - Fixed functional error when nonce-error-corrections that were set on the command line in hash-mode 22000/22001 were not accepted - Fixed handling of devices in benchmark mode for "kernel build error". Instead of canceling, skip the device and move on to the next - Fixed handling of password candidates that are shorter than the minimum password length in Association Attack