Lines Matching refs:dh
57 #include <openssl/dh.h>
2462 DH *dh = NULL;
2470 if ((dh = DH_new()) == NULL)
2472 dh->p = p;
2473 p = NULL; /* p is now part of dh structure */
2474 dh->g = NULL;
2475 if ((dh->g = BN_new()) == NULL)
2477 if (!BN_set_word(dh->g, g))
2482 dh->priv_length = publen;
2484 dh->length = publen;
2489 if (!DH_generate_key(dh))
2493 if (eay_bn2v(pub, dh->pub_key) < 0)
2495 if (eay_bn2v(priv, dh->priv_key) < 0) {
2503 if (dh != NULL)
2504 DH_free(dh);
2516 DH *dh = NULL;
2526 if ((dh = DH_new()) == NULL)
2528 if (eay_v2bn(&dh->p, prime) < 0)
2530 if (eay_v2bn(&dh->pub_key, pub) < 0)
2532 if (eay_v2bn(&dh->priv_key, priv) < 0)
2535 dh->priv_length = pub2->l * 8;
2537 dh->length = pub2->l * 8;
2540 dh->g = NULL;
2541 if ((dh->g = BN_new()) == NULL)
2543 if (!BN_set_word(dh->g, g))
2548 if ((l = DH_compute_key(v, dh_pub, dh)) == -1)
2557 if (dh != NULL)
2558 DH_free(dh);