Browse Source

Merge pull request #3341 from philsmd/mul_mod128

fixes #3337: rename function mul_mod to mul_mod128 for BigNum lib
pull/3346/head
Jens Steube 2 months ago committed by GitHub
parent
commit
124e1fd40a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 8
      OpenCL/inc_bignum_operations.cl
  2. 2
      OpenCL/inc_bignum_operations.h
  3. 4
      OpenCL/m29200_a0-pure.cl
  4. 4
      OpenCL/m29200_a1-pure.cl
  5. 4
      OpenCL/m29200_a3-pure.cl

8
OpenCL/inc_bignum_operations.cl

@ -846,7 +846,7 @@ DECLSPEC void mul_masked (PRIVATE_AS u32 *r, PRIVATE_AS const u32 *x, PRIVATE_AS
// m [128], modulo
// fact[ 64], our m' (actually it is fact[65])
DECLSPEC void mul_mod (PRIVATE_AS u32 *x, PRIVATE_AS const u32 *y, PRIVATE_AS const u32 *m, PRIVATE_AS const u32 *fact)
DECLSPEC void mul_mod128 (PRIVATE_AS u32 *x, PRIVATE_AS const u32 *y, PRIVATE_AS const u32 *m, PRIVATE_AS const u32 *fact)
{
// 1st multiplication
// p = x * y
@ -1411,7 +1411,7 @@ DECLSPEC void pow_mod_precomp_g (PRIVATE_AS u32 *r, PRIVATE_AS const u32 *b_pre,
const u32 bit_set = (y[div] >> mod) & 1;
if (bit_set == 1) mul_mod (r, b_pre + i * 64, m, fact);
if (bit_set == 1) mul_mod128 (r, b_pre + i * 64, m, fact);
}
}
@ -1445,9 +1445,9 @@ DECLSPEC void pow_mod (PRIVATE_AS u32 *r, PRIVATE_AS u32 *x, PRIVATE_AS const u3
const u32 bit_set = (y[div] >> mod) & 1;
if (bit_set == 1) mul_mod (r, x, m, fact);
if (bit_set == 1) mul_mod128 (r, x, m, fact);
mul_mod (x, x, m, fact);
mul_mod128 (x, x, m, fact);
}
}

2
OpenCL/inc_bignum_operations.h

@ -9,7 +9,7 @@
DECLSPEC void mod_4096 (PRIVATE_AS u32 *n, PRIVATE_AS const u32 *m);
DECLSPEC void mul (PRIVATE_AS u32 *r, PRIVATE_AS const u32 *x, PRIVATE_AS const u32 *y);
DECLSPEC void mul_masked (PRIVATE_AS u32 *r, PRIVATE_AS const u32 *x, PRIVATE_AS const u32 *y);
DECLSPEC void mul_mod (PRIVATE_AS u32 *x, PRIVATE_AS const u32 *y, PRIVATE_AS const u32 *m, PRIVATE_AS const u32 *fact);
DECLSPEC void mul_mod128 (PRIVATE_AS u32 *x, PRIVATE_AS const u32 *y, PRIVATE_AS const u32 *m, PRIVATE_AS const u32 *fact);
DECLSPEC void pow_mod_precomp_g (PRIVATE_AS u32 *r, PRIVATE_AS const u32 *b_pre, PRIVATE_AS const u32 *y, PRIVATE_AS const u32 *m, PRIVATE_AS const u32 *fact);
DECLSPEC void pow_mod (PRIVATE_AS u32 *r, PRIVATE_AS u32 *x, PRIVATE_AS const u32 *y, PRIVATE_AS const u32 *m, PRIVATE_AS const u32 *fact);

4
OpenCL/m29200_a0-pure.cl

@ -276,7 +276,7 @@ KERNEL_FQ void m29200_mxx (KERN_ATTR_RULES_ESALT (radmin3_t))
esalt_bufs[DIGESTS_OFFSET_HOST].pre[pre_idx + 63],
};
mul_mod (r_t, pre, m, fact); // r_t = (r_t * RADMIN3_PRE[n]) % m
mul_mod128 (r_t, pre, m, fact); // r_t = (r_t * RADMIN3_PRE[n]) % m
}
const u32 r0 = r_t[0];
@ -544,7 +544,7 @@ KERNEL_FQ void m29200_sxx (KERN_ATTR_RULES_ESALT (radmin3_t))
esalt_bufs[DIGESTS_OFFSET_HOST].pre[pre_idx + 63],
};
mul_mod (r_t, pre, m, fact); // r_t = (r_t * RADMIN3_PRE[n]) % m
mul_mod128 (r_t, pre, m, fact); // r_t = (r_t * RADMIN3_PRE[n]) % m
}
const u32 r0 = r_t[0];

4
OpenCL/m29200_a1-pure.cl

@ -279,7 +279,7 @@ KERNEL_FQ void m29200_mxx (KERN_ATTR_ESALT (radmin3_t))
esalt_bufs[DIGESTS_OFFSET_HOST].pre[pre_idx + 63],
};
mul_mod (r_t, pre, m, fact); // r_t = (r_t * RADMIN3_PRE[n]) % m
mul_mod128 (r_t, pre, m, fact); // r_t = (r_t * RADMIN3_PRE[n]) % m
}
const u32 r0 = r_t[0];
@ -552,7 +552,7 @@ KERNEL_FQ void m29200_sxx (KERN_ATTR_ESALT (radmin3_t))
esalt_bufs[DIGESTS_OFFSET_HOST].pre[pre_idx + 63],
};
mul_mod (r_t, pre, m, fact); // r_t = (r_t * RADMIN3_PRE[n]) % m
mul_mod128 (r_t, pre, m, fact); // r_t = (r_t * RADMIN3_PRE[n]) % m
}
const u32 r0 = r_t[0];

4
OpenCL/m29200_a3-pure.cl

@ -286,7 +286,7 @@ KERNEL_FQ void m29200_mxx (KERN_ATTR_VECTOR_ESALT (radmin3_t))
esalt_bufs[DIGESTS_OFFSET_HOST].pre[pre_idx + 63],
};
mul_mod (r_t, pre, m, fact); // r_t = (r_t * RADMIN3_PRE[n]) % m
mul_mod128 (r_t, pre, m, fact); // r_t = (r_t * RADMIN3_PRE[n]) % m
}
const u32 r0 = r_t[0];
@ -567,7 +567,7 @@ KERNEL_FQ void m29200_sxx (KERN_ATTR_VECTOR_ESALT (radmin3_t))
esalt_bufs[DIGESTS_OFFSET_HOST].pre[pre_idx + 63],
};
mul_mod (r_t, pre, m, fact); // r_t = (r_t * RADMIN3_PRE[n]) % m
mul_mod128 (r_t, pre, m, fact); // r_t = (r_t * RADMIN3_PRE[n]) % m
}
const u32 r0 = r_t[0];

Loading…
Cancel
Save