lib/sw_services/xilsecure/src/versal/server/xsecure_elliptic_ipihandler.c
static int XSecure_EllipticValidatePubKey(u32 CurveType, u32 SrcAddrLow,
	u32 SrcAddrHigh)
{
	volatile int Status = XST_FAILURE;
	u64 SrcAddr = ((u64)SrcAddrHigh << 32U) | (u64)SrcAddrLow;
	u32 Size;

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

	XSecure_EllipticKeyAddr KeyAddr = {SrcAddr, (SrcAddr + (u64)Size)};
	Status = XSecure_EllipticValidateKey_64Bit(
			(XSecure_EllipticCrvTyp)CurveType,
			(XSecure_EllipticKeyAddr *) &KeyAddr);
END:
	return Status;
}
/*****************************************************************************/
/**
 * @brief       This function handler calls XSecure_EllipticValidateKey
 * 		server API
 *
 * @param	CurveType	- Is a type of elliptic curve
 * 		SrcAddrLow	- Lower 32 bit address of the public key
 * 		SrcAddrHigh	- Higher 32 bit address of the public key
 *
 * @return	- XST_SUCCESS - If the elliptic key validation is successful
 * 		- ErrorCode - If there is a failure
 *
 ******************************************************************************/
@brief       This function handler calls XSecure_EllipticValidateKey
server API

@param       CurveType       - Is a type of elliptic curve
SrcAddrLow      - Lower 32 bit address of the public key
SrcAddrHigh     - Higher 32 bit address of the public key

@return      - XST_SUCCESS - If the elliptic key validation is successful
- ErrorCode - If there is a failure
@brief This function handler calls XSecure_EllipticValidateKey server API @param CurveType - Is a type of elliptic curve SrcAddrLow - Lower 32 bit address of the public key SrcAddrHigh - Higher 32 bit address of the public key @return - XST_SUCCESS - If the elliptic key validation is successful - ErrorCode - If there is a failure
static int XSecure_EllipticValidatePubKey(u32 CurveType, u32 SrcAddrLow,
	u32 SrcAddrHigh)
{
	volatile int Status = XST_FAILURE;
	u64 SrcAddr = ((u64)SrcAddrHigh << 32U) | (u64)SrcAddrLow;
	u32 Size;
	if (CurveType == (u32)XSECURE_ECC_NIST_P384) {
		Size = XSECURE_ECC_P384_SIZE_IN_BYTES;
	}
	else if (CurveType == (u32)XSECURE_ECC_NIST_P521) {
		Size = XSECURE_ECC_P521_SIZE_IN_BYTES;
	}
	else {
		Status = XST_INVALID_PARAM;
		goto END;
	}
	XSecure_EllipticKeyAddr KeyAddr = {SrcAddr, (SrcAddr + (u64)Size)};
	Status = XSecure_EllipticValidateKey_64Bit(
			(XSecure_EllipticCrvTyp)CurveType,
			(XSecure_EllipticKeyAddr *) &KeyAddr);
END:
	return Status;
}
static int XSecure_EllipticValidatePubKey ( u32 CurveType , u32 SrcAddrLow , u32 SrcAddrHigh ) { volatile int Status = XST_FAILURE ; u64 SrcAddr = ( ( u64 ) SrcAddrHigh << 32U ) | ( u64 ) SrcAddrLow ; u32 Size ; if ( CurveType == ( u32 ) XSECURE_ECC_NIST_P384 ) { Size = XSECURE_ECC_P384_SIZE_IN_BYTES ; } else if ( CurveType == ( u32 ) XSECURE_ECC_NIST_P521 ) { Size = XSECURE_ECC_P521_SIZE_IN_BYTES ; } else { Status = XST_INVALID_PARAM ; goto END ; } XSecure_EllipticKeyAddr KeyAddr = { SrcAddr , ( SrcAddr + ( u64 ) Size ) } ; Status = XSecure_EllipticValidateKey_64Bit ( ( XSecure_EllipticCrvTyp ) CurveType , ( XSecure_EllipticKeyAddr * ) & KeyAddr ) ; END : return Status ; }
@brief       This function handler calls XSecure_EllipticValidateKey
              server API
@brief This function handler calls XSecure_EllipticValidateKey server API