AEPHKerr(AEPHK_F_AEP_RAND,AEPHK_R_RETURN_CONNECTION_FAILED);
AEPHKerr(AEPHK_F_AEP_MOD_EXP_CRT,AEPHK_R_RETURN_CONNECTION_FAILED);
static AEP_RV aep_mod_exp_crt(BIGNUM *r, const BIGNUM *a, const BIGNUM *p,	const BIGNUM *q, const BIGNUM *dmp1,	const BIGNUM *dmq1,const BIGNUM *iqmp, BN_CTX *ctx)	{	AEP_RV rv = AEP_R_OK;	AEP_CONNECTION_HNDL hConnection;	/*Grab a connection from the pool*/	rv = aep_get_connection(&hConnection);	if (rv != AEP_R_OK)		{		AEPHKerr(AEPHK_F_AEP_MOD_EXP_CRT,AEPHK_R_GET_HANDLE_FAILED);		return FAIL_TO_SW;		}	/*To the card with the mod exp*/	rv = p_AEP_ModExpCrt(hConnection,(void*)a, (void*)p, (void*)q, (void*)dmp1,(void*)dmq1,		(void*)iqmp,(void*)r,NULL);	if (rv != AEP_R_OK)		{		AEPHKerr(AEPHK_F_AEP_MOD_EXP_CRT,AEPHK_R_MOD_EXP_CRT_FAILED);		rv = aep_close_connection(hConnection);		return FAIL_TO_SW;		}	/*Return the connection to the pool*/	rv = aep_return_connection(hConnection);	if (rv != AEP_R_OK)		{		AEPHKerr(AEPHK_F_AEP_RAND,AEPHK_R_RETURN_CONNECTION_FAILED); 		goto err;		}  err:	return rv;	}