XilinxProcessorIPLib/drivers/hdcp22_rx_dp/src/xhdcp22_rx.c
int XHdcp22Rx_LoadPrivateKey(XHdcp22_Rx *InstancePtr, const u8 *PrivateKeyPtr)
{
	/* Verify arguments */
	Xil_AssertNonvoid(PrivateKeyPtr != NULL);

	int Status = XST_SUCCESS;
	XHdcp22_Rx_KprivRx *PrivateKey = (XHdcp22_Rx_KprivRx *)PrivateKeyPtr;

	/* Load the Private Key */
	InstancePtr->PrivateKeyPtr = PrivateKeyPtr;

	/* Calculate Montgomery Multiplier NPrimeP */
	Status = XHdcp22Rx_CalcMontNPrime(InstancePtr->NPrimeP, (u8 *)PrivateKey->p, XHDCP22_RX_P_SIZE/4);
    if(Status != XST_SUCCESS)
	{
	    xil_printf("ERROR: HDCP22-RX MMult NPrimeP Generation Failed\r\n");
		return Status;
	}

	/* Calculate Montgomery Multiplier NPrimeQ */
	Status = XHdcp22Rx_CalcMontNPrime(InstancePtr->NPrimeQ, (u8 *)PrivateKey->q, XHDCP22_RX_P_SIZE/4);
	if(Status != XST_SUCCESS)
	{
	    xil_printf("ERROR: HDCP22-RX MMult NPrimeQ Generation Failed\r\n");
	    return Status;
	}

	return Status;
}
/*****************************************************************************/
/**
* This function is used to load the private key.
*
* @param	InstancePtr is a pointer to the XHdcp22_Rx core instance.
* @param	PrivateKeyPtr is a pointer to an array.
*
* @return	- XST_SUCCESS if MMULT keys are calcualted correctly.
* 			- XST_FAILURE if MMULT keys are not calculated correctly.
*
* @note		None.
******************************************************************************/
This function is used to load the private key.
This function is used to load the private key .
int XHdcp22Rx_LoadPrivateKey(XHdcp22_Rx *InstancePtr, const u8 *PrivateKeyPtr)
{
	Xil_AssertNonvoid(PrivateKeyPtr != NULL);
	int Status = XST_SUCCESS;
	XHdcp22_Rx_KprivRx *PrivateKey = (XHdcp22_Rx_KprivRx *)PrivateKeyPtr;
	InstancePtr->PrivateKeyPtr = PrivateKeyPtr;
	Status = XHdcp22Rx_CalcMontNPrime(InstancePtr->NPrimeP, (u8 *)PrivateKey->p, XHDCP22_RX_P_SIZE/4);
    if(Status != XST_SUCCESS)
	{
	    xil_printf("ERROR: HDCP22-RX MMult NPrimeP Generation Failed\r\n");
		return Status;
	}
	Status = XHdcp22Rx_CalcMontNPrime(InstancePtr->NPrimeQ, (u8 *)PrivateKey->q, XHDCP22_RX_P_SIZE/4);
	if(Status != XST_SUCCESS)
	{
	    xil_printf("ERROR: HDCP22-RX MMult NPrimeQ Generation Failed\r\n");
	    return Status;
	}
	return Status;
}
int XHdcp22Rx_LoadPrivateKey ( XHdcp22_Rx * InstancePtr , const u8 * PrivateKeyPtr ) { Xil_AssertNonvoid ( PrivateKeyPtr != NULL ) ; int Status = XST_SUCCESS ; XHdcp22_Rx_KprivRx * PrivateKey = ( XHdcp22_Rx_KprivRx * ) PrivateKeyPtr ; InstancePtr -> PrivateKeyPtr = PrivateKeyPtr ; Status = XHdcp22Rx_CalcMontNPrime ( InstancePtr -> NPrimeP , ( u8 * ) PrivateKey -> p , XHDCP22_RX_P_SIZE / 4 ) ; if ( Status != XST_SUCCESS ) { xil_printf ( " \r \n " ) ; return Status ; } Status = XHdcp22Rx_CalcMontNPrime ( InstancePtr -> NPrimeQ , ( u8 * ) PrivateKey -> q , XHDCP22_RX_P_SIZE / 4 ) ; if ( Status != XST_SUCCESS ) { xil_printf ( " \r \n " ) ; return Status ; } return Status ; }
This function is used to load the private key.
This function is used to load the private key .
/* Verify arguments */ /* Load the Private Key */ /* Calculate Montgomery Multiplier NPrimeP */ /* Calculate Montgomery Multiplier NPrimeQ */