This function handles the RSA encryption with the public key components provided when initializing the RSA cryptographic core with the XSecure_RsaInitialize function.
Note: The Size passed here needs to match the key size used in the XSecure_RsaInitialize function
Prototype
int XSecure_RsaPublicEncrypt(XSecure_Rsa *InstancePtr, u8 *Input, u32 Size, u8 *Result);
Parameters
The following table lists the XSecure_RsaPublicEncrypt
function arguments.
Name | Description |
---|---|
InstancePtr |
Pointer to the
XSecure_Rsa
instance
|
Input | Pointer to the buffer which contains the input data to be encrypted |
Size |
Key size in bytes, Input size also should be same as Key size mentioned. Inputs supported are
|
Result | Pointer to the buffer where resultant decrypted data to be stored |
Returns
- XST_SUCCESS - If encryption was successful
- XSECURE_RSA_INVALID_PARAM - On invalid arguments
- XSECURE_RSA_STATE_MISMATCH_ERROR - If State mismatch is occurred