Lines Matching refs:dh
32 int DH_set_method(DH *dh, const DH_METHOD *meth) in DH_set_method() argument
39 mtmp = dh->meth; in DH_set_method()
41 mtmp->finish(dh); in DH_set_method()
43 ENGINE_finish(dh->engine); in DH_set_method()
44 dh->engine = NULL; in DH_set_method()
46 dh->meth = meth; in DH_set_method()
48 meth->init(dh); in DH_set_method()
52 const DH_METHOD *ossl_dh_get_method(const DH *dh) in ossl_dh_get_method() argument
54 return dh->meth; in ossl_dh_get_method()
196 int DH_bits(const DH *dh) in DH_bits() argument
198 if (dh->params.p != NULL) in DH_bits()
199 return BN_num_bits(dh->params.p); in DH_bits()
203 int DH_size(const DH *dh) in DH_size() argument
205 if (dh->params.p != NULL) in DH_size()
206 return BN_num_bytes(dh->params.p); in DH_size()
210 int DH_security_bits(const DH *dh) in DH_security_bits() argument
214 if (dh->params.q != NULL) in DH_security_bits()
215 N = BN_num_bits(dh->params.q); in DH_security_bits()
216 else if (dh->length) in DH_security_bits()
217 N = dh->length; in DH_security_bits()
220 if (dh->params.p != NULL) in DH_security_bits()
221 return BN_security_bits(BN_num_bits(dh->params.p), N); in DH_security_bits()
225 void DH_get0_pqg(const DH *dh, in DH_get0_pqg() argument
228 ossl_ffc_params_get0_pqg(&dh->params, p, q, g); in DH_get0_pqg()
231 int DH_set0_pqg(DH *dh, BIGNUM *p, BIGNUM *q, BIGNUM *g) in DH_set0_pqg() argument
237 if ((dh->params.p == NULL && p == NULL) in DH_set0_pqg()
238 || (dh->params.g == NULL && g == NULL)) in DH_set0_pqg()
241 ossl_ffc_params_set0_pqg(&dh->params, p, q, g); in DH_set0_pqg()
242 ossl_dh_cache_named_group(dh); in DH_set0_pqg()
243 dh->dirty_cnt++; in DH_set0_pqg()
247 long DH_get_length(const DH *dh) in DH_get_length() argument
249 return dh->length; in DH_get_length()
252 int DH_set_length(DH *dh, long length) in DH_set_length() argument
254 dh->length = length; in DH_set_length()
255 dh->dirty_cnt++; in DH_set_length()
259 void DH_get0_key(const DH *dh, const BIGNUM **pub_key, const BIGNUM **priv_key) in DH_get0_key() argument
262 *pub_key = dh->pub_key; in DH_get0_key()
264 *priv_key = dh->priv_key; in DH_get0_key()
267 int DH_set0_key(DH *dh, BIGNUM *pub_key, BIGNUM *priv_key) in DH_set0_key() argument
270 BN_clear_free(dh->pub_key); in DH_set0_key()
271 dh->pub_key = pub_key; in DH_set0_key()
274 BN_clear_free(dh->priv_key); in DH_set0_key()
275 dh->priv_key = priv_key; in DH_set0_key()
278 dh->dirty_cnt++; in DH_set0_key()
282 const BIGNUM *DH_get0_p(const DH *dh) in DH_get0_p() argument
284 return dh->params.p; in DH_get0_p()
287 const BIGNUM *DH_get0_q(const DH *dh) in DH_get0_q() argument
289 return dh->params.q; in DH_get0_q()
292 const BIGNUM *DH_get0_g(const DH *dh) in DH_get0_g() argument
294 return dh->params.g; in DH_get0_g()
297 const BIGNUM *DH_get0_priv_key(const DH *dh) in DH_get0_priv_key() argument
299 return dh->priv_key; in DH_get0_priv_key()
302 const BIGNUM *DH_get0_pub_key(const DH *dh) in DH_get0_pub_key() argument
304 return dh->pub_key; in DH_get0_pub_key()
307 void DH_clear_flags(DH *dh, int flags) in DH_clear_flags() argument
309 dh->flags &= ~flags; in DH_clear_flags()
312 int DH_test_flags(const DH *dh, int flags) in DH_test_flags() argument
314 return dh->flags & flags; in DH_test_flags()
317 void DH_set_flags(DH *dh, int flags) in DH_set_flags() argument
319 dh->flags |= flags; in DH_set_flags()
323 ENGINE *DH_get0_engine(DH *dh) in DH_get0_engine() argument
325 return dh->engine; in DH_get0_engine()
329 FFC_PARAMS *ossl_dh_get0_params(DH *dh) in ossl_dh_get0_params() argument
331 return &dh->params; in ossl_dh_get0_params()
333 int ossl_dh_get0_nid(const DH *dh) in ossl_dh_get0_nid() argument
335 return dh->params.nid; in ossl_dh_get0_nid()