lib/sw_services/xilsecure/src/versal/server/xsecure_elliptic_ipihandler.c
static int XSecure_EllipticVerifySignature(u32 SrcAddrLow, u32 SrcAddrHigh)
{
	volatile int Status = XST_FAILURE;
	u64 Addr = ((u64)SrcAddrHigh << 32U) | (u64)SrcAddrLow;
	XSecure_EllipticSignVerifyParams EcdsaParams;

	Status = XPlmi_DmaXfr(Addr, (UINTPTR)&EcdsaParams,
			sizeof(EcdsaParams),
			XPLMI_PMCDMA_0);
	if (Status != XST_SUCCESS) {
		goto END;
	}

	XSecure_EllipticKeyAddr KeyAddr = {EcdsaParams.PubKeyAddr,
			(EcdsaParams.PubKeyAddr + (u64)EcdsaParams.Size)};
	XSecure_EllipticHashData HashInfo = {EcdsaParams.HashAddr,
			EcdsaParams.Size};
	XSecure_EllipticSignAddr SignAddr = {EcdsaParams.SignAddr,
			(EcdsaParams.SignAddr + (u64)EcdsaParams.Size)};
	Status = XSecure_EllipticVerifySign_64Bit(
			(XSecure_EllipticCrvTyp)EcdsaParams.CurveType,
			(XSecure_EllipticHashData *) &HashInfo,
			(XSecure_EllipticKeyAddr *) &KeyAddr,
			(XSecure_EllipticSignAddr *) &SignAddr);

END:
	return Status;
}
/*****************************************************************************/
/**
 * @brief       This function handler calls XSecure_EllipticVerifySign
 * 		server API
 *
 * @param
 * 		SrcAddrLow	- Lower 32 bit address of the
 * 				XSecure_EllipticSignVerifyParams structure
 * 		SrcAddrHigh	- Higher 32 bit address of the
 * 				XSecure_EllipticSignVerifyParams structure
 *
 * @return	- XST_SUCCESS - If the elliptic sign verify is successful
 * 		- ErrorCode - If there is a failure
 *
 ******************************************************************************/
@brief       This function handler calls XSecure_EllipticVerifySign
server API

@param
SrcAddrLow      - Lower 32 bit address of the
XSecure_EllipticSignVerifyParams structure
SrcAddrHigh     - Higher 32 bit address of the
XSecure_EllipticSignVerifyParams structure

@return      - XST_SUCCESS - If the elliptic sign verify is successful
- ErrorCode - If there is a failure
@brief This function handler calls XSecure_EllipticVerifySign server API @param SrcAddrLow - Lower 32 bit address of the XSecure_EllipticSignVerifyParams structure SrcAddrHigh - Higher 32 bit address of the XSecure_EllipticSignVerifyParams structure @return - XST_SUCCESS - If the elliptic sign verify is successful - ErrorCode - If there is a failure
static int XSecure_EllipticVerifySignature(u32 SrcAddrLow, u32 SrcAddrHigh)
{
	volatile int Status = XST_FAILURE;
	u64 Addr = ((u64)SrcAddrHigh << 32U) | (u64)SrcAddrLow;
	XSecure_EllipticSignVerifyParams EcdsaParams;
	Status = XPlmi_DmaXfr(Addr, (UINTPTR)&EcdsaParams,
			sizeof(EcdsaParams),
			XPLMI_PMCDMA_0);
	if (Status != XST_SUCCESS) {
		goto END;
	}
	XSecure_EllipticKeyAddr KeyAddr = {EcdsaParams.PubKeyAddr,
			(EcdsaParams.PubKeyAddr + (u64)EcdsaParams.Size)};
	XSecure_EllipticHashData HashInfo = {EcdsaParams.HashAddr,
			EcdsaParams.Size};
	XSecure_EllipticSignAddr SignAddr = {EcdsaParams.SignAddr,
			(EcdsaParams.SignAddr + (u64)EcdsaParams.Size)};
	Status = XSecure_EllipticVerifySign_64Bit(
			(XSecure_EllipticCrvTyp)EcdsaParams.CurveType,
			(XSecure_EllipticHashData *) &HashInfo,
			(XSecure_EllipticKeyAddr *) &KeyAddr,
			(XSecure_EllipticSignAddr *) &SignAddr);
END:
	return Status;
}
static int XSecure_EllipticVerifySignature ( u32 SrcAddrLow , u32 SrcAddrHigh ) { volatile int Status = XST_FAILURE ; u64 Addr = ( ( u64 ) SrcAddrHigh << 32U ) | ( u64 ) SrcAddrLow ; XSecure_EllipticSignVerifyParams EcdsaParams ; Status = XPlmi_DmaXfr ( Addr , ( UINTPTR ) & EcdsaParams , sizeof ( EcdsaParams ) , XPLMI_PMCDMA_0 ) ; if ( Status != XST_SUCCESS ) { goto END ; } XSecure_EllipticKeyAddr KeyAddr = { EcdsaParams . PubKeyAddr , ( EcdsaParams . PubKeyAddr + ( u64 ) EcdsaParams . Size ) } ; XSecure_EllipticHashData HashInfo = { EcdsaParams . HashAddr , EcdsaParams . Size } ; XSecure_EllipticSignAddr SignAddr = { EcdsaParams . SignAddr , ( EcdsaParams . SignAddr + ( u64 ) EcdsaParams . Size ) } ; Status = XSecure_EllipticVerifySign_64Bit ( ( XSecure_EllipticCrvTyp ) EcdsaParams . CurveType , ( XSecure_EllipticHashData * ) & HashInfo , ( XSecure_EllipticKeyAddr * ) & KeyAddr , ( XSecure_EllipticSignAddr * ) & SignAddr ) ; END : return Status ; }
@brief       This function handler calls XSecure_EllipticVerifySign
              server API
@brief This function handler calls XSecure_EllipticVerifySign server API