XilinxProcessorIPLib/drivers/hdcp22_rx/src/xhdcp22_rx_crypt.c
void XHdcp22Rx_ComputeEkh(const u8 *KprivRx, const u8 *Km, const u8 *M, u8 *Ekh)
{
	u8 Kh[XHDCP22_RX_HASH_SIZE];

	/* Verify arguments */
	Xil_AssertVoid(KprivRx != NULL);
	Xil_AssertVoid(Km != NULL);
	Xil_AssertVoid(M != NULL);
	Xil_AssertVoid(Ekh != NULL);

	/* Generate Kh = SHA256(p || q || dP || dQ || qInv)[127:0] */
	XHdcp22Cmn_Sha256Hash(KprivRx, sizeof(XHdcp22_Rx_KprivRx), Kh);

	/* Compute Ekh = AES128(Kh, (Rtx || Rrx)) xor Km */
	XHdcp22Cmn_Aes128Encrypt(M, Kh+XHDCP22_RX_EKH_SIZE, Ekh);
	XHdcp22Rx_Xor(Ekh, Ekh, Km, XHDCP22_RX_EKH_SIZE);
}
/*****************************************************************************/
/**
* This function computes Ekh used during HDCP 2.2 authentication and key
* exchange for pairing with receiver.
*
* Reference: HDCP v2.2, section 2.2.1
*
* @param	KprivRx is the RSA private key structure containing the quintuple.
* @param	Km is the master key generated by tx.
* @param	M is constructed by concatenating Rtx || Rrx.
* @param	Ekh is the encrypted Km used for pairing.
*
* @return	None.
*
* @note		None.
******************************************************************************/
This function computes Ekh used during HDCP 2.2 authentication and key
exchange for pairing with receiver.


This function computes Ekh used during HDCP 2 . 2 authentication and key exchange for pairing with receiver .
void XHdcp22Rx_ComputeEkh(const u8 *KprivRx, const u8 *Km, const u8 *M, u8 *Ekh)
{
	u8 Kh[XHDCP22_RX_HASH_SIZE];
	Xil_AssertVoid(KprivRx != NULL);
	Xil_AssertVoid(Km != NULL);
	Xil_AssertVoid(M != NULL);
	Xil_AssertVoid(Ekh != NULL);
	XHdcp22Cmn_Sha256Hash(KprivRx, sizeof(XHdcp22_Rx_KprivRx), Kh);
	XHdcp22Cmn_Aes128Encrypt(M, Kh+XHDCP22_RX_EKH_SIZE, Ekh);
	XHdcp22Rx_Xor(Ekh, Ekh, Km, XHDCP22_RX_EKH_SIZE);
}
void XHdcp22Rx_ComputeEkh ( const u8 * KprivRx , const u8 * Km , const u8 * M , u8 * Ekh ) { u8 Kh [ XHDCP22_RX_HASH_SIZE ] ; Xil_AssertVoid ( KprivRx != NULL ) ; Xil_AssertVoid ( Km != NULL ) ; Xil_AssertVoid ( M != NULL ) ; Xil_AssertVoid ( Ekh != NULL ) ; XHdcp22Cmn_Sha256Hash ( KprivRx , sizeof ( XHdcp22_Rx_KprivRx ) , Kh ) ; XHdcp22Cmn_Aes128Encrypt ( M , Kh + XHDCP22_RX_EKH_SIZE , Ekh ) ; XHdcp22Rx_Xor ( Ekh , Ekh , Km , XHDCP22_RX_EKH_SIZE ) ; }
This function computes Ekh used during HDCP 2.2 authentication and key
exchange for pairing with receiver.
This function computes Ekh used during HDCP 2 . 2 authentication and key exchange for pairing with receiver .
/* Verify arguments */ /* Generate Kh = SHA256(p || q || dP || dQ || qInv)[127:0] */ /* Compute Ekh = AES128(Kh, (Rtx || Rrx)) xor Km */