DHerr(DH_F_DH_COMPUTE_KEY,ERR_R_BN_LIB);
DHerr(DH_F_COMPUTE_KEY,ERR_R_BN_LIB);
static int compute_key(unsigned char *key, const BIGNUM *pub_key, DH *dh)	{	BN_CTX *ctx;	BN_MONT_CTX *mont;	BIGNUM *tmp;	int ret= -1;	ctx = BN_CTX_new();	if (ctx == NULL) goto err;	BN_CTX_start(ctx);	tmp = BN_CTX_get(ctx);		if (dh->priv_key == NULL)		{		DHerr(DH_F_DH_COMPUTE_KEY,DH_R_NO_PRIVATE_VALUE);		goto err;		}	if ((dh->method_mont_p == NULL) && (dh->flags & DH_FLAG_CACHE_MONT_P))		{		if ((dh->method_mont_p=(char *)BN_MONT_CTX_new()) != NULL)			if (!BN_MONT_CTX_set((BN_MONT_CTX *)dh->method_mont_p,				dh->p,ctx)) goto err;		}	mont=(BN_MONT_CTX *)dh->method_mont_p;	if (!dh->meth->bn_mod_exp(dh, tmp, pub_key, dh->priv_key,dh->p,ctx,mont))		{		DHerr(DH_F_DH_COMPUTE_KEY,ERR_R_BN_LIB);		goto err;		}	ret=BN_bn2bin(tmp,key);err:	BN_CTX_end(ctx);	BN_CTX_free(ctx);	return(ret);	}