From 4dc98b334a70c4aa2ad2e9d8a251f6dbbdb13b1d Mon Sep 17 00:00:00 2001 From: Jens Steube Date: Wed, 8 Dec 2021 16:30:32 +0100 Subject: [PATCH] Fixed undefined function call to hc_byte_perm_S() in hash-mode 17010 on non-CUDA compute devices --- OpenCL/m17010-pure.cl | 6 ++++-- docs/changes.txt | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/OpenCL/m17010-pure.cl b/OpenCL/m17010-pure.cl index 23dc5931d..9cb8e2c41 100644 --- a/OpenCL/m17010-pure.cl +++ b/OpenCL/m17010-pure.cl @@ -87,7 +87,8 @@ DECLSPEC void memzero_le_S (u32 *block, const u32 start_offset, const u32 end_of const u32 start_idx = start_offset / 4; // zero out bytes in the first u32 starting from 'start_offset' - block[start_idx] &= 0xffffffff >> ((4 - (start_offset & 3)) * 8); + // math is a bit complex to avoid shifting by 32 bits, which is not possible on some architectures + block[start_idx] &= ~(0xffffffff << ((start_offset & 3) * 8)); const u32 end_idx = (end_offset + 3) / 4; @@ -103,7 +104,8 @@ DECLSPEC void memzero_be_S (u32 *block, const u32 start_offset, const u32 end_of const u32 start_idx = start_offset / 4; // zero out bytes in the first u32 starting from 'start_offset' - block[start_idx] &= 0xffffffff << ((4 - (start_offset & 3)) * 8); + // math is a bit complex to avoid shifting by 32 bits, which is not possible on some architectures + block[start_idx] &= ~(0xffffffff >> ((start_offset & 3) * 8)); const u32 end_idx = (end_offset + 3) / 4; diff --git a/docs/changes.txt b/docs/changes.txt index c5766d311..f3e8d4594 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -5,6 +5,7 @@ ## - Fixed functional error when nonce-error-corrections that were set on the command line in hash-mode 22000/22001 were not accepted +- Fixed undefined function call to hc_byte_perm_S() in hash-mode 17010 on non-CUDA compute devices ## ## Technical