/* Insert into FACTORS the result of factoring N,
using Pollard-rho with starting value A. N must be odd. */
static void
-factor_using_pollard_rho (struct factors *factors,
- mp_limb_t n, unsigned long int a)
+factor_using_pollard_rho (struct factors *factors, mp_limb_t n, mp_limb_t a)
{
mp_limb_t x, z, y, P, t, ni, g;
static void
factor_using_pollard_rho2 (struct factors *factors,
- mp_limb_t n1, mp_limb_t n0, unsigned long int a)
+ mp_limb_t n1, mp_limb_t n0, mp_limb_t a)
{
mp_limb_t x1, x0, z1, z0, y1, y0, P1, P0, t1, t0, g1, g0, r1m;
{
x0 = mulredc2 (&r1m, x1, x0, x1, x0, n1, n0, ni);
x1 = r1m;
- addmod2 (x1, x0, x1, x0, 0, (mp_limb_t) a, n1, n0);
+ addmod2 (x1, x0, x1, x0, 0, a, n1, n0);
submod2 (t1, t0, z1, z0, x1, x0, n1, n0);
P0 = mulredc2 (&r1m, P1, P0, t1, t0, n1, n0, ni);
{
x0 = mulredc2 (&r1m, x1, x0, x1, x0, n1, n0, ni);
x1 = r1m;
- addmod2 (x1, x0, x1, x0, 0, (mp_limb_t) a, n1, n0);
+ addmod2 (x1, x0, x1, x0, 0, a, n1, n0);
}
y1 = x1; y0 = x0;
}
{
y0 = mulredc2 (&r1m, y1, y0, y1, y0, n1, n0, ni);
y1 = r1m;
- addmod2 (y1, y0, y1, y0, 0, (mp_limb_t) a, n1, n0);
+ addmod2 (y1, y0, y1, y0, 0, a, n1, n0);
submod2 (t1, t0, z1, z0, y1, y0, n1, n0);
uuset (&g1, &g0, gcd2_odd (t1, t0, n1, n0));