Lines Matching defs:sdiv

194     BIGNUM *tmp, wnum, *snum, *sdiv, *res;
241 sdiv = BN_CTX_get(ctx);
246 if (sdiv == NULL || res == NULL || tmp == NULL || snum == NULL)
251 if (!(BN_lshift(sdiv, divisor, norm_shift)))
253 sdiv->neg = 0;
258 div_n = sdiv->top;
273 /* Get the top 2 words of sdiv */
274 /* div_n=sdiv->top; */
275 d0 = sdiv->d[div_n - 1];
276 d1 = (div_n == 1) ? 0 : sdiv->d[div_n - 2];
292 if (BN_ucmp(&wnum, sdiv) >= 0) {
299 bn_sub_words(wnum.d, wnum.d, sdiv->d, div_n);
315 * the first part of the loop uses the top two words of snum and sdiv
316 * to calculate a BN_ULONG q such that | wnum - sdiv * q | < sdiv
404 l0 = bn_mul_words(tmp->d, sdiv->d, div_n, q);
414 * the calculation of q, sdiv * q might be greater than wnum (but
415 * then (q-1) * sdiv is less or equal than wnum)
418 if (bn_add_words(wnum.d, wnum.d, sdiv->d, div_n))
456 BIGNUM *tmp, wnum, *snum, *sdiv, *res;
476 sdiv = BN_CTX_get(ctx);
481 if (sdiv == NULL || res == NULL)
486 if (!(BN_lshift(sdiv, divisor, norm_shift)))
488 sdiv->neg = 0;
495 * Since we don't know whether snum is larger than sdiv, we pad snum with
498 if (snum->top <= sdiv->top + 1) {
499 if (bn_wexpand(snum, sdiv->top + 2) == NULL)
501 for (i = snum->top; i < sdiv->top + 2; i++)
503 snum->top = sdiv->top + 2;
511 div_n = sdiv->top;
526 /* Get the top 2 words of sdiv */
527 /* div_n=sdiv->top; */
528 d0 = sdiv->d[div_n - 1];
529 d1 = (div_n == 1) ? 0 : sdiv->d[div_n - 2];
557 * the first part of the loop uses the top two words of snum and sdiv
558 * to calculate a BN_ULONG q such that | wnum - sdiv * q | < sdiv
646 l0 = bn_mul_words(tmp->d, sdiv->d, div_n, q);
656 * the calculation of q, sdiv * q might be greater than wnum (but
657 * then (q-1) * sdiv is less or equal than wnum)
660 if (bn_add_words(wnum.d, wnum.d, sdiv->d, div_n))