Home | History | Annotate | Download | only in bn

Lines Matching refs:ret

139 	BN_BLINDING *ret=NULL;
143 if ((ret=(BN_BLINDING *)OPENSSL_malloc(sizeof(BN_BLINDING))) == NULL)
148 memset(ret,0,sizeof(BN_BLINDING));
151 if ((ret->A = BN_dup(A)) == NULL) goto err;
155 if ((ret->Ai = BN_dup(Ai)) == NULL) goto err;
159 if ((ret->mod = BN_dup(mod)) == NULL) goto err;
161 BN_set_flags(ret->mod, BN_FLG_CONSTTIME);
163 ret->counter = BN_BLINDING_COUNTER;
164 CRYPTO_THREADID_current(&ret->tid);
165 return(ret);
167 if (ret != NULL) BN_BLINDING_free(ret);
185 int ret=0;
206 ret=1;
210 return(ret);
220 int ret = 1;
232 if (!BN_copy(r, b->Ai)) ret=0;
235 if (!BN_mod_mul(n,n,b->A,b->mod,ctx)) ret=0;
237 return ret;
247 int ret;
257 ret = BN_mod_mul(n, n, r, b->mod, ctx);
259 ret = BN_mod_mul(n, n, b->Ai, b->mod, ctx);
261 if (ret >= 0)
267 return(ret);
304 BN_BLINDING *ret = NULL;
307 ret = BN_BLINDING_new(NULL, NULL, m);
309 ret = b;
311 if (ret == NULL)
314 if (ret->A == NULL && (ret->A = BN_new()) == NULL)
316 if (ret->Ai == NULL && (ret->Ai = BN_new()) == NULL)
321 if (ret->e != NULL)
322 BN_free(ret->e);
323 ret->e = BN_dup(e);
325 if (ret->e == NULL)
329 ret->bn_mod_exp = bn_mod_exp;
331 ret->m_ctx = m_ctx;
334 if (!BN_rand_range(ret->A, ret->mod)) goto err;
335 if (BN_mod_inverse(ret->Ai, ret->A, ret->mod, ctx) == NULL)
356 if (ret->bn_mod_exp != NULL && ret->m_ctx != NULL)
358 if (!ret->bn_mod_exp(ret->A, ret->A, ret->e, ret->mod, ctx, ret->m_ctx))
363 if (!BN_mod_exp(ret->A, ret->A, ret->e, ret->mod, ctx))
367 return ret;
369 if (b == NULL && ret != NULL)
371 BN_BLINDING_free(ret);
372 ret = NULL;
375 return ret;