nRF5 SDK v13.0.0
Macros | Functions
crys_rsa_kg

Generates a RSA pair of public and private keys. More...

Macros

#define CRYS_RSA_KG_PUB_EXP_MAX_SIZE_BITS   17
 
#define CRYS_RSA_KG_PUB_EXP_ALLOW_VAL_1   0x000003
 
#define CRYS_RSA_KG_PUB_EXP_ALLOW_VAL_2   0x000011
 
#define CRYS_RSA_KG_PUB_EXP_ALLOW_VAL_3   0x010001
 

Functions

CRYSError_t CRYS_RSA_KG_GenerateKeyPair (CRYS_RND_Context_t *rndContext_ptr, uint8_t *pubExp_ptr, uint16_t pubExpSizeInBytes, uint32_t keySize, CRYS_RSAUserPrivKey_t *userPrivKey_ptr, CRYS_RSAUserPubKey_t *userPubKey_ptr, CRYS_RSAKGData_t *keyGenData_ptr, CRYS_RSAKGFipsContext_t *pFipsCtx)
 CRYS_RSA_KG_GenerateKeyPair generates a Pair of public and private keys on non CRT mode according to [ANS X9.31]. More...
 
CRYSError_t CRYS_RSA_KG_GenerateKeyPairCRT (CRYS_RND_Context_t *rndContext_ptr, uint8_t *pubExp_ptr, uint16_t pubExpSizeInBytes, uint32_t keySize, CRYS_RSAUserPrivKey_t *userPrivKey_ptr, CRYS_RSAUserPubKey_t *userPubKey_ptr, CRYS_RSAKGData_t *keyGenData_ptr, CRYS_RSAKGFipsContext_t *pFipsCtx)
 Generates a pair of public and private keys on CRT mode according to [ANS X9.31]. More...
 

Detailed Description

Generates a RSA pair of public and private keys.

Function Documentation

CRYSError_t CRYS_RSA_KG_GenerateKeyPair ( CRYS_RND_Context_t rndContext_ptr,
uint8_t *  pubExp_ptr,
uint16_t  pubExpSizeInBytes,
uint32_t  keySize,
CRYS_RSAUserPrivKey_t userPrivKey_ptr,
CRYS_RSAUserPubKey_t userPubKey_ptr,
CRYS_RSAKGData_t keyGenData_ptr,
CRYS_RSAKGFipsContext_t pFipsCtx 
)

CRYS_RSA_KG_GenerateKeyPair generates a Pair of public and private keys on non CRT mode according to [ANS X9.31].

Note
To be FIPS 186-4 [5.1] compliant use only the following key sizes (in bits): 1024, 2048 and 3072.
Returns
CRYS_OK on success.
A non-zero value from crys_rsa_error.h on failure.
Parameters
[in,out]rndContext_ptrPointer to the RND context buffer.
[in]pubExp_ptrThe pointer to the public exponent (public key).
[in]pubExpSizeInBytesThe public exponent size in bytes.
[in]keySizeThe size of the key, in bits. Supported sizes are 512, 1024, 2048, 3072 and 4096 bit.
[out]userPrivKey_ptrPointer to the private key structure.
[out]userPubKey_ptrPointer to the public key structure.
[in]keyGenData_ptrPointer to a temporary structure required for the KeyGen operation.
[in]pFipsCtxPointer to temporary buffer used in case FIPS certification if required.
CRYSError_t CRYS_RSA_KG_GenerateKeyPairCRT ( CRYS_RND_Context_t rndContext_ptr,
uint8_t *  pubExp_ptr,
uint16_t  pubExpSizeInBytes,
uint32_t  keySize,
CRYS_RSAUserPrivKey_t userPrivKey_ptr,
CRYS_RSAUserPubKey_t userPubKey_ptr,
CRYS_RSAKGData_t keyGenData_ptr,
CRYS_RSAKGFipsContext_t pFipsCtx 
)

Generates a pair of public and private keys on CRT mode according to [ANS X9.31].

Note
To be FIPS 186-4 [5.1] compliant use only the following key sizes (in bits): 1024, 2048 and 3072.
Returns
CRYS_OK on success.
A non-zero value from crys_rsa_error.h on failure.
Parameters
[in,out]rndContext_ptrPointer to the RND context buffer.
[in]pubExp_ptrThe pointer to the public exponent (public key).
[in]pubExpSizeInBytesThe public exponent size in bytes.
[in]keySizeThe size of the key, in bits. Supported sizes are 512, 1024, 2048, 3072 and 4096 bit.
[out]userPrivKey_ptrPointer to the private key structure.
[out]userPubKey_ptrPointer to the public key structure.
[in]keyGenData_ptrPointer to a temporary structure required for the KeyGen operation.
[in]pFipsCtxPointer to temporary buffer used in case FIPS certification if required.

Documentation feedback | Developer Zone | Subscribe | Updated