Lines Matching refs:pub_key
66 static int compute_key(unsigned char *key, const BIGNUM *pub_key, DH *dh);
87 int DH_compute_key(unsigned char *key, const BIGNUM *pub_key, DH *dh) in DH_compute_key() argument
97 return dh->meth->compute_key(key, pub_key, dh); in DH_compute_key()
124 BIGNUM *pub_key=NULL,*priv_key=NULL; in generate_key() local
138 if (dh->pub_key == NULL) in generate_key()
140 pub_key=BN_new(); in generate_key()
141 if (pub_key == NULL) goto err; in generate_key()
144 pub_key=dh->pub_key; in generate_key()
187 if (!dh->meth->bn_mod_exp(dh, pub_key, dh->g, prk, dh->p, ctx, mont)) goto err; in generate_key()
190 dh->pub_key=pub_key; in generate_key()
197 if ((pub_key != NULL) && (dh->pub_key == NULL)) BN_free(pub_key); in generate_key()
203 static int compute_key(unsigned char *key, const BIGNUM *pub_key, DH *dh) in compute_key() argument
241 if (!DH_check_pub_key(dh, pub_key, &check_result) || check_result) in compute_key()
247 if (!dh->meth->bn_mod_exp(dh, tmp, pub_key, dh->priv_key,dh->p,ctx,mont)) in compute_key()