Lines Matching refs:ret
23 static int bn_from_montgomery_word(BIGNUM *ret, BIGNUM *r, BN_MONT_CTX *mont);
29 int ret = bn_mul_mont_fixed_top(r, a, b, mont, ctx);
34 return ret;
41 int ret = 0;
81 ret = 1;
84 return ret;
88 static int bn_from_montgomery_word(BIGNUM *ret, BIGNUM *r, BN_MONT_CTX *mont)
98 ret->top = 0;
133 if (bn_wexpand(ret, nl) == NULL)
135 ret->top = nl;
136 ret->flags |= BN_FLG_FIXED_TOP;
137 ret->neg = r->neg;
139 rp = ret->d;
162 int BN_from_montgomery(BIGNUM *ret, const BIGNUM *a, BN_MONT_CTX *mont,
167 retn = bn_from_mont_fixed_top(ret, a, mont, ctx);
168 bn_correct_top(ret);
169 bn_check_top(ret);
174 int bn_from_mont_fixed_top(BIGNUM *ret, const BIGNUM *a, BN_MONT_CTX *mont,
183 retn = bn_from_montgomery_word(ret, t, mont);
207 if (!BN_rshift(ret, t2, mont->ri))
210 if (BN_ucmp(ret, &(mont->N)) >= 0) {
211 if (!BN_usub(ret, ret, &(mont->N)))
215 bn_check_top(ret);
230 BN_MONT_CTX *ret;
232 if ((ret = OPENSSL_malloc(sizeof(*ret))) == NULL) {
237 BN_MONT_CTX_init(ret);
238 ret->flags = BN_FLG_MALLOCED;
239 return ret;
265 int i, ret = 0;
400 for (i = mont->RR.top, ret = mont->N.top; i < ret; i++)
402 mont->RR.top = ret;
405 ret = 1;
408 return ret;
431 BN_MONT_CTX *ret;
435 ret = *pmont;
437 if (ret)
438 return ret;
448 ret = BN_MONT_CTX_new();
449 if (ret == NULL)
451 if (!BN_MONT_CTX_set(ret, mod, ctx)) {
452 BN_MONT_CTX_free(ret);
458 BN_MONT_CTX_free(ret);
463 BN_MONT_CTX_free(ret);
464 ret = *pmont;
466 *pmont = ret;
468 return ret;