XilinxProcessorIPLib/drivers/hdcp1x/src/xhdcp1x_rx.c
static void XHdcp1x_RxStartComputations(XHdcp1x *InstancePtr,
		XHdcp1x_StateType *NextStatePtr)
{
	/* NextStatePtr not being used */
	UNUSED(NextStatePtr);

	u8 Buf[8];
	u64 Value = 0;
	u32 X = 0;
	u32 Y = 0;
	u32 Z = 0;

	/* Log */
	XHdcp1x_RxDebugLog(InstancePtr, "starting computations");

	/* Update statistics */
	InstancePtr->Rx.Stats.AuthAttempts++;

	/* Determine theAKsv */
	memset(Buf, 0, 8);
	XHdcp1x_PortRead(InstancePtr, XHDCP1X_PORT_OFFSET_AKSV, Buf,
			XHDCP1X_PORT_SIZE_AKSV);
	XHDCP1X_PORT_BUF_TO_UINT(Value, Buf, XHDCP1X_PORT_SIZE_AKSV * 8);

	/* Load the cipher with the remote ksv */
	XHdcp1x_CipherSetRemoteKsv(InstancePtr, Value);

	/* Update theU64Value with An */
	memset(Buf, 0, 8);
	XHdcp1x_PortRead(InstancePtr, XHDCP1X_PORT_OFFSET_AN, Buf,
			XHDCP1X_PORT_SIZE_AN);
	XHDCP1X_PORT_BUF_TO_UINT(Value, Buf, XHDCP1X_PORT_SIZE_AN * 8);

	/* Load the cipher B registers with An */
	X = (u32)(Value & 0x0FFFFFFFul);
	Value >>= 28;
	Y = (u32)(Value & 0x0FFFFFFFul);
	Value >>= 28;
	if (InstancePtr->IsRepeater) {
		Z = (u32)((Value | 0x00000100) & 0x000001FFul);
	}
	else {
		Z = (u32)(Value & 0x000000FFul);
	}
	XHdcp1x_CipherSetB(InstancePtr, X, Y, Z);

	/* Initiate the block cipher */
	XHdcp1x_CipherDoRequest(InstancePtr, XHDCP1X_CIPHER_REQUEST_BLOCK);
}
/*****************************************************************************/
/**
* This function initiates the computations for a receiver state machine.
*
* @param	InstancePtr is the receiver instance.
* @param	NextStatePtr is the next state.
*
* @return	None.
*
* @note		None.
*
******************************************************************************/
This function initiates the computations for a receiver state machine.
This function initiates the computations for a receiver state machine .
static void XHdcp1x_RxStartComputations(XHdcp1x *InstancePtr,
		XHdcp1x_StateType *NextStatePtr)
{
	UNUSED(NextStatePtr);
	u8 Buf[8];
	u64 Value = 0;
	u32 X = 0;
	u32 Y = 0;
	u32 Z = 0;
	XHdcp1x_RxDebugLog(InstancePtr, "starting computations");
	InstancePtr->Rx.Stats.AuthAttempts++;
	memset(Buf, 0, 8);
	XHdcp1x_PortRead(InstancePtr, XHDCP1X_PORT_OFFSET_AKSV, Buf,
			XHDCP1X_PORT_SIZE_AKSV);
	XHDCP1X_PORT_BUF_TO_UINT(Value, Buf, XHDCP1X_PORT_SIZE_AKSV * 8);
	XHdcp1x_CipherSetRemoteKsv(InstancePtr, Value);
	memset(Buf, 0, 8);
	XHdcp1x_PortRead(InstancePtr, XHDCP1X_PORT_OFFSET_AN, Buf,
			XHDCP1X_PORT_SIZE_AN);
	XHDCP1X_PORT_BUF_TO_UINT(Value, Buf, XHDCP1X_PORT_SIZE_AN * 8);
	X = (u32)(Value & 0x0FFFFFFFul);
	Value >>= 28;
	Y = (u32)(Value & 0x0FFFFFFFul);
	Value >>= 28;
	if (InstancePtr->IsRepeater) {
		Z = (u32)((Value | 0x00000100) & 0x000001FFul);
	}
	else {
		Z = (u32)(Value & 0x000000FFul);
	}
	XHdcp1x_CipherSetB(InstancePtr, X, Y, Z);
	XHdcp1x_CipherDoRequest(InstancePtr, XHDCP1X_CIPHER_REQUEST_BLOCK);
}
static void XHdcp1x_RxStartComputations ( XHdcp1x * InstancePtr , XHdcp1x_StateType * NextStatePtr ) { UNUSED ( NextStatePtr ) ; u8 Buf [ 8 ] ; u64 Value = 0 ; u32 X = 0 ; u32 Y = 0 ; u32 Z = 0 ; XHdcp1x_RxDebugLog ( InstancePtr , " " ) ; InstancePtr -> Rx . Stats . AuthAttempts ++ ; memset ( Buf , 0 , 8 ) ; XHdcp1x_PortRead ( InstancePtr , XHDCP1X_PORT_OFFSET_AKSV , Buf , XHDCP1X_PORT_SIZE_AKSV ) ; XHDCP1X_PORT_BUF_TO_UINT ( Value , Buf , XHDCP1X_PORT_SIZE_AKSV * 8 ) ; XHdcp1x_CipherSetRemoteKsv ( InstancePtr , Value ) ; memset ( Buf , 0 , 8 ) ; XHdcp1x_PortRead ( InstancePtr , XHDCP1X_PORT_OFFSET_AN , Buf , XHDCP1X_PORT_SIZE_AN ) ; XHDCP1X_PORT_BUF_TO_UINT ( Value , Buf , XHDCP1X_PORT_SIZE_AN * 8 ) ; X = ( u32 ) ( Value & 0x0FFFFFFFul ) ; Value >>= 28 ; Y = ( u32 ) ( Value & 0x0FFFFFFFul ) ; Value >>= 28 ; if ( InstancePtr -> IsRepeater ) { Z = ( u32 ) ( ( Value | 0x00000100 ) & 0x000001FFul ) ; } else { Z = ( u32 ) ( Value & 0x000000FFul ) ; } XHdcp1x_CipherSetB ( InstancePtr , X , Y , Z ) ; XHdcp1x_CipherDoRequest ( InstancePtr , XHDCP1X_CIPHER_REQUEST_BLOCK ) ; }
This function initiates the computations for a receiver state machine.
This function initiates the computations for a receiver state machine .
/* NextStatePtr not being used */ /* Log */ /* Update statistics */ /* Determine theAKsv */ /* Load the cipher with the remote ksv */ /* Update theU64Value with An */ /* Load the cipher B registers with An */ /* Initiate the block cipher */