Home | History | Annotate | Download | only in bn

Lines Matching refs:sdiv

185 	BIGNUM *tmp,wnum,*snum,*sdiv,*res;
229 sdiv=BN_CTX_get(ctx);
233 if (sdiv == NULL || res == NULL || tmp == NULL || snum == NULL)
238 if (!(BN_lshift(sdiv,divisor,norm_shift))) goto err;
239 sdiv->neg=0;
246 /* Since we don't know whether snum is larger than sdiv,
250 if (snum->top <= sdiv->top+1)
252 if (bn_wexpand(snum, sdiv->top + 2) == NULL) goto err;
253 for (i = snum->top; i < sdiv->top + 2; i++) snum->d[i] = 0;
254 snum->top = sdiv->top + 2;
264 div_n=sdiv->top;
276 /* Get the top 2 words of sdiv */
277 /* div_n=sdiv->top; */
278 d0=sdiv->d[div_n-1];
279 d1=(div_n == 1)?0:sdiv->d[div_n-2];
295 if (BN_ucmp(&wnum,sdiv) >= 0)
301 bn_sub_words(wnum.d, wnum.d, sdiv->d, div_n);
319 * snum and sdiv to calculate a BN_ULONG q such that
320 * | wnum - sdiv * q | < sdiv */
406 l0=bn_mul_words(tmp->d,sdiv->d,div_n,q);
414 * two BN_ULONGs in the calculation of q, sdiv * q
415 * might be greater than wnum (but then (q-1) * sdiv
419 if (bn_add_words(wnum.d, wnum.d, sdiv->d, div_n))