ica_rsa_crt

Purpose

Performs an RSA encryption or decryption operation using a key in CRT format.

Comments

Make sure that your message is padded before using this function.

Format


unsigned int ica_rsa_crt(ica_adapter_handle_t adapter_handle,
  unsigned char *input_data,
  ica_rsa_key_crt_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_crt_t *rsa_key
Pointer to the key to be used, in CRT format.
unsigned char *output_data
Pointer to the location where the output results are to be placed. This buffer must be as large as the input_data, and as large as the length of the modulus specified in rsa_key.

Return codes

0
Success
EPERM

Used RSA key is > 4K.

For return codes indicating exceptions, see Return codes.