Lines Matching refs:dh

37     DH *dh = NULL;  in d2i_dhp()  local
41 dh = d2i_DHxparams(NULL, pp, length); in d2i_dhp()
43 dh = d2i_DHparams(NULL, pp, length); in d2i_dhp()
45 return dh; in d2i_dhp()
57 DH_free(pkey->pkey.dh); in int_dh_free()
70 DH *dh = NULL; in dh_pub_decode() local
85 if ((dh = d2i_dhp(pkey, &pm, pmlen)) == NULL) { in dh_pub_decode()
96 if ((dh->pub_key = ASN1_INTEGER_to_BN(public_key, NULL)) == NULL) { in dh_pub_decode()
102 EVP_PKEY_assign(pkey, pkey->ameth->pkey_id, dh); in dh_pub_decode()
107 DH_free(dh); in dh_pub_decode()
113 DH *dh; in dh_pub_encode() local
120 dh = pkey->pkey.dh; in dh_pub_encode()
127 str->length = i2d_dhp(pkey, dh, &str->data); in dh_pub_encode()
134 pub_key = BN_to_ASN1_INTEGER(dh->pub_key, NULL); in dh_pub_encode()
167 DH *dh = ossl_dh_key_from_pkcs8(p8, NULL, NULL); in dh_priv_decode() local
169 if (dh != NULL) { in dh_priv_decode()
171 EVP_PKEY_assign(pkey, pkey->ameth->pkey_id, dh); in dh_priv_decode()
191 params->length = i2d_dhp(pkey, pkey->pkey.dh, &params->data); in dh_priv_encode()
199 prkey = BN_to_ASN1_INTEGER(pkey->pkey.dh->priv_key, NULL); in dh_priv_encode()
230 DH *dh; in dh_param_decode() local
232 if ((dh = d2i_dhp(pkey, pder, derlen)) == NULL) in dh_param_decode()
234 dh->dirty_cnt++; in dh_param_decode()
235 EVP_PKEY_assign(pkey, pkey->ameth->pkey_id, dh); in dh_param_decode()
241 return i2d_dhp(pkey, pkey->pkey.dh, pder); in dh_param_encode()
302 return DH_size(pkey->pkey.dh); in int_dh_size()
307 return DH_bits(pkey->pkey.dh); in dh_bits()
312 return DH_security_bits(pkey->pkey.dh); in dh_security_bits()
317 return ossl_ffc_params_cmp(&a->pkey.dh->params, &b->pkey.dh->params, in dh_cmp_parameters()
333 DH *DHparams_dup(const DH *dh) in DHparams_dup() argument
339 if (!int_dh_param_copy(ret, dh, -1)) { in DHparams_dup()
348 if (to->pkey.dh == NULL) { in dh_copy_parameters()
349 to->pkey.dh = DH_new(); in dh_copy_parameters()
350 if (to->pkey.dh == NULL) in dh_copy_parameters()
353 return int_dh_param_copy(to->pkey.dh, from->pkey.dh, in dh_copy_parameters()
359 return a->pkey.dh == NULL in dh_missing_parameters()
360 || a->pkey.dh->params.p == NULL in dh_missing_parameters()
361 || a->pkey.dh->params.g == NULL; in dh_missing_parameters()
368 if (BN_cmp(b->pkey.dh->pub_key, a->pkey.dh->pub_key) != 0) in dh_pub_cmp()
377 return do_dh_print(bp, pkey->pkey.dh, indent, 0); in dh_param_print()
383 return do_dh_print(bp, pkey->pkey.dh, indent, 1); in dh_public_print()
389 return do_dh_print(bp, pkey->pkey.dh, indent, 2); in dh_private_print()
399 DH *dh; in dh_pkey_ctrl() local
405 dh = (DH *) evp_pkey_get0_DH_int(pkey); in dh_pkey_ctrl()
406 if (dh == NULL) in dh_pkey_ctrl()
408 return ossl_dh_buf2key(dh, arg2, arg1); in dh_pkey_ctrl()
410 dh = (DH *) EVP_PKEY_get0_DH(pkey); in dh_pkey_ctrl()
411 if (dh == NULL) in dh_pkey_ctrl()
413 return ossl_dh_key2buf(dh, arg2, 0, 1); in dh_pkey_ctrl()
430 DH *dh = pkey->pkey.dh; in dh_pkey_public_check() local
432 if (dh->pub_key == NULL) { in dh_pkey_public_check()
437 return DH_check_pub_key_ex(dh, dh->pub_key); in dh_pkey_public_check()
442 DH *dh = pkey->pkey.dh; in dh_pkey_param_check() local
444 return DH_check_ex(dh); in dh_pkey_param_check()
449 return pkey->pkey.dh->dirty_cnt; in dh_pkey_dirty_cnt()
456 DH *dh = from->pkey.dh; in dh_pkey_export_to() local
458 const BIGNUM *p = DH_get0_p(dh), *g = DH_get0_g(dh), *q = DH_get0_q(dh); in dh_pkey_export_to()
459 long l = DH_get_length(dh); in dh_pkey_export_to()
460 const BIGNUM *pub_key = DH_get0_pub_key(dh); in dh_pkey_export_to()
461 const BIGNUM *priv_key = DH_get0_priv_key(dh); in dh_pkey_export_to()
514 DH *dh = ossl_dh_new_ex(pctx->libctx); in dh_pkey_import_from_type() local
516 if (dh == NULL) { in dh_pkey_import_from_type()
520 DH_clear_flags(dh, DH_FLAG_TYPE_MASK); in dh_pkey_import_from_type()
521 DH_set_flags(dh, type == EVP_PKEY_DH ? DH_FLAG_TYPE_DH : DH_FLAG_TYPE_DHX); in dh_pkey_import_from_type()
523 if (!ossl_dh_params_fromdata(dh, params) in dh_pkey_import_from_type()
524 || !ossl_dh_key_fromdata(dh, params, 1) in dh_pkey_import_from_type()
525 || !EVP_PKEY_assign(pkey, type, dh)) { in dh_pkey_import_from_type()
526 DH_free(dh); in dh_pkey_import_from_type()
544 DH *dh = from->pkey.dh; in dh_pkey_copy() local
548 if (dh != NULL) { in dh_pkey_copy()
549 dupkey = ossl_dh_dup(dh, OSSL_KEYMGMT_SELECT_ALL); in dh_pkey_copy()