int n, dN, d0, d1;
BN_ULONG zz, *z;
- /* Since the algorithm does reduction in place, if a == r, copy the
+ /* Since the algorithm does reduction in the r value, if a != r, copy the
* contents of a into r so we can do reduction in r.
*/
- if ((a != NULL) && (a->d != r->d))
+ if (a != r)
{
if (!bn_wexpand(r, a->top)) return 0;
for (j = 0; j < a->top; j++)
BN_CTX_start(ctx);
if ((s = BN_CTX_get(ctx)) == NULL) goto err;
- zlen = a->top + b->top;
+ zlen = a->top + b->top + 4;
if (!bn_wexpand(s, zlen)) goto err;
s->top = zlen;