Lines Matching defs:dh

78 DH_get0_key(const DH *dh, const BIGNUM **pub_key, const BIGNUM **priv_key) {
80 *pub_key = dh->pub_key;
82 *priv_key = dh->priv_key;
86 DH_set0_key(DH *dh, BIGNUM *pub_key, BIGNUM *priv_key) {
91 BN_free(dh->pub_key);
92 BN_free(dh->priv_key);
93 dh->pub_key = pub_key;
94 dh->priv_key = priv_key;
100 DH_get0_pqg(const DH *dh,
104 *p = dh->p;
106 *q = dh->q;
108 *g = dh->g;
112 DH_set0_pqg(DH *dh, BIGNUM *p, BIGNUM *q, BIGNUM *g) {
116 BN_free(dh->p);
117 BN_free(dh->q);
118 BN_free(dh->g);
119 dh->p = p;
120 dh->q = q;
121 dh->g = g;
124 dh->length = BN_num_bits(q);
144 REQUIRE(pub->keydata.dh != NULL);
145 REQUIRE(priv->keydata.dh != NULL);
147 dhpub = pub->keydata.dh;
148 dhpriv = priv->keydata.dh;
171 dh1 = key1->keydata.dh;
172 dh2 = key2->keydata.dh;
202 dh1 = key1->keydata.dh;
203 dh2 = key2->keydata.dh;
237 DH *dh = NULL;
258 dh = DH_new();
266 if (dh == NULL || p == NULL || g == NULL) {
267 if (dh != NULL)
268 DH_free(dh);
275 DH_set0_pqg(dh, p, NULL, g);
282 dh = DH_new();
283 if (dh == NULL)
288 DH_free(dh);
299 if (!DH_generate_parameters_ex(dh, key->key_size, generator,
301 DH_free(dh);
309 dh = DH_generate_parameters(key->key_size, generator,
311 if (dh == NULL)
318 if (DH_generate_key(dh) == 0) {
319 DH_free(dh);
323 DH_clear_flags(dh, DH_FLAG_CACHE_MONT_P);
324 key->keydata.dh = dh;
331 DH *dh = key->keydata.dh;
334 DH_get0_key(dh, NULL, &priv_key);
335 return (ISC_TF(dh != NULL && priv_key != NULL));
340 DH *dh = key->keydata.dh;
342 if (dh == NULL)
345 DH_free(dh);
346 key->keydata.dh = NULL;
372 DH *dh;
377 REQUIRE(key->keydata.dh != NULL);
379 dh = key->keydata.dh;
383 DH_get0_pqg(dh, &p, NULL, &g);
395 DH_get0_key(dh, &pub_key, NULL);
429 DH *dh;
439 dh = DH_new();
440 if (dh == NULL)
442 DH_clear_flags(dh, DH_FLAG_CACHE_MONT_P);
449 DH_free(dh);
454 DH_free(dh);
458 DH_free(dh);
479 DH_free(dh);
493 DH_free(dh);
498 DH_free(dh);
507 DH_free(dh);
514 DH_free(dh);
522 DH_free(dh);
529 DH_set0_pqg(dh, p, NULL, g);
532 DH_free(dh);
537 DH_free(dh);
542 DH_free(dh);
545 DH_set0_key(dh, pub_key, NULL);
552 key->keydata.dh = dh;
560 DH *dh;
566 if (key->keydata.dh == NULL)
572 dh = key->keydata.dh;
573 DH_get0_key(dh, &pub_key, &priv_key);
574 DH_get0_pqg(dh, &p, NULL, &g);
627 DH *dh = NULL;
643 dh = DH_new();
644 if (dh == NULL)
646 DH_clear_flags(dh, DH_FLAG_CACHE_MONT_P);
647 key->keydata.dh = dh;
672 DH_set0_key(dh, pub_key, priv_key);
673 DH_set0_pqg(dh, p, NULL, g);