Lines Matching refs:ret
32 BN_BLINDING *ret = NULL; in BN_BLINDING_new() local
36 if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) in BN_BLINDING_new()
39 ret->lock = CRYPTO_THREAD_lock_new(); in BN_BLINDING_new()
40 if (ret->lock == NULL) { in BN_BLINDING_new()
42 OPENSSL_free(ret); in BN_BLINDING_new()
46 BN_BLINDING_set_current_thread(ret); in BN_BLINDING_new()
49 if ((ret->A = BN_dup(A)) == NULL) in BN_BLINDING_new()
54 if ((ret->Ai = BN_dup(Ai)) == NULL) in BN_BLINDING_new()
59 if ((ret->mod = BN_dup(mod)) == NULL) in BN_BLINDING_new()
63 BN_set_flags(ret->mod, BN_FLG_CONSTTIME); in BN_BLINDING_new()
70 ret->counter = -1; in BN_BLINDING_new()
72 return ret; in BN_BLINDING_new()
75 BN_BLINDING_free(ret); in BN_BLINDING_new()
93 int ret = 0; in BN_BLINDING_update() local
120 ret = 1; in BN_BLINDING_update()
124 return ret; in BN_BLINDING_update()
134 int ret = 1; in BN_BLINDING_convert_ex() local
153 ret = BN_mod_mul_montgomery(n, n, b->A, b->m_ctx, ctx); in BN_BLINDING_convert_ex()
155 ret = BN_mod_mul(n, n, b->A, b->mod, ctx); in BN_BLINDING_convert_ex()
157 return ret; in BN_BLINDING_convert_ex()
168 int ret; in BN_BLINDING_invert_ex() local
192 ret = bn_mul_mont_fixed_top(n, n, r, b->m_ctx, ctx); in BN_BLINDING_invert_ex()
195 ret = BN_mod_mul(n, n, r, b->mod, ctx); in BN_BLINDING_invert_ex()
199 return ret; in BN_BLINDING_invert_ex()
243 BN_BLINDING *ret = NULL; in BN_BLINDING_create_param() local
246 ret = BN_BLINDING_new(NULL, NULL, m); in BN_BLINDING_create_param()
248 ret = b; in BN_BLINDING_create_param()
250 if (ret == NULL) in BN_BLINDING_create_param()
253 if (ret->A == NULL && (ret->A = BN_new()) == NULL) in BN_BLINDING_create_param()
255 if (ret->Ai == NULL && (ret->Ai = BN_new()) == NULL) in BN_BLINDING_create_param()
259 BN_free(ret->e); in BN_BLINDING_create_param()
260 ret->e = BN_dup(e); in BN_BLINDING_create_param()
262 if (ret->e == NULL) in BN_BLINDING_create_param()
266 ret->bn_mod_exp = bn_mod_exp; in BN_BLINDING_create_param()
268 ret->m_ctx = m_ctx; in BN_BLINDING_create_param()
272 if (!BN_priv_rand_range_ex(ret->A, ret->mod, 0, ctx)) in BN_BLINDING_create_param()
274 if (int_bn_mod_inverse(ret->Ai, ret->A, ret->mod, ctx, &rv)) in BN_BLINDING_create_param()
289 if (ret->bn_mod_exp != NULL && ret->m_ctx != NULL) { in BN_BLINDING_create_param()
290 if (!ret->bn_mod_exp(ret->A, ret->A, ret->e, ret->mod, ctx, ret->m_ctx)) in BN_BLINDING_create_param()
293 if (!BN_mod_exp(ret->A, ret->A, ret->e, ret->mod, ctx)) in BN_BLINDING_create_param()
297 if (ret->m_ctx != NULL) { in BN_BLINDING_create_param()
298 if (!bn_to_mont_fixed_top(ret->Ai, ret->Ai, ret->m_ctx, ctx) in BN_BLINDING_create_param()
299 || !bn_to_mont_fixed_top(ret->A, ret->A, ret->m_ctx, ctx)) in BN_BLINDING_create_param()
303 return ret; in BN_BLINDING_create_param()
306 BN_BLINDING_free(ret); in BN_BLINDING_create_param()
307 ret = NULL; in BN_BLINDING_create_param()
310 return ret; in BN_BLINDING_create_param()