Lines Matching refs:dv
17 int BN_div(BIGNUM *dv, BIGNUM *rem, const BIGNUM *m, const BIGNUM *d,
36 if (dv != NULL)
37 BN_zero(dv);
43 if (dv == NULL)
44 dv = BN_CTX_get(ctx);
47 if (D == NULL || dv == NULL || rem == NULL)
58 * The next 2 are needed so we can do a dv->d[0]|=1 later since
61 BN_zero(dv);
62 if (bn_wexpand(dv, 1) == NULL)
64 dv->top = 1;
69 if (!BN_lshift1(dv, dv))
72 dv->d[0] |= 1;
81 dv->neg = m->neg ^ d->neg;
202 * BN_div computes dv := num / divisor, rounding towards
203 * zero, and sets up rm such that dv*divisor + rm = num holds.
205 * dv->neg == num->neg ^ divisor->neg (unless the result is zero)
207 * If 'dv' or 'rm' is NULL, the respective value is not returned.
209 int BN_div(BIGNUM *dv, BIGNUM *rm, const BIGNUM *num, const BIGNUM *divisor,
229 ret = bn_div_fixed_top(dv, rm, num, divisor, ctx);
232 if (dv != NULL)
233 bn_correct_top(dv);
250 * of significant limbs. This naturally means that quotient, |dv|, would
264 int bn_div_fixed_top(BIGNUM *dv, BIGNUM *rm, const BIGNUM *num,
277 bn_check_top(dv);
281 res = (dv == NULL) ? BN_CTX_get(ctx) : dv;