lib/sw_services/xilsecure/src/versal/server/xsecure_elliptic_ipihandler.c
static int XSecure_EllipticGenSign(u32 SrcAddrLow, u32 SrcAddrHigh,
	u32 DstAddrLow, u32 DstAddrHigh)
{
	volatile int Status = XST_FAILURE;
	u64 SrcAddr = ((u64)SrcAddrHigh << 32U) | (u64)SrcAddrLow;
	u64 DstAddr = ((u64)DstAddrHigh << 32U) | (u64)DstAddrLow;
	XSecure_EllipticSignGenParams EcdsaParams;

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

	XSecure_EllipticHashData HashInfo = {EcdsaParams.HashAddr,
			EcdsaParams.Size};
	XSecure_EllipticSignAddr SignAddr = {DstAddr,
			(DstAddr + (u64)EcdsaParams.Size)};

	Status = XSecure_EllipticGenerateSignature_64Bit(
			(XSecure_EllipticCrvTyp)EcdsaParams.CurveType,
			(XSecure_EllipticHashData *) &HashInfo,
			EcdsaParams.PrivKeyAddr,
			EcdsaParams.EPrivKeyAddr,
			(XSecure_EllipticSignAddr *) &SignAddr);

END:
	return Status;
}
/*****************************************************************************/
/**
 * @brief       This function handler calls XSecure_EllipticGenerateSignature
 * 		server API
 *
 * @param
 * 		SrcAddrLow	- Lower 32 bit address of the
 * 				XSecure_EllipticSignGenParams structure
 * 		SrcAddrHigh	- Higher 32 bit address of the
 * 				XSecure_EllipticSignGenParams structure
 * 		DstAddrLow	- Lower 32 bit address of the signature
 * 				to be stored
 * 		DstAddrHigh	- Higher 32 bit address of the signature
 * 				to be stored
 *
 * @return	- XST_SUCCESS - If the elliptic sign generation is successful
 * 		- ErrorCode - If there is a failure
 *
 ******************************************************************************/
@brief       This function handler calls XSecure_EllipticGenerateSignature
server API

@param
SrcAddrLow      - Lower 32 bit address of the
XSecure_EllipticSignGenParams structure
SrcAddrHigh     - Higher 32 bit address of the
XSecure_EllipticSignGenParams structure
DstAddrLow      - Lower 32 bit address of the signature
to be stored
DstAddrHigh     - Higher 32 bit address of the signature
to be stored

@return      - XST_SUCCESS - If the elliptic sign generation is successful
- ErrorCode - If there is a failure
@brief This function handler calls XSecure_EllipticGenerateSignature server API @param SrcAddrLow - Lower 32 bit address of the XSecure_EllipticSignGenParams structure SrcAddrHigh - Higher 32 bit address of the XSecure_EllipticSignGenParams structure DstAddrLow - Lower 32 bit address of the signature to be stored DstAddrHigh - Higher 32 bit address of the signature to be stored @return - XST_SUCCESS - If the elliptic sign generation is successful - ErrorCode - If there is a failure
static int XSecure_EllipticGenSign(u32 SrcAddrLow, u32 SrcAddrHigh,
	u32 DstAddrLow, u32 DstAddrHigh)
{
	volatile int Status = XST_FAILURE;
	u64 SrcAddr = ((u64)SrcAddrHigh << 32U) | (u64)SrcAddrLow;
	u64 DstAddr = ((u64)DstAddrHigh << 32U) | (u64)DstAddrLow;
	XSecure_EllipticSignGenParams EcdsaParams;
	Status = XPlmi_DmaXfr(SrcAddr, (UINTPTR)&EcdsaParams, sizeof(EcdsaParams),
			XPLMI_PMCDMA_0);
	if (Status != XST_SUCCESS) {
		goto END;
	}
	XSecure_EllipticHashData HashInfo = {EcdsaParams.HashAddr,
			EcdsaParams.Size};
	XSecure_EllipticSignAddr SignAddr = {DstAddr,
			(DstAddr + (u64)EcdsaParams.Size)};
	Status = XSecure_EllipticGenerateSignature_64Bit(
			(XSecure_EllipticCrvTyp)EcdsaParams.CurveType,
			(XSecure_EllipticHashData *) &HashInfo,
			EcdsaParams.PrivKeyAddr,
			EcdsaParams.EPrivKeyAddr,
			(XSecure_EllipticSignAddr *) &SignAddr);
END:
	return Status;
}
static int XSecure_EllipticGenSign ( u32 SrcAddrLow , u32 SrcAddrHigh , u32 DstAddrLow , u32 DstAddrHigh ) { volatile int Status = XST_FAILURE ; u64 SrcAddr = ( ( u64 ) SrcAddrHigh << 32U ) | ( u64 ) SrcAddrLow ; u64 DstAddr = ( ( u64 ) DstAddrHigh << 32U ) | ( u64 ) DstAddrLow ; XSecure_EllipticSignGenParams EcdsaParams ; Status = XPlmi_DmaXfr ( SrcAddr , ( UINTPTR ) & EcdsaParams , sizeof ( EcdsaParams ) , XPLMI_PMCDMA_0 ) ; if ( Status != XST_SUCCESS ) { goto END ; } XSecure_EllipticHashData HashInfo = { EcdsaParams . HashAddr , EcdsaParams . Size } ; XSecure_EllipticSignAddr SignAddr = { DstAddr , ( DstAddr + ( u64 ) EcdsaParams . Size ) } ; Status = XSecure_EllipticGenerateSignature_64Bit ( ( XSecure_EllipticCrvTyp ) EcdsaParams . CurveType , ( XSecure_EllipticHashData * ) & HashInfo , EcdsaParams . PrivKeyAddr , EcdsaParams . EPrivKeyAddr , ( XSecure_EllipticSignAddr * ) & SignAddr ) ; END : return Status ; }
@brief       This function handler calls XSecure_EllipticGenerateSignature
              server API
@brief This function handler calls XSecure_EllipticGenerateSignature server API