ica_rsa_mod_expo
Purpose
Performs an RSA encryption or decryption operation using a key in modulus/exponent format.
Comments
Make sure that your message is padded before using this function.
Format
unsigned int ica_rsa_mod_expo(ica_adapter_handle_t adapter_handle,
unsigned char *input_data,
ica_rsa_key_mod_expo_t *rsa_key,
const unsigned char *output_data);
Required hardware support
Cryptographic accelerators or CCA coprocessors.
Parameters
- ica_adapter_handle_t adapter_handle
- Pointer to a previously opened device handle.
- const unsigned char *input_data
- Pointer to the input data to be encrypted or decrypted. This data must be in big endian format. Make sure that the input data is not longer than the bit length of the key. The byte length for the input data and the key must be the same. Right align the input data inside the data block.
- ica_rsa_key_mod_expo_t *rsa_key
- Pointer to the key to be used, in modulus/exponent format.
- unsigned char *output_data
- Pointer to the location where the output results are to be placed. This buffer has to be at least the same size as input_data and therefore at least the same size as the size of the modulus.
Return codes
- 0
- Success
- EPERM
-
Used RSA key is > 4K.
For return codes indicating exceptions, see Return codes.