Lines Matching refs:pub_key
40 int ossl_dh_compute_key(unsigned char *key, const BIGNUM *pub_key, DH *dh)
85 /* (Step 1) Z = pub_key^priv_key mod p */
86 if (!dh->meth->bn_mod_exp(dh, z, pub_key, dh->priv_key, dh->params.p, ctx,
114 int DH_compute_key(unsigned char *key, const BIGNUM *pub_key, DH *dh)
121 ret = ossl_dh_compute_key(key, pub_key, dh);
123 ret = dh->meth->compute_key(key, pub_key, dh);
144 int DH_compute_key_padded(unsigned char *key, const BIGNUM *pub_key, DH *dh)
150 rv = ossl_dh_compute_key(key, pub_key, dh);
152 rv = dh->meth->compute_key(key, pub_key, dh);
227 const BIGNUM *priv_key, BIGNUM *pub_key)
252 /* pub_key = g^priv_key mod p */
253 if (!dh->meth->bn_mod_exp(dh, pub_key, dh->params.g, prk, dh->params.p,
270 BIGNUM *pub_key = NULL, *priv_key = NULL;
301 if (dh->pub_key == NULL) {
302 pub_key = BN_new();
303 if (pub_key == NULL)
306 pub_key = dh->pub_key;
366 if (!ossl_dh_generate_public_key(ctx, dh, priv_key, pub_key))
369 dh->pub_key = pub_key;
377 if (pub_key != dh->pub_key)
378 BN_free(pub_key);