lib/sw_services/xilsecure/src/common/xsecure_rsa.c
int XSecure_RsaInitialize_64Bit(XSecure_Rsa *InstancePtr, u64 Mod, u64 ModExt,
				u64 ModExpo)
{
	int Status = XST_FAILURE;

	/* Validate the input arguments */
	if ((InstancePtr == NULL) || (Mod == 0x00U) || (ModExpo == 0x00U)) {
		Status = (int)XSECURE_RSA_INVALID_PARAM;
		goto END;
	}

	Status = (int)XSecure_RsaCfgInitialize(InstancePtr);
	if (Status != XST_SUCCESS) {
		goto END;
	}

	InstancePtr->SizeInWords = XSECURE_RSA_4096_SIZE_WORDS;
	InstancePtr->RsaState = XSECURE_RSA_INITIALIZED;

#ifdef versal
	InstancePtr->ModAddr = Mod;
	InstancePtr->ModExtAddr = ModExt;
	InstancePtr->ModExpoAddr = ModExpo;
#else
	InstancePtr->Mod = (u8 *)(UINTPTR)Mod;
	InstancePtr->ModExt = (u8 *)(UINTPTR)ModExt;
	InstancePtr->ModExpo = (u8 *)(UINTPTR)ModExpo;
#endif

	Status = XST_SUCCESS;

END:
	return Status;
}
/*****************************************************************************/
/**
 * @brief	This function initializes a a XSecure_Rsa structure with the
 * 		default values located at a 64-bit address required for
 * 		operating the RSA cryptographic engine
 *
 * @param	InstancePtr - Pointer to the XSecure_Rsa instance
 * @param	Mod	    - Address of the key Modulus of key size
 * @param	ModExt	    - Address of the pre-calculated exponential
 *			      (R^2 Mod N) value
 *			    - 0 - if user doesn't have pre-calculated
 *				     R^2 Mod N value, control will take care
 *				     of this calculation internally
 * @param	ModExpo	    - Address of the buffer which contains key exponent
 *
 * @return	- XST_SUCCESS - If initialization was successful
 *		- XSECURE_RSA_INVALID_PARAM - On invalid arguments
 *
 * @note	`Modulus`, `ModExt` and `ModExpo` are part of partition signature
 * 		 when authenticated boot image is generated by bootgen, else the
 *		 all of them should be extracted from the key
 *
 ******************************************************************************/
@brief       This function initializes a a XSecure_Rsa structure with the
default values located at a 64-bit address required for
operating the RSA cryptographic engine



@return      - XST_SUCCESS - If initialization was successful
- XSECURE_RSA_INVALID_PARAM - On invalid arguments


@brief This function initializes a a XSecure_Rsa structure with the default values located at a 64 - bit address required for operating the RSA cryptographic engine @return - XST_SUCCESS - If initialization was successful - XSECURE_RSA_INVALID_PARAM - On invalid arguments
int XSecure_RsaInitialize_64Bit(XSecure_Rsa *InstancePtr, u64 Mod, u64 ModExt,
				u64 ModExpo)
{
	int Status = XST_FAILURE;
	if ((InstancePtr == NULL) || (Mod == 0x00U) || (ModExpo == 0x00U)) {
		Status = (int)XSECURE_RSA_INVALID_PARAM;
		goto END;
	}
	Status = (int)XSecure_RsaCfgInitialize(InstancePtr);
	if (Status != XST_SUCCESS) {
		goto END;
	}
	InstancePtr->SizeInWords = XSECURE_RSA_4096_SIZE_WORDS;
	InstancePtr->RsaState = XSECURE_RSA_INITIALIZED;
#ifdef versal
	InstancePtr->ModAddr = Mod;
	InstancePtr->ModExtAddr = ModExt;
	InstancePtr->ModExpoAddr = ModExpo;
#else
	InstancePtr->Mod = (u8 *)(UINTPTR)Mod;
	InstancePtr->ModExt = (u8 *)(UINTPTR)ModExt;
	InstancePtr->ModExpo = (u8 *)(UINTPTR)ModExpo;
#endif
	Status = XST_SUCCESS;
END:
	return Status;
}
int XSecure_RsaInitialize_64Bit ( XSecure_Rsa * InstancePtr , u64 Mod , u64 ModExt , u64 ModExpo ) { int Status = XST_FAILURE ; if ( ( InstancePtr == NULL ) || ( Mod == 0x00U ) || ( ModExpo == 0x00U ) ) { Status = ( int ) XSECURE_RSA_INVALID_PARAM ; goto END ; } Status = ( int ) XSecure_RsaCfgInitialize ( InstancePtr ) ; if ( Status != XST_SUCCESS ) { goto END ; } InstancePtr -> SizeInWords = XSECURE_RSA_4096_SIZE_WORDS ; InstancePtr -> RsaState = XSECURE_RSA_INITIALIZED ; #ifdef versal InstancePtr -> ModAddr = Mod ; InstancePtr -> ModExtAddr = ModExt ; InstancePtr -> ModExpoAddr = ModExpo ; #else InstancePtr -> Mod = ( u8 * ) ( UINTPTR ) Mod ; InstancePtr -> ModExt = ( u8 * ) ( UINTPTR ) ModExt ; InstancePtr -> ModExpo = ( u8 * ) ( UINTPTR ) ModExpo ; #endif Status = XST_SUCCESS ; END : return Status ; }
@brief       This function initializes a a XSecure_Rsa structure with the
              default values located at a 64-bit address required for
              operating the RSA cryptographic engine
@brief This function initializes a a XSecure_Rsa structure with the default values located at a 64 - bit address required for operating the RSA cryptographic engine
/* Validate the input arguments */