Lines Matching refs:ret
35 static int dh_builtin_genparams(DH *ret, int prime_len, int generator,
42 int ret, res; in ossl_dh_generate_ffc_parameters() local
46 ret = ossl_ffc_params_FIPS186_2_generate(dh->libctx, &dh->params, in ossl_dh_generate_ffc_parameters()
51 ret = ossl_ffc_params_FIPS186_4_generate(dh->libctx, &dh->params, in ossl_dh_generate_ffc_parameters()
54 if (ret > 0) in ossl_dh_generate_ffc_parameters()
56 return ret; in ossl_dh_generate_ffc_parameters()
95 static int dh_gen_named_group(OSSL_LIB_CTX *libctx, DH *ret, int prime_len) in dh_gen_named_group() argument
106 && ossl_ffc_params_copy(&ret->params, &dh->params)) { in dh_gen_named_group()
108 ret->dirty_cnt++; in dh_gen_named_group()
115 int DH_generate_parameters_ex(DH *ret, int prime_len, int generator, in DH_generate_parameters_ex() argument
121 return dh_gen_named_group(ret->libctx, ret, prime_len); in DH_generate_parameters_ex()
123 if (ret->meth->generate_params) in DH_generate_parameters_ex()
124 return ret->meth->generate_params(ret, prime_len, generator, cb); in DH_generate_parameters_ex()
125 return dh_builtin_genparams(ret, prime_len, generator, cb); in DH_generate_parameters_ex()
156 static int dh_builtin_genparams(DH *ret, int prime_len, int generator, in dh_builtin_genparams() argument
173 ctx = BN_CTX_new_ex(ret->libctx); in dh_builtin_genparams()
183 if (ret->params.p == NULL && ((ret->params.p = BN_new()) == NULL)) in dh_builtin_genparams()
185 if (ret->params.g == NULL && ((ret->params.g = BN_new()) == NULL)) in dh_builtin_genparams()
217 if (!BN_generate_prime_ex2(ret->params.p, prime_len, 1, t1, t2, cb, ctx)) in dh_builtin_genparams()
221 if (!BN_set_word(ret->params.g, g)) in dh_builtin_genparams()
224 ret->length = (2 * ossl_ifc_ffc_compute_security_bits(prime_len) in dh_builtin_genparams()
226 ret->dirty_cnt++; in dh_builtin_genparams()