lib/sw_services/xilsecure/src/versal/server/xsecure_elliptic_ipihandler.c
static int XSecure_EllipticGenKey(u32 CurveType, 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;
	u32 OffSet = 0U;

	if (CurveType == (u32)XSECURE_ECC_NIST_P384) {
		OffSet = XSECURE_ECC_P384_SIZE_IN_BYTES;
	}
	else if (CurveType == (u32)XSECURE_ECC_NIST_P521) {
		OffSet = XSECURE_ECC_P521_SIZE_IN_BYTES;
	}
	else {
		Status = XST_INVALID_PARAM;
		goto END;
	}

	XSecure_EllipticKeyAddr KeyAddr = {DstAddr, (DstAddr + (u64)OffSet)};
	Status = XSecure_EllipticGenerateKey_64Bit(
			(XSecure_EllipticCrvTyp)CurveType,
			SrcAddr, (XSecure_EllipticKeyAddr *) &KeyAddr);

END:
	return Status;
}
/*****************************************************************************/
/**
 * @brief       This function handler calls XSecure_EllipticGenerateKey
 * 		server API
 *
 * @param	CurveType	- Is a type of elliptic curve
 * 		SrcAddrLow	- Lower 32 bit address of the
 * 				static private key
 * 		SrcAddrHigh	- Higher 32 bit address of the
 * 				static private key
 * 		DstAddrLow	- Lower 32 bit address of the public key
 * 				to be stored
 * 		DstAddrHigh	- Higher 32 bit address of the public key
 * 				to be stored
 *
 * @return	- XST_SUCCESS - If the elliptic key generation is successful
 * 		- ErrorCode - If there is a failure
 *
 ******************************************************************************/
@brief       This function handler calls XSecure_EllipticGenerateKey
server API



@return      - XST_SUCCESS - If the elliptic key generation is successful
- ErrorCode - If there is a failure
@brief This function handler calls XSecure_EllipticGenerateKey server API @return - XST_SUCCESS - If the elliptic key generation is successful - ErrorCode - If there is a failure
static int XSecure_EllipticGenKey(u32 CurveType, 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;
	u32 OffSet = 0U;
	if (CurveType == (u32)XSECURE_ECC_NIST_P384) {
		OffSet = XSECURE_ECC_P384_SIZE_IN_BYTES;
	}
	else if (CurveType == (u32)XSECURE_ECC_NIST_P521) {
		OffSet = XSECURE_ECC_P521_SIZE_IN_BYTES;
	}
	else {
		Status = XST_INVALID_PARAM;
		goto END;
	}
	XSecure_EllipticKeyAddr KeyAddr = {DstAddr, (DstAddr + (u64)OffSet)};
	Status = XSecure_EllipticGenerateKey_64Bit(
			(XSecure_EllipticCrvTyp)CurveType,
			SrcAddr, (XSecure_EllipticKeyAddr *) &KeyAddr);
END:
	return Status;
}
static int XSecure_EllipticGenKey ( u32 CurveType , 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 ; u32 OffSet = 0U ; if ( CurveType == ( u32 ) XSECURE_ECC_NIST_P384 ) { OffSet = XSECURE_ECC_P384_SIZE_IN_BYTES ; } else if ( CurveType == ( u32 ) XSECURE_ECC_NIST_P521 ) { OffSet = XSECURE_ECC_P521_SIZE_IN_BYTES ; } else { Status = XST_INVALID_PARAM ; goto END ; } XSecure_EllipticKeyAddr KeyAddr = { DstAddr , ( DstAddr + ( u64 ) OffSet ) } ; Status = XSecure_EllipticGenerateKey_64Bit ( ( XSecure_EllipticCrvTyp ) CurveType , SrcAddr , ( XSecure_EllipticKeyAddr * ) & KeyAddr ) ; END : return Status ; }
@brief       This function handler calls XSecure_EllipticGenerateKey
              server API
@brief This function handler calls XSecure_EllipticGenerateKey server API