XilinxProcessorIPLib/drivers/hdcp22_rx/src/xhdcp22_rx.c
static int XHdcp22Rx_ProcessMessageAKEStoredKm(XHdcp22_Rx *InstancePtr)
{
	/* Verify arguments */
	Xil_AssertNonvoid(InstancePtr != NULL);

	int Status = XST_SUCCESS;
	XHdcp22_Rx_Message *MsgPtr = (XHdcp22_Rx_Message*)InstancePtr->MessageBuffer;

	/* Log message read completion */
	XHdcp22Rx_LogWr(InstancePtr, XHDCP22_RX_LOG_EVT_INFO_MESSAGE, XHDCP22_RX_MSG_ID_AKESTOREDKM);

	/* Check message size */
	if(InstancePtr->MessageSize != sizeof(XHdcp22_Rx_AKEStoredKm))
	{
		XHdcp22Rx_LogWr(InstancePtr, XHDCP22_RX_LOG_EVT_ERROR, XHDCP22_RX_ERROR_FLAG_MESSAGE_SIZE);
		return XST_FAILURE;
	}

	/* Compute Km */
	XHdcp22Rx_LogWr(InstancePtr, XHDCP22_RX_LOG_EVT_DEBUG, XHDCP22_RX_LOG_DEBUG_COMPUTE_KM);
	XHdcp22Rx_ComputeEkh(InstancePtr->PrivateKeyPtr, MsgPtr->AKEStoredKm.EKhKm, MsgPtr->AKEStoredKm.M,
		InstancePtr->Params.Km);
	XHdcp22Rx_LogWr(InstancePtr, XHDCP22_RX_LOG_EVT_DEBUG, XHDCP22_RX_LOG_DEBUG_COMPUTE_KM_DONE);

	return Status;
}
/*****************************************************************************/
/**
* This function processes the AKE_Stored_km message received from the
* transmitter. Decrypts Ekh(Km) using AES with the received m as
* input and Kh as key into the AES module.
*
* @param    InstancePtr is a pointer to the XHdcp22_Rx core instance.
*
* @return   - XST_SUCCESS if message processed successfully.
*           - XST_FAILURE if message size is incorrect.
*
* @note     None.
******************************************************************************/
This function processes the AKE_Stored_km message received from the
transmitter. Decrypts Ekh(Km) using AES with the received m as
input and Kh as key into the AES module.
This function processes the AKE_Stored_km message received from the transmitter . Decrypts Ekh ( Km ) using AES with the received m as input and Kh as key into the AES module .
static int XHdcp22Rx_ProcessMessageAKEStoredKm(XHdcp22_Rx *InstancePtr)
{
	Xil_AssertNonvoid(InstancePtr != NULL);
	int Status = XST_SUCCESS;
	XHdcp22_Rx_Message *MsgPtr = (XHdcp22_Rx_Message*)InstancePtr->MessageBuffer;
	XHdcp22Rx_LogWr(InstancePtr, XHDCP22_RX_LOG_EVT_INFO_MESSAGE, XHDCP22_RX_MSG_ID_AKESTOREDKM);
	if(InstancePtr->MessageSize != sizeof(XHdcp22_Rx_AKEStoredKm))
	{
		XHdcp22Rx_LogWr(InstancePtr, XHDCP22_RX_LOG_EVT_ERROR, XHDCP22_RX_ERROR_FLAG_MESSAGE_SIZE);
		return XST_FAILURE;
	}
	XHdcp22Rx_LogWr(InstancePtr, XHDCP22_RX_LOG_EVT_DEBUG, XHDCP22_RX_LOG_DEBUG_COMPUTE_KM);
	XHdcp22Rx_ComputeEkh(InstancePtr->PrivateKeyPtr, MsgPtr->AKEStoredKm.EKhKm, MsgPtr->AKEStoredKm.M,
		InstancePtr->Params.Km);
	XHdcp22Rx_LogWr(InstancePtr, XHDCP22_RX_LOG_EVT_DEBUG, XHDCP22_RX_LOG_DEBUG_COMPUTE_KM_DONE);
	return Status;
}
static int XHdcp22Rx_ProcessMessageAKEStoredKm ( XHdcp22_Rx * InstancePtr ) { Xil_AssertNonvoid ( InstancePtr != NULL ) ; int Status = XST_SUCCESS ; XHdcp22_Rx_Message * MsgPtr = ( XHdcp22_Rx_Message * ) InstancePtr -> MessageBuffer ; XHdcp22Rx_LogWr ( InstancePtr , XHDCP22_RX_LOG_EVT_INFO_MESSAGE , XHDCP22_RX_MSG_ID_AKESTOREDKM ) ; if ( InstancePtr -> MessageSize != sizeof ( XHdcp22_Rx_AKEStoredKm ) ) { XHdcp22Rx_LogWr ( InstancePtr , XHDCP22_RX_LOG_EVT_ERROR , XHDCP22_RX_ERROR_FLAG_MESSAGE_SIZE ) ; return XST_FAILURE ; } XHdcp22Rx_LogWr ( InstancePtr , XHDCP22_RX_LOG_EVT_DEBUG , XHDCP22_RX_LOG_DEBUG_COMPUTE_KM ) ; XHdcp22Rx_ComputeEkh ( InstancePtr -> PrivateKeyPtr , MsgPtr -> AKEStoredKm . EKhKm , MsgPtr -> AKEStoredKm . M , InstancePtr -> Params . Km ) ; XHdcp22Rx_LogWr ( InstancePtr , XHDCP22_RX_LOG_EVT_DEBUG , XHDCP22_RX_LOG_DEBUG_COMPUTE_KM_DONE ) ; return Status ; }
This function processes the AKE_Stored_km message received from the
transmitter.
This function processes the AKE_Stored_km message received from the transmitter .
/* Verify arguments */ /* Log message read completion */ /* Check message size */ /* Compute Km */