XSecure_RsaPrivateDecrypt - 2020.2 English

OS and Libraries Document Collection (UG643)

Document ID
UG643
Release Date
2020-11-24
Version
2020.2 English

This function handles the RSA decryption with the private key components provided when initializing the RSA cryptographic core with the XSecure_RsaInitialize function.

Note: The Size passed in needs to match the key size used in the XSecure_RsaInitialize function..

Prototype

s32 XSecure_RsaPrivateDecrypt(XSecure_Rsa *InstancePtr, u8 *Input, u32 Size, u8 *Result);

Parameters

The following table lists the XSecure_RsaPrivateDecrypt function arguments.

Table 1. XSecure_RsaPrivateDecrypt Arguments
Name Description
InstancePtr Pointer to the XSecure_Rsa instance.
Input Pointer to the buffer which contains the input data to be decrypted.
Size Key size in bytes, Input size also should be same as Key size mentioned. Inputs supported are
  • XSECURE_RSA_4096_KEY_SIZE,
  • XSECURE_RSA_2048_KEY_SIZE
  • XSECURE_RSA_3072_KEY_SIZE
Result Pointer to the buffer where resultant decrypted data to be stored .

Returns

  • XST_SUCCESS if decryption was successful.
  • XSECURE_RSA_DATA_VALUE_ERROR - if input data is greater than modulus.
  • XST_FAILURE - on RSA operation failure.