Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: TYBLE16_simple_data_logger TYBLE16_MP3_Air
CryptoCell RSA primitive APIs
[CryptoCell RSA APIs]
Functions | |
CIMPORT_C CRYSError_t | CRYS_RSA_PRIM_Encrypt (CRYS_RSAUserPubKey_t *UserPubKey_ptr, CRYS_RSAPrimeData_t *PrimeData_ptr, uint8_t *Data_ptr, uint16_t DataSize, uint8_t *Output_ptr) |
Implements the RSAEP algorithm, as defined in [PKCS1_2.1] - 6.1.1. | |
CIMPORT_C CRYSError_t | CRYS_RSA_PRIM_Decrypt (CRYS_RSAUserPrivKey_t *UserPrivKey_ptr, CRYS_RSAPrimeData_t *PrimeData_ptr, uint8_t *Data_ptr, uint16_t DataSize, uint8_t *Output_ptr) |
Implements the RSADP algorithm, as defined in [PKCS1_2.1] - 6.1.2. |
Detailed Description
- Note:
- Direct use of primitive functions, rather than schemes to protect data, is strongly discouraged as primitive functions are susceptible to well-known attacks.
Function Documentation
CIMPORT_C CRYSError_t CRYS_RSA_PRIM_Decrypt | ( | CRYS_RSAUserPrivKey_t * | UserPrivKey_ptr, |
CRYS_RSAPrimeData_t * | PrimeData_ptr, | ||
uint8_t * | Data_ptr, | ||
uint16_t | DataSize, | ||
uint8_t * | Output_ptr | ||
) |
Implements the RSADP algorithm, as defined in [PKCS1_2.1] - 6.1.2.
- Returns:
- CRYS_OK on success.
- A non-zero value from crys_rsa_error.h on failure.
- Parameters:
-
[in] UserPrivKey_ptr Pointer to the private key data structure. The key representation (pair or quintuple) and hence the RSA algorithm (CRT or not-CRT) is determined by enum value in the structure CRYS_RSA_Build_PrivKey or CRYS_RSA_Build_PrivKeyCRT. [in] PrimeData_ptr Pointer to a temporary structure containing internal buffers required for the RSA operation. [in] Data_ptr Pointer to the data to be decrypted. [in] DataSize The size (in bytes) of input data must be modulus size. If the size is smaller (not recommendet), then the data will be zero-padded by the function on left side up to the modulus size and therefore, after further decrypt operation,its result will contain zero-padding also. If the function is used for recovering the plain data from result of inverse function (CRYS_RSA_PRIM_Encrypt), the input size must be equal to modulus size exactly. [out] Output_ptr Pointer to the decrypted data. The buffer size must be the modulus size.
CIMPORT_C CRYSError_t CRYS_RSA_PRIM_Encrypt | ( | CRYS_RSAUserPubKey_t * | UserPubKey_ptr, |
CRYS_RSAPrimeData_t * | PrimeData_ptr, | ||
uint8_t * | Data_ptr, | ||
uint16_t | DataSize, | ||
uint8_t * | Output_ptr | ||
) |
Implements the RSAEP algorithm, as defined in [PKCS1_2.1] - 6.1.1.
- Returns:
- CRYS_OK on success.
- A non-zero value from crys_rsa_error.h on failure.
- Parameters:
-
[in] UserPubKey_ptr Pointer to the public key data structure. [in] PrimeData_ptr Pointer to a temporary structure containing internal buffers. [in] Data_ptr Pointer to the data to encrypt. [in] DataSize The size (in bytes) of input data must be modulus size. If is smaller, then the function padds it by zeros on left side up to the modulus size and therefore, after further decrypt operation, its result will contain zero-padding also. If the function is used for recovering the plain data from result of inverse function (CRYS_RSA_PRIM_Decrypt), the input size must be equal to modulus size exactly. [out] Output_ptr Pointer to the encrypted data. The buffer size must be the modulus size.
Generated on Tue Jul 12 2022 13:55:21 by
