XilinxProcessorIPLib/drivers/hdcp22_tx/src/xhdcp22_tx_crypt.c
int XHdcp22Tx_EncryptKm(const XHdcp22_Tx_CertRx* CertificatePtr,
                        const u8* KmPtr, u8 *MaskingSeedPtr, u8* EncryptedKmPtr)
{
	/* Verify arguments */
	Xil_AssertNonvoid(CertificatePtr != NULL);
	Xil_AssertNonvoid(KmPtr != NULL);
	Xil_AssertNonvoid(MaskingSeedPtr != NULL);
	Xil_AssertNonvoid(EncryptedKmPtr != NULL);

	return XHdcp22Tx_RsaOaepEncrypt(CertificatePtr->N, 	XHDCP22_TX_CERT_PUB_KEY_N_SIZE,
                                  CertificatePtr->e, XHDCP22_TX_CERT_PUB_KEY_E_SIZE,
                                  KmPtr, XHDCP22_TX_KM_SIZE,
                                  MaskingSeedPtr, EncryptedKmPtr);
}
/*****************************************************************************/
/**
*
* This function encrypts the Km value with the receivers public key into Ekh(Km)
*
* @param  CertificatePtr is a pointer to the certificate from the HDCP2.2 receiver.
* @param  KmPtr is the random master key.
* @param  MaskingSeedPtr is a pointer to a 32 byte seed for masking in the MGF1 function
*         used in RSA-OEAP encryption.
* @param  EncryptedKmPtr output of the encryption with a 128 byte (1024 bit) size.
*
* @return
*         - XST_SUCCESS if encryption succeeded.
*         - XST_FAILURE if encryption failed.
*
* @note   None.
*
******************************************************************************/
This function encrypts the Km value with the receivers public key into Ekh(Km)
This function encrypts the Km value with the receivers public key into Ekh ( Km )
int XHdcp22Tx_EncryptKm(const XHdcp22_Tx_CertRx* CertificatePtr,
                        const u8* KmPtr, u8 *MaskingSeedPtr, u8* EncryptedKmPtr)
{
	Xil_AssertNonvoid(CertificatePtr != NULL);
	Xil_AssertNonvoid(KmPtr != NULL);
	Xil_AssertNonvoid(MaskingSeedPtr != NULL);
	Xil_AssertNonvoid(EncryptedKmPtr != NULL);
	return XHdcp22Tx_RsaOaepEncrypt(CertificatePtr->N, 	XHDCP22_TX_CERT_PUB_KEY_N_SIZE,
                                  CertificatePtr->e, XHDCP22_TX_CERT_PUB_KEY_E_SIZE,
                                  KmPtr, XHDCP22_TX_KM_SIZE,
                                  MaskingSeedPtr, EncryptedKmPtr);
}
int XHdcp22Tx_EncryptKm ( const XHdcp22_Tx_CertRx * CertificatePtr , const u8 * KmPtr , u8 * MaskingSeedPtr , u8 * EncryptedKmPtr ) { Xil_AssertNonvoid ( CertificatePtr != NULL ) ; Xil_AssertNonvoid ( KmPtr != NULL ) ; Xil_AssertNonvoid ( MaskingSeedPtr != NULL ) ; Xil_AssertNonvoid ( EncryptedKmPtr != NULL ) ; return XHdcp22Tx_RsaOaepEncrypt ( CertificatePtr -> N , XHDCP22_TX_CERT_PUB_KEY_N_SIZE , CertificatePtr -> e , XHDCP22_TX_CERT_PUB_KEY_E_SIZE , KmPtr , XHDCP22_TX_KM_SIZE , MaskingSeedPtr , EncryptedKmPtr ) ; }
This function encrypts the Km value with the receivers public key into Ekh(Km)
This function encrypts the Km value with the receivers public key into Ekh ( Km )
/* Verify arguments */