XilinxProcessorIPLib/drivers/hdcp22_tx_dp/src/xhdcp22_tx.c
XHdcp22_Tx_StateType Xhdcp22Tx_StateA1_1(XHdcp22_Tx *InstancePtr)
{
	int Result = XST_SUCCESS;
	XHdcp22_Tx_DDCMessage *MsgPtr = (XHdcp22_Tx_DDCMessage *)InstancePtr->MessageBuffer;
	XHdcp22_Tx_PairingInfo *PairingInfoPtr = NULL;
	const u8* KPubDpcPtr = NULL;
	XHdcp22_Tx_PairingInfo NewPairingInfo;

	/* receive AKE Send message, wait for 100 ms */
	Result = XHdcp22Tx_WaitForReceiver(InstancePtr, sizeof(XHdcp22_Tx_AKESendCert), FALSE);
	if (Result != XST_SUCCESS) {
		return XHDCP22_TX_STATE_A0;
	}
	if (InstancePtr->Info.MsgAvailable == (FALSE)) {
		return XHDCP22_TX_STATE_A1_1;
	}

	/* Log after waiting */
	XHdcp22Tx_LogWr(InstancePtr, XHDCP22_TX_LOG_EVT_STATE, (u16)XHDCP22_TX_STATE_A1_1);

	/* Receive the RX certificate */
	XHdcp22Tx_LogWr(InstancePtr, XHDCP22_TX_LOG_EVT_DBG, XHDCP22_TX_LOG_DBG_RX_CERT);
	Result = XHdcp22Tx_ReceiveMsg(InstancePtr, XHDCP22_TX_AKE_SEND_CERT,
									sizeof(XHdcp22_Tx_AKESendCert));
	if (Result != XST_SUCCESS) {
		return XHDCP22_TX_STATE_A0;
	}

	xdbg_printf(XDBG_DEBUG_GENERAL,
			"HDCP22TX: Reading Done for AKE_SEND_CERT\n\r");
	/* Verify the signature */
	KPubDpcPtr = XHdcp22Tx_GetKPubDpc(InstancePtr);
	XHdcp22Tx_LogWr(InstancePtr, XHDCP22_TX_LOG_EVT_DBG,
	                XHDCP22_TX_LOG_DBG_VERIFY_SIGNATURE);
	Result = XHdcp22Tx_VerifyCertificate(&MsgPtr->Message.AKESendCert.CertRx,
	                   KPubDpcPtr, /* N */
	                   XHDCP22_TX_KPUB_DCP_LLC_N_SIZE,
	                   &KPubDpcPtr[XHDCP22_TX_KPUB_DCP_LLC_N_SIZE], /* e */
	                   XHDCP22_TX_KPUB_DCP_LLC_E_SIZE);

	if (Result != XST_SUCCESS) {
		XHdcp22Tx_LogWr(InstancePtr, XHDCP22_TX_LOG_EVT_DBG,
	                XHDCP22_TX_LOG_DBG_VERIFY_SIGNATURE_FAIL);
		return XHDCP22_TX_STATE_A0;
	}
	else {
		XHdcp22Tx_LogWr(InstancePtr, XHDCP22_TX_LOG_EVT_DBG,
	                XHDCP22_TX_LOG_DBG_VERIFY_SIGNATURE_PASS);
	}

	/* SRM and revocation check are only performed by the top-level HDCP transmitter */
	if (InstancePtr->Config.Mode == XHDCP22_TX_TRANSMITTER) {
		/* Check to see wether there is a valid SRM loaded */
		if (InstancePtr->Info.IsRevocationListValid == FALSE) {
			/* No valid revocation list loaded. According to
			 * the HDCP spec, authentication has to be aborted */
			InstancePtr->Info.AuthenticationStatus = XHDCP22_TX_NO_SRM_LOADED;
			return XHDCP22_TX_STATE_A0;
		}

		/* Check to see wether the Receiver ID is in the revocation list */
		if (XHdcp22Tx_IsDeviceRevoked(InstancePtr, MsgPtr->Message.AKESendCert.CertRx.ReceiverId)) {
			XHdcp22Tx_LogWr(InstancePtr, XHDCP22_TX_LOG_EVT_DBG,
				XHDCP22_TX_LOG_DBG_DEVICE_IS_REVOKED);
			InstancePtr->Info.IsDeviceRevoked = TRUE;
			InstancePtr->Info.AuthenticationStatus = XHDCP22_TX_DEVICE_IS_REVOKED;
			return XHDCP22_TX_STATE_A0;
		}
		else {
			InstancePtr->Info.IsDeviceRevoked = FALSE;
		}
	}

	/* Add receiver ID to the topology info */
	memcpy(&InstancePtr->Topology.ReceiverId[0],
		MsgPtr->Message.AKESendCert.CertRx.ReceiverId,
		XHDCP22_TX_RCVID_SIZE);
	InstancePtr->Topology.DeviceCnt = 1;

	/* Check to see wether the Receiver is an HDCP Repeater */
	if (MsgPtr->Message.AKESendCert.RxCaps[2] & 0x1) { /* big endian! */
		InstancePtr->Info.IsReceiverRepeater = TRUE;
	}
	else {
		InstancePtr->Info.IsReceiverRepeater = FALSE;
	}

	/* Store received Rrx for calculations in other states */
	memcpy(InstancePtr->Info.Rrx,  MsgPtr->Message.AKESendCert.Rrx,
			 sizeof(InstancePtr->Info.Rrx));

	/* Get pairing info pointer for the connected receiver */
	PairingInfoPtr = XHdcp22Tx_GetPairingInfo(InstancePtr, MsgPtr->Message.AKESendCert.CertRx.ReceiverId);

	/********************* Handle Stored Km **********************************/
	/* If already existing handle Stored Km sequence: Write AKE_Stored_Km
	 * and wait for H Prime */
	if (PairingInfoPtr != NULL) {
		if (PairingInfoPtr->Ready == TRUE) {
			/* Update RxCaps in pairing info */
			memcpy(PairingInfoPtr->RxCaps, MsgPtr->Message.AKESendCert.RxCaps,
				sizeof(PairingInfoPtr->RxCaps));

			/* Write encrypted Km */
			Result = XHdcp22Tx_WriteAKEStoredKm(InstancePtr, PairingInfoPtr);

			if (Result != XST_SUCCESS) {
				XHdcp22Tx_LogWr(InstancePtr, XHDCP22_TX_LOG_EVT_DBG,
					XHDCP22_TX_LOG_DBG_MSG_WRITE_FAIL);
				return XHDCP22_TX_STATE_A0;
			}

			InstancePtr->Info.StateContext = PairingInfoPtr;

			/* Start the timer for receiving XHDCP22_TX_AKE_SEND_HPRIME */
			XHdcp22Tx_StartTimer(InstancePtr, 200, XHDCP22_TX_AKE_SEND_H_PRIME);
			return XHDCP22_TX_STATE_A1_SK0;
		}
	}

	/********************* Handle No Stored Km *******************************/
	/* Update pairing info */
	memcpy(NewPairingInfo.Rrx, InstancePtr->Info.Rrx,
	       sizeof(NewPairingInfo.Rrx));
	memcpy(NewPairingInfo.Rtx, InstancePtr->Info.Rtx,
	       sizeof(NewPairingInfo.Rtx));
	memcpy(NewPairingInfo.RxCaps, MsgPtr->Message.AKESendCert.RxCaps,
	       sizeof(NewPairingInfo.RxCaps));
	memcpy(NewPairingInfo.ReceiverId, MsgPtr->Message.AKESendCert.CertRx.ReceiverId,
	       sizeof(NewPairingInfo.ReceiverId));

	/* Generate the hashed Km */
	XHdcp22Tx_GenerateKm(InstancePtr, NewPairingInfo.Km);

	/* Done with first step, update pairing info and goto the next
	 * step in the No Stored Km sequence: waiting for H Prime*/
	PairingInfoPtr = XHdcp22Tx_UpdatePairingInfo(InstancePtr, &NewPairingInfo, FALSE);
	if (PairingInfoPtr == NULL) {
		return XHDCP22_TX_STATE_A0;
	}

	InstancePtr->Info.StateContext = (void *)PairingInfoPtr;

	/* Write encrypted Km  */
	Result = XHdcp22Tx_WriteAKENoStoredKm(InstancePtr, &NewPairingInfo,
	                             &MsgPtr->Message.AKESendCert.CertRx);

	if (Result != XST_SUCCESS) {
		XHdcp22Tx_LogWr(InstancePtr, XHDCP22_TX_LOG_EVT_DBG, XHDCP22_TX_LOG_DBG_MSG_WRITE_FAIL);
		return XHDCP22_TX_STATE_A0;
	}

	/* Start the timer for receiving XHDCP22_TX_AKE_SEND_HPRIME */
	XHdcp22Tx_StartTimer(InstancePtr, 1000, XHDCP22_TX_AKE_SEND_H_PRIME);

	return XHDCP22_TX_STATE_A1_NSK0;
}
/******************************************************************************/
/**
*
* This function executes a part of the A1 state functionality of the HDCP2.2
* TX protocol.
* It receives the certificate and decides if it should continue to a
* 'no stored km' or 'stored Km'intermediate state.
*
* @param  InstancePtr is a pointer to the XHdcp22Tx core instance.
*
* @return
*         - XHDCP22_TX_STATE_A0 on errors.
*         - XHDCP22_TX_STATE_A1_1 if busy waiting for the
*           XHDCP22_TX_AKE_SEND_CERT message.
*         - XHDCP22_TX_STATE_A1_SK0 for a 'Stored Km' scenario.
*         - XHDCP22_TX_STATE_A1_NSK0 for a 'Non Stored Km' scenario.
*
* @note   None.
*
******************************************************************************/
This function executes a part of the A1 state functionality of the HDCP2.2
TX protocol.
It receives the certificate and decides if it should continue to a
'no stored km' or 'stored Km'intermediate state.
This function executes a part of the A1 state functionality of the HDCP2 . 2 TX protocol . It receives the certificate and decides if it should continue to a ' no stored km ' or ' stored Km ' intermediate state .
XHdcp22_Tx_StateType Xhdcp22Tx_StateA1_1(XHdcp22_Tx *InstancePtr)
{
	int Result = XST_SUCCESS;
	XHdcp22_Tx_DDCMessage *MsgPtr = (XHdcp22_Tx_DDCMessage *)InstancePtr->MessageBuffer;
	XHdcp22_Tx_PairingInfo *PairingInfoPtr = NULL;
	const u8* KPubDpcPtr = NULL;
	XHdcp22_Tx_PairingInfo NewPairingInfo;
	Result = XHdcp22Tx_WaitForReceiver(InstancePtr, sizeof(XHdcp22_Tx_AKESendCert), FALSE);
	if (Result != XST_SUCCESS) {
		return XHDCP22_TX_STATE_A0;
	}
	if (InstancePtr->Info.MsgAvailable == (FALSE)) {
		return XHDCP22_TX_STATE_A1_1;
	}
	XHdcp22Tx_LogWr(InstancePtr, XHDCP22_TX_LOG_EVT_STATE, (u16)XHDCP22_TX_STATE_A1_1);
	XHdcp22Tx_LogWr(InstancePtr, XHDCP22_TX_LOG_EVT_DBG, XHDCP22_TX_LOG_DBG_RX_CERT);
	Result = XHdcp22Tx_ReceiveMsg(InstancePtr, XHDCP22_TX_AKE_SEND_CERT,
									sizeof(XHdcp22_Tx_AKESendCert));
	if (Result != XST_SUCCESS) {
		return XHDCP22_TX_STATE_A0;
	}
	xdbg_printf(XDBG_DEBUG_GENERAL,
			"HDCP22TX: Reading Done for AKE_SEND_CERT\n\r");
	KPubDpcPtr = XHdcp22Tx_GetKPubDpc(InstancePtr);
	XHdcp22Tx_LogWr(InstancePtr, XHDCP22_TX_LOG_EVT_DBG,
	                XHDCP22_TX_LOG_DBG_VERIFY_SIGNATURE);
	Result = XHdcp22Tx_VerifyCertificate(&MsgPtr->Message.AKESendCert.CertRx,
	                   KPubDpcPtr, 
	                   XHDCP22_TX_KPUB_DCP_LLC_N_SIZE,
	                   &KPubDpcPtr[XHDCP22_TX_KPUB_DCP_LLC_N_SIZE], 
	                   XHDCP22_TX_KPUB_DCP_LLC_E_SIZE);
	if (Result != XST_SUCCESS) {
		XHdcp22Tx_LogWr(InstancePtr, XHDCP22_TX_LOG_EVT_DBG,
	                XHDCP22_TX_LOG_DBG_VERIFY_SIGNATURE_FAIL);
		return XHDCP22_TX_STATE_A0;
	}
	else {
		XHdcp22Tx_LogWr(InstancePtr, XHDCP22_TX_LOG_EVT_DBG,
	                XHDCP22_TX_LOG_DBG_VERIFY_SIGNATURE_PASS);
	}
	if (InstancePtr->Config.Mode == XHDCP22_TX_TRANSMITTER) {
		if (InstancePtr->Info.IsRevocationListValid == FALSE) {
			InstancePtr->Info.AuthenticationStatus = XHDCP22_TX_NO_SRM_LOADED;
			return XHDCP22_TX_STATE_A0;
		}
		if (XHdcp22Tx_IsDeviceRevoked(InstancePtr, MsgPtr->Message.AKESendCert.CertRx.ReceiverId)) {
			XHdcp22Tx_LogWr(InstancePtr, XHDCP22_TX_LOG_EVT_DBG,
				XHDCP22_TX_LOG_DBG_DEVICE_IS_REVOKED);
			InstancePtr->Info.IsDeviceRevoked = TRUE;
			InstancePtr->Info.AuthenticationStatus = XHDCP22_TX_DEVICE_IS_REVOKED;
			return XHDCP22_TX_STATE_A0;
		}
		else {
			InstancePtr->Info.IsDeviceRevoked = FALSE;
		}
	}
	memcpy(&InstancePtr->Topology.ReceiverId[0],
		MsgPtr->Message.AKESendCert.CertRx.ReceiverId,
		XHDCP22_TX_RCVID_SIZE);
	InstancePtr->Topology.DeviceCnt = 1;
	if (MsgPtr->Message.AKESendCert.RxCaps[2] & 0x1) { 
		InstancePtr->Info.IsReceiverRepeater = TRUE;
	}
	else {
		InstancePtr->Info.IsReceiverRepeater = FALSE;
	}
	memcpy(InstancePtr->Info.Rrx,  MsgPtr->Message.AKESendCert.Rrx,
			 sizeof(InstancePtr->Info.Rrx));
	PairingInfoPtr = XHdcp22Tx_GetPairingInfo(InstancePtr, MsgPtr->Message.AKESendCert.CertRx.ReceiverId);
	if (PairingInfoPtr != NULL) {
		if (PairingInfoPtr->Ready == TRUE) {
			memcpy(PairingInfoPtr->RxCaps, MsgPtr->Message.AKESendCert.RxCaps,
				sizeof(PairingInfoPtr->RxCaps));
			Result = XHdcp22Tx_WriteAKEStoredKm(InstancePtr, PairingInfoPtr);
			if (Result != XST_SUCCESS) {
				XHdcp22Tx_LogWr(InstancePtr, XHDCP22_TX_LOG_EVT_DBG,
					XHDCP22_TX_LOG_DBG_MSG_WRITE_FAIL);
				return XHDCP22_TX_STATE_A0;
			}
			InstancePtr->Info.StateContext = PairingInfoPtr;
			XHdcp22Tx_StartTimer(InstancePtr, 200, XHDCP22_TX_AKE_SEND_H_PRIME);
			return XHDCP22_TX_STATE_A1_SK0;
		}
	}
	memcpy(NewPairingInfo.Rrx, InstancePtr->Info.Rrx,
	       sizeof(NewPairingInfo.Rrx));
	memcpy(NewPairingInfo.Rtx, InstancePtr->Info.Rtx,
	       sizeof(NewPairingInfo.Rtx));
	memcpy(NewPairingInfo.RxCaps, MsgPtr->Message.AKESendCert.RxCaps,
	       sizeof(NewPairingInfo.RxCaps));
	memcpy(NewPairingInfo.ReceiverId, MsgPtr->Message.AKESendCert.CertRx.ReceiverId,
	       sizeof(NewPairingInfo.ReceiverId));
	XHdcp22Tx_GenerateKm(InstancePtr, NewPairingInfo.Km);
	PairingInfoPtr = XHdcp22Tx_UpdatePairingInfo(InstancePtr, &NewPairingInfo, FALSE);
	if (PairingInfoPtr == NULL) {
		return XHDCP22_TX_STATE_A0;
	}
	InstancePtr->Info.StateContext = (void *)PairingInfoPtr;
	Result = XHdcp22Tx_WriteAKENoStoredKm(InstancePtr, &NewPairingInfo,
	                             &MsgPtr->Message.AKESendCert.CertRx);
	if (Result != XST_SUCCESS) {
		XHdcp22Tx_LogWr(InstancePtr, XHDCP22_TX_LOG_EVT_DBG, XHDCP22_TX_LOG_DBG_MSG_WRITE_FAIL);
		return XHDCP22_TX_STATE_A0;
	}
	XHdcp22Tx_StartTimer(InstancePtr, 1000, XHDCP22_TX_AKE_SEND_H_PRIME);
	return XHDCP22_TX_STATE_A1_NSK0;
}
XHdcp22_Tx_StateType Xhdcp22Tx_StateA1_1 ( XHdcp22_Tx * InstancePtr ) { int Result = XST_SUCCESS ; XHdcp22_Tx_DDCMessage * MsgPtr = ( XHdcp22_Tx_DDCMessage * ) InstancePtr -> MessageBuffer ; XHdcp22_Tx_PairingInfo * PairingInfoPtr = NULL ; const u8 * KPubDpcPtr = NULL ; XHdcp22_Tx_PairingInfo NewPairingInfo ; Result = XHdcp22Tx_WaitForReceiver ( InstancePtr , sizeof ( XHdcp22_Tx_AKESendCert ) , FALSE ) ; if ( Result != XST_SUCCESS ) { return XHDCP22_TX_STATE_A0 ; } if ( InstancePtr -> Info . MsgAvailable == ( FALSE ) ) { return XHDCP22_TX_STATE_A1_1 ; } XHdcp22Tx_LogWr ( InstancePtr , XHDCP22_TX_LOG_EVT_STATE , ( u16 ) XHDCP22_TX_STATE_A1_1 ) ; XHdcp22Tx_LogWr ( InstancePtr , XHDCP22_TX_LOG_EVT_DBG , XHDCP22_TX_LOG_DBG_RX_CERT ) ; Result = XHdcp22Tx_ReceiveMsg ( InstancePtr , XHDCP22_TX_AKE_SEND_CERT , sizeof ( XHdcp22_Tx_AKESendCert ) ) ; if ( Result != XST_SUCCESS ) { return XHDCP22_TX_STATE_A0 ; } xdbg_printf ( XDBG_DEBUG_GENERAL , " \n \r " ) ; KPubDpcPtr = XHdcp22Tx_GetKPubDpc ( InstancePtr ) ; XHdcp22Tx_LogWr ( InstancePtr , XHDCP22_TX_LOG_EVT_DBG , XHDCP22_TX_LOG_DBG_VERIFY_SIGNATURE ) ; Result = XHdcp22Tx_VerifyCertificate ( & MsgPtr -> Message . AKESendCert . CertRx , KPubDpcPtr , XHDCP22_TX_KPUB_DCP_LLC_N_SIZE , & KPubDpcPtr [ XHDCP22_TX_KPUB_DCP_LLC_N_SIZE ] , XHDCP22_TX_KPUB_DCP_LLC_E_SIZE ) ; if ( Result != XST_SUCCESS ) { XHdcp22Tx_LogWr ( InstancePtr , XHDCP22_TX_LOG_EVT_DBG , XHDCP22_TX_LOG_DBG_VERIFY_SIGNATURE_FAIL ) ; return XHDCP22_TX_STATE_A0 ; } else { XHdcp22Tx_LogWr ( InstancePtr , XHDCP22_TX_LOG_EVT_DBG , XHDCP22_TX_LOG_DBG_VERIFY_SIGNATURE_PASS ) ; } if ( InstancePtr -> Config . Mode == XHDCP22_TX_TRANSMITTER ) { if ( InstancePtr -> Info . IsRevocationListValid == FALSE ) { InstancePtr -> Info . AuthenticationStatus = XHDCP22_TX_NO_SRM_LOADED ; return XHDCP22_TX_STATE_A0 ; } if ( XHdcp22Tx_IsDeviceRevoked ( InstancePtr , MsgPtr -> Message . AKESendCert . CertRx . ReceiverId ) ) { XHdcp22Tx_LogWr ( InstancePtr , XHDCP22_TX_LOG_EVT_DBG , XHDCP22_TX_LOG_DBG_DEVICE_IS_REVOKED ) ; InstancePtr -> Info . IsDeviceRevoked = TRUE ; InstancePtr -> Info . AuthenticationStatus = XHDCP22_TX_DEVICE_IS_REVOKED ; return XHDCP22_TX_STATE_A0 ; } else { InstancePtr -> Info . IsDeviceRevoked = FALSE ; } } memcpy ( & InstancePtr -> Topology . ReceiverId [ 0 ] , MsgPtr -> Message . AKESendCert . CertRx . ReceiverId , XHDCP22_TX_RCVID_SIZE ) ; InstancePtr -> Topology . DeviceCnt = 1 ; if ( MsgPtr -> Message . AKESendCert . RxCaps [ 2 ] & 0x1 ) { InstancePtr -> Info . IsReceiverRepeater = TRUE ; } else { InstancePtr -> Info . IsReceiverRepeater = FALSE ; } memcpy ( InstancePtr -> Info . Rrx , MsgPtr -> Message . AKESendCert . Rrx , sizeof ( InstancePtr -> Info . Rrx ) ) ; PairingInfoPtr = XHdcp22Tx_GetPairingInfo ( InstancePtr , MsgPtr -> Message . AKESendCert . CertRx . ReceiverId ) ; if ( PairingInfoPtr != NULL ) { if ( PairingInfoPtr -> Ready == TRUE ) { memcpy ( PairingInfoPtr -> RxCaps , MsgPtr -> Message . AKESendCert . RxCaps , sizeof ( PairingInfoPtr -> RxCaps ) ) ; Result = XHdcp22Tx_WriteAKEStoredKm ( InstancePtr , PairingInfoPtr ) ; if ( Result != XST_SUCCESS ) { XHdcp22Tx_LogWr ( InstancePtr , XHDCP22_TX_LOG_EVT_DBG , XHDCP22_TX_LOG_DBG_MSG_WRITE_FAIL ) ; return XHDCP22_TX_STATE_A0 ; } InstancePtr -> Info . StateContext = PairingInfoPtr ; XHdcp22Tx_StartTimer ( InstancePtr , 200 , XHDCP22_TX_AKE_SEND_H_PRIME ) ; return XHDCP22_TX_STATE_A1_SK0 ; } } memcpy ( NewPairingInfo . Rrx , InstancePtr -> Info . Rrx , sizeof ( NewPairingInfo . Rrx ) ) ; memcpy ( NewPairingInfo . Rtx , InstancePtr -> Info . Rtx , sizeof ( NewPairingInfo . Rtx ) ) ; memcpy ( NewPairingInfo . RxCaps , MsgPtr -> Message . AKESendCert . RxCaps , sizeof ( NewPairingInfo . RxCaps ) ) ; memcpy ( NewPairingInfo . ReceiverId , MsgPtr -> Message . AKESendCert . CertRx . ReceiverId , sizeof ( NewPairingInfo . ReceiverId ) ) ; XHdcp22Tx_GenerateKm ( InstancePtr , NewPairingInfo . Km ) ; PairingInfoPtr = XHdcp22Tx_UpdatePairingInfo ( InstancePtr , & NewPairingInfo , FALSE ) ; if ( PairingInfoPtr == NULL ) { return XHDCP22_TX_STATE_A0 ; } InstancePtr -> Info . StateContext = ( void * ) PairingInfoPtr ; Result = XHdcp22Tx_WriteAKENoStoredKm ( InstancePtr , & NewPairingInfo , & MsgPtr -> Message . AKESendCert . CertRx ) ; if ( Result != XST_SUCCESS ) { XHdcp22Tx_LogWr ( InstancePtr , XHDCP22_TX_LOG_EVT_DBG , XHDCP22_TX_LOG_DBG_MSG_WRITE_FAIL ) ; return XHDCP22_TX_STATE_A0 ; } XHdcp22Tx_StartTimer ( InstancePtr , 1000 , XHDCP22_TX_AKE_SEND_H_PRIME ) ; return XHDCP22_TX_STATE_A1_NSK0 ; }
This function executes a part of the A1 state functionality of the HDCP2.2
TX protocol.
This function executes a part of the A1 state functionality of the HDCP2 . 2 TX protocol .
/* receive AKE Send message, wait for 100 ms */ /* Log after waiting */ /* Receive the RX certificate */ /* Verify the signature */ /* N */ /* e */ /* SRM and revocation check are only performed by the top-level HDCP transmitter */ /* Check to see wether there is a valid SRM loaded */ /* No valid revocation list loaded. According to
			 * the HDCP spec, authentication has to be aborted */ /* Check to see wether the Receiver ID is in the revocation list */ /* Add receiver ID to the topology info */ /* Check to see wether the Receiver is an HDCP Repeater */ /* big endian! */ /* Store received Rrx for calculations in other states */ /* Get pairing info pointer for the connected receiver */ /********************* Handle Stored Km **********************************/ /* If already existing handle Stored Km sequence: Write AKE_Stored_Km
	 * and wait for H Prime */ /* Update RxCaps in pairing info */ /* Write encrypted Km */ /* Start the timer for receiving XHDCP22_TX_AKE_SEND_HPRIME */ /********************* Handle No Stored Km *******************************/ /* Update pairing info */ /* Generate the hashed Km */ /* Done with first step, update pairing info and goto the next
	 * step in the No Stored Km sequence: waiting for H Prime*/ /* Write encrypted Km  */ /* Start the timer for receiving XHDCP22_TX_AKE_SEND_HPRIME */