Lines Matching refs:ret
32 BN_BLINDING *ret = NULL;
36 if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) {
41 ret->lock = CRYPTO_THREAD_lock_new();
42 if (ret->lock == NULL) {
44 OPENSSL_free(ret);
48 BN_BLINDING_set_current_thread(ret);
51 if ((ret->A = BN_dup(A)) == NULL)
56 if ((ret->Ai = BN_dup(Ai)) == NULL)
61 if ((ret->mod = BN_dup(mod)) == NULL)
65 BN_set_flags(ret->mod, BN_FLG_CONSTTIME);
72 ret->counter = -1;
74 return ret;
77 BN_BLINDING_free(ret);
95 int ret = 0;
122 ret = 1;
126 return ret;
136 int ret = 1;
155 ret = BN_mod_mul_montgomery(n, n, b->A, b->m_ctx, ctx);
157 ret = BN_mod_mul(n, n, b->A, b->mod, ctx);
159 return ret;
170 int ret;
194 ret = bn_mul_mont_fixed_top(n, n, r, b->m_ctx, ctx);
197 ret = BN_mod_mul(n, n, r, b->mod, ctx);
201 return ret;
245 BN_BLINDING *ret = NULL;
248 ret = BN_BLINDING_new(NULL, NULL, m);
250 ret = b;
252 if (ret == NULL)
255 if (ret->A == NULL && (ret->A = BN_new()) == NULL)
257 if (ret->Ai == NULL && (ret->Ai = BN_new()) == NULL)
261 BN_free(ret->e);
262 ret->e = BN_dup(e);
264 if (ret->e == NULL)
268 ret->bn_mod_exp = bn_mod_exp;
270 ret->m_ctx = m_ctx;
274 if (!BN_priv_rand_range_ex(ret->A, ret->mod, 0, ctx))
276 if (int_bn_mod_inverse(ret->Ai, ret->A, ret->mod, ctx, &rv))
291 if (ret->bn_mod_exp != NULL && ret->m_ctx != NULL) {
292 if (!ret->bn_mod_exp(ret->A, ret->A, ret->e, ret->mod, ctx, ret->m_ctx))
295 if (!BN_mod_exp(ret->A, ret->A, ret->e, ret->mod, ctx))
299 if (ret->m_ctx != NULL) {
300 if (!bn_to_mont_fixed_top(ret->Ai, ret->Ai, ret->m_ctx, ctx)
301 || !bn_to_mont_fixed_top(ret->A, ret->A, ret->m_ctx, ctx))
305 return ret;
308 BN_BLINDING_free(ret);
309 ret = NULL;
312 return ret;