03-30-2020, 09:07 PM
interesting. good to know how to reproduce this. I think I'm now also able to reproduce this (and therefore also this: https://github.com/hashcat/hashcat/issues/2341) problem...
I'm currently testing a fix like this, which seems promising (rm -rf kernels/ for testing):
or (only makes sense for constant time):
I will ask atom if this fix is good enough. thank you very much in the meantime
I'm currently testing a fix like this, which seems promising (rm -rf kernels/ for testing):
Code:
diff --git a/OpenCL/inc_ecc_secp256k1.cl b/OpenCL/inc_ecc_secp256k1.cl
index f9ec3419..9d56d4e9 100644
--- a/OpenCL/inc_ecc_secp256k1.cl
+++ b/OpenCL/inc_ecc_secp256k1.cl
@@ -512,6 +512,23 @@ DECLSPEC void mod_512 (u32 *n)
// substract (a -= r):
+ if ((r[ 0] == 0) &&
+ (r[ 1] == 0) &&
+ (r[ 2] == 0) &&
+ (r[ 3] == 0) &&
+ (r[ 4] == 0) &&
+ (r[ 5] == 0) &&
+ (r[ 6] == 0) &&
+ (r[ 7] == 0) &&
+ (r[ 8] == 0) &&
+ (r[ 9] == 0) &&
+ (r[10] == 0) &&
+ (r[11] == 0) &&
+ (r[12] == 0) &&
+ (r[13] == 0) &&
+ (r[14] == 0) &&
+ (r[15] == 0)) break;
+
r[ 0] = a[ 0] - r[ 0];
r[ 1] = a[ 1] - r[ 1];
r[ 2] = a[ 2] - r[ 2];
or (only makes sense for constant time):
Code:
diff --git a/OpenCL/inc_ecc_secp256k1.cl b/OpenCL/inc_ecc_secp256k1.cl
index f9ec3419..ff877ca1 100644
--- a/OpenCL/inc_ecc_secp256k1.cl
+++ b/OpenCL/inc_ecc_secp256k1.cl
@@ -512,6 +512,9 @@ DECLSPEC void mod_512 (u32 *n)
// substract (a -= r):
+ if ((r[ 0] | r[ 1] | r[ 2] | r[ 3] | r[ 4] | r[ 5] | r[ 6] | r[ 7] |
+ r[ 8] | r[ 9] | r[10] | r[11] | r[12] | r[13] | r[14] | r[15]) == 0) break;
+
r[ 0] = a[ 0] - r[ 0];
r[ 1] = a[ 1] - r[ 1];
r[ 2] = a[ 2] - r[ 2];
I will ask atom if this fix is good enough. thank you very much in the meantime