goto done;
}
- /* --- Main case with powers of two --- */
+ /* --- Strip out powers of two from %$a$% --- */
a = mp_odd(a, a, &e);
nn = n->v[0] & 7;
s = -s;
if (MP_LEN(a) == 1 && a->v[0] == 1)
goto done;
- if ((nn & 3) == 3 && (a->v[0] & 3) == 3)
- s = -s;
- /* --- Reduce and swap --- */
+ /* --- Reduce and swap, applying quadratic residuosity --- */
+ if ((nn & 3) == 3 && (a->v[0] & 3) == 3)
+ s = -s;
mp_div(0, &n, n, a);
{ mp *t = n; n = a; a = t; }
}