MCUX CLNS
MCUX Crypto Library Normal Secure
 
Loading...
Searching...
No Matches
mcuxClRsa_Cipher_Crypt_RSAES_OAEP_1000b_example.c

Example for the mcuxCRsa component realize RSA OAEP encrypt/decrypt operation using mcuxClCipher_crypt.

Example for the mcuxCRsa component realize RSA OAEP encrypt/decrypt operation using mcuxClCipher_crypt. Example for the mcuxCRsa component realize encrypt/decrypt operation using mcuxClCipher_crypt for:

/*--------------------------------------------------------------------------*/
/* Copyright 2020-2024 NXP */
/* */
/* NXP Proprietary. This software is owned or controlled by NXP and may */
/* only be used strictly in accordance with the applicable license terms. */
/* By expressly accepting such terms or by downloading, installing, */
/* activating and/or otherwise using the software, you are agreeing that */
/* you have read, and that you agree to comply with and are bound by, such */
/* license terms. If you do not agree to be bound by the applicable */
/* license terms, then you may not retain, install, activate or otherwise */
/* use the software. */
/*--------------------------------------------------------------------------*/
#include <mcuxClSession.h>
#include <mcuxClKey.h>
#include <mcuxClRandom.h>
#include <mcuxClRsa.h>
#include <mcuxClHash.h>
#include <mcuxClHashModes.h>
#include <mcuxClCipher.h>
#include <mcuxClBuffer.h>
#include <mcuxClCore_Examples.h>
#include <mcuxClExample_Session_Helper.h>
#include <mcuxClEls.h> // Interface to the entire mcuxClEls component
#include <mcuxClExample_ELS_Helper.h>
/**********************************************************/
/* Example test vectors */
/**********************************************************/
#define RSA_KEY_BIT_LENGTH (1000u)
#define RSA_KEY_BYTE_LENGTH (RSA_KEY_BIT_LENGTH / 8u)
#define RSA_PUBLIC_EXP_BYTE_LENGTH (3u)
#define RSA_OAEP_LABEL_LENGTH (0u)
#define INPUT_MESSAGE_LENGTH (48u)
static const uint8_t modulus[RSA_KEY_BYTE_LENGTH] __attribute__ ((aligned (4))) = {
0xB2u, 0xBFu, 0xB1u, 0x51u, 0xCDu, 0x41u, 0x28u, 0xC4u, 0xFCu, 0x65u, 0xEEu, 0xCBu, 0x78u, 0x7Au, 0x2Fu, 0xDDu,
0xE6u, 0x54u, 0x26u, 0x33u, 0x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cuxClRsa_Cipher_Crypt_RSAES_OAEP_1000b_example)
{
/**************************************************************************/
/* Preparation: setup session */
/**************************************************************************/
if(!mcuxClExample_Els_Init(MCUXCLELS_RESET_DO_NOT_CANCEL))
{
return MCUXCLEXAMPLE_STATUS_ERROR;
}
#define CPU_WA_BUFFER_SIZE MCUXCLCORE_MAX(MCUXCLCORE_MAX(\
MCUXCLRANDOMMODES_NCINIT_WACPU_SIZE,\
MCUXCLRSA_ENCRYPT_WACPU_SIZE(RSA_KEY_BIT_LENGTH)),\
MCUXCLRSA_DECRYPT_WACPU_SIZE(RSA_KEY_BIT_LENGTH))
#define PKC_WA_BUFFER_SIZE MCUXCLCORE_MAX(MCUXCLRSA_ENCRYPT_WAPKC_SIZE(RSA_KEY_BIT_LENGTH),\
MCUXCLRSA_DECRYPT_WAPKC_SIZE(RSA_KEY_BIT_LENGTH))
mcuxClSession_Handle_t session = &sessionDesc;
//Allocate and initialize session
MCUXCLEXAMPLE_ALLOCATE_AND_INITIALIZE_SESSION(session,
CPU_WA_BUFFER_SIZE,
PKC_WA_BUFFER_SIZE);
/**************************************************************************/
/* Initialize the PRNG */
/**************************************************************************/
MCUX_CSSL_FP_FUNCTION_CALL_BEGIN(prngInit_result, prngInit_token, mcuxClRandom_ncInit(session));
if((MCUX_CSSL_FP_FUNCTION_CALLED(mcuxClRandom_ncInit) != prngInit_token) || (MCUXCLRANDOM_STATUS_OK != prngInit_result))
{
return MCUXCLEXAMPLE_STATUS_ERROR;
}
/**************************************************************************/
/* Preparation: setup RSA key */
/**************************************************************************/
/* Allocation of key data buffers, which contain RSA key parameters */
MCUX_CSSL_ANALYSIS_START_SUPPRESS_DISCARD_CONST("Required by API, elements are not modified in executed scenario")
mcuxClRsa_KeyData_Plain_t privKeyStruct = {
.modulus.keyEntryLength = RSA_KEY_BYTE_LENGTH,
.exponent.pKeyEntryData = (uint8_t*)privExp,
.exponent.keyEntryLength = sizeof(privExp)
};
MCUX_CSSL_ANALYSIS_STOP_SUPPRESS_DISCARD_CONST()
MCUX_CSSL_ANALYSIS_START_SUPPRESS_DISCARD_CONST("Required by API, elements are not modified in executed scenario")
mcuxClRsa_KeyData_Plain_t pubKeyStruct = {
.modulus.keyEntryLength = RSA_KEY_BYTE_LENGTH,
.exponent.pKeyEntryData = (uint8_t*)pubExp,
.exponent.keyEntryLength = sizeof(pubExp)
};
MCUX_CSSL_ANALYSIS_STOP_SUPPRESS_DISCARD_CONST()
/* Initialize RSA private plain key type descriptor */
uint32_t keyTypeDesc_RsaPrivatePlain_1000[MCUXCLKEY_TYPEDESCRIPTOR_SIZE_IN_WORDS];
MCUX_CSSL_ANALYSIS_START_PATTERN_REINTERPRET_MEMORY_OF_OPAQUE_TYPES()
mcuxClKey_TypeDescriptor_t *pKeyTypeDesc_RsaPrivatePlain_1000 = (mcuxClKey_TypeDescriptor_t *) keyTypeDesc_RsaPrivatePlain_1000;
MCUX_CSSL_ANALYSIS_STOP_PATTERN_REINTERPRET_MEMORY_OF_OPAQUE_TYPES()
MCUX_CSSL_FP_FUNCTION_CALL_BEGIN(kt_priv_status, kt_priv_token, mcuxClRsa_PrivatePlain_KeyType_ModeConstructor(
MCUX_CSSL_ANALYSIS_START_SUPPRESS_POINTER_INCOMPATIBLE("The pointer pKeyTypeDesc_RsaPrivatePlain_1000 points to an object of the right type, the cast was valid.")
/* mcuxClKey_TypeDescriptor_t * pKeyType */ pKeyTypeDesc_RsaPrivatePlain_1000,
MCUX_CSSL_ANALYSIS_STOP_SUPPRESS_POINTER_INCOMPATIBLE()
/* mcuxClKey_Size_t keySize */ RSA_KEY_BYTE_LENGTH
));
if((MCUX_CSSL_FP_FUNCTION_CALLED(mcuxClRsa_PrivatePlain_KeyType_ModeConstructor) != kt_priv_token) || (MCUXCLRSA_STATUS_OK != kt_priv_status))
{
return MCUXCLEXAMPLE_STATUS_ERROR;
}
/* Initialize RSA private key */
uint32_t privKeyDesc[MCUXCLKEY_DESCRIPTOR_SIZE_IN_WORDS];
MCUX_CSSL_ANALYSIS_START_PATTERN_REINTERPRET_MEMORY_OF_OPAQUE_TYPES()
mcuxClKey_Handle_t privKey = (mcuxClKey_Handle_t) privKeyDesc;
MCUX_CSSL_ANALYSIS_STOP_PATTERN_REINTERPRET_MEMORY_OF_OPAQUE_TYPES()
uint32_t sizeOfPrivKey = (uint32_t)sizeof(privKeyStruct);
MCUX_CSSL_FP_FUNCTION_CALL_BEGIN(keyInitPriv_result, keyInitPriv_token, mcuxClKey_init(
/* mcuxClSession_Handle_t session */ session,
MCUX_CSSL_ANALYSIS_START_SUPPRESS_POINTER_INCOMPATIBLE("The pointer privKey points to an object of the right type, the cast was valid.")
/* mcuxClKey_Handle_t key */ privKey,
MCUX_CSSL_ANALYSIS_STOP_SUPPRESS_POINTER_INCOMPATIBLE()
/* mcuxClKey_Type_t type */ (mcuxClKey_Type_t) &keyTypeDesc_RsaPrivatePlain_1000,
/* uint8_t * pKeyData */ (uint8_t *) &privKeyStruct,
/* uint32_t keyDataLength */ sizeOfPrivKey
));
if((MCUX_CSSL_FP_FUNCTION_CALLED(mcuxClKey_init) != keyInitPriv_token) || (MCUXCLKEY_STATUS_OK != keyInitPriv_result))
{
return MCUXCLEXAMPLE_STATUS_ERROR;
}
/* Initialize RSA private plain key type descriptor */
uint32_t keyTypeDesc_RsaPublic_1000[MCUXCLKEY_TYPEDESCRIPTOR_SIZE_IN_WORDS];
MCUX_CSSL_ANALYSIS_START_PATTERN_REINTERPRET_MEMORY_OF_OPAQUE_TYPES()
mcuxClKey_TypeDescriptor_t *pkeyTypeDesc_RsaPublic_1000 = (mcuxClKey_TypeDescriptor_t *) keyTypeDesc_RsaPublic_1000;
MCUX_CSSL_ANALYSIS_STOP_PATTERN_REINTERPRET_MEMORY_OF_OPAQUE_TYPES()
MCUX_CSSL_FP_FUNCTION_CALL_BEGIN(kt_pub_status, kt_pub_token, mcuxClRsa_Public_KeyType_ModeConstructor(
MCUX_CSSL_ANALYSIS_START_SUPPRESS_POINTER_INCOMPATIBLE("The pointer pkeyTypeDesc_RsaPublic_1000 points to an object of the right type, the cast was valid.")
/* mcuxClKey_TypeDescriptor_t * pKeyType */ pkeyTypeDesc_RsaPublic_1000,
MCUX_CSSL_ANALYSIS_STOP_SUPPRESS_POINTER_INCOMPATIBLE()
/* mcuxClKey_Size_t keySize */ RSA_KEY_BYTE_LENGTH
));
if((MCUX_CSSL_FP_FUNCTION_CALLED(mcuxClRsa_Public_KeyType_ModeConstructor) != kt_pub_token) || (MCUXCLRSA_STATUS_OK != kt_pub_status))
{
return MCUXCLEXAMPLE_STATUS_ERROR;
}
/* Initialize RSA public key */
uint32_t pubKeyDesc[MCUXCLKEY_DESCRIPTOR_SIZE_IN_WORDS];
MCUX_CSSL_ANALYSIS_START_PATTERN_REINTERPRET_MEMORY_OF_OPAQUE_TYPES()
mcuxClKey_Handle_t pubKey = (mcuxClKey_Handle_t) pubKeyDesc;
MCUX_CSSL_ANALYSIS_STOP_PATTERN_REINTERPRET_MEMORY_OF_OPAQUE_TYPES()
uint32_t sizeOfPubKey = (uint32_t)sizeof(pubKeyStruct);
MCUX_CSSL_FP_FUNCTION_CALL_BEGIN(keyInitPub_result, keyInitPub_token, mcuxClKey_init(
/* mcuxClSession_Handle_t session */ session,
MCUX_CSSL_ANALYSIS_START_SUPPRESS_POINTER_INCOMPATIBLE("The pointer pubKey is of the right type (mcuxClKey_Handle_t)")
/* mcuxClKey_Handle_t key */ pubKey,
MCUX_CSSL_ANALYSIS_STOP_SUPPRESS_POINTER_INCOMPATIBLE()
/* mcuxClKey_Type_t type */ (mcuxClKey_Type_t) &keyTypeDesc_RsaPublic_1000,
/* uint8_t * pKeyData */ (uint8_t *) &pubKeyStruct,
/* uint32_t keyDataLength */ sizeOfPubKey
));
if((MCUX_CSSL_FP_FUNCTION_CALLED(mcuxClKey_init) != keyInitPub_token) || (MCUXCLKEY_STATUS_OK != keyInitPub_result))
{
return MCUXCLEXAMPLE_STATUS_ERROR;
}
/**************************************************************************/
/* Preparation: setup RSA OAEP encrypt mode with SHA-256 */
/**************************************************************************/
/* Fill mode descriptor with the relevant data for the selected padding and hash algorithms */
uint32_t cipherModeBytes[MCUXCLRSA_CIPHER_MODE_SIZE_IN_WORD];
MCUX_CSSL_ANALYSIS_START_PATTERN_REINTERPRET_MEMORY_OF_OPAQUE_TYPES()
MCUX_CSSL_ANALYSIS_STOP_PATTERN_REINTERPRET_MEMORY_OF_OPAQUE_TYPES()
mcuxClRsa_CipherModeConstructor_RSAES_OAEP_Encrypt(
MCUX_CSSL_ANALYSIS_START_SUPPRESS_POINTER_INCOMPATIBLE("The pointer pCipherMode points to an object of the right type, the cast was valid.")
/* mcuxClCipher_ModeDescriptor_t * pCipherMode: */ pCipherMode,
MCUX_CSSL_ANALYSIS_STOP_SUPPRESS_POINTER_INCOMPATIBLE()
/* mcuxClHash_Algo_t hashAlgorithm: */ mcuxClHash_Algorithm_Sha256
);
/**************************************************************************/
/* Encryption */
/**************************************************************************/
uint8_t encryptedData[RSA_KEY_BYTE_LENGTH];
uint32_t encryptedSize = 0u;
uint32_t sizeOfPlainData = (uint32_t)sizeof(plainData);
MCUXCLBUFFER_INIT(encryptedDataBuf, session, encryptedData, RSA_KEY_BYTE_LENGTH);
MCUX_CSSL_FP_FUNCTION_CALL_BEGIN(encrypt_result, encrypt_token, mcuxClCipher_crypt(
/* mcuxClSession_Handle_t session */ session,
/* const mcuxClKey_Handle_t key */ pubKey,
/* mcuxClCipher_Mode_t mode */ pCipherMode,
MCUX_CSSL_ANALYSIS_START_PATTERN_NULL_POINTER_CONSTANT()
/* mcuxCl_InputBuffer_t pIv */ NULL, /* label for OAEP decoding, set to NULL if no label is provided */
MCUX_CSSL_ANALYSIS_STOP_PATTERN_NULL_POINTER_CONSTANT()
/* uint32_t ivLength */ (uint32_t)RSA_OAEP_LABEL_LENGTH, /* label length */
/* mcuxCl_InputBuffer_t pIn */ plainDataBuf,
/* uint32_t inLength */ sizeOfPlainData,
/* mcuxCl_Buffer_t pOut */ encryptedDataBuf,
/* uint32_t * const pOutLength */ &encryptedSize
));
if((MCUX_CSSL_FP_FUNCTION_CALLED(mcuxClCipher_crypt) != encrypt_token) || (MCUXCLCIPHER_STATUS_OK != encrypt_result))
{
return MCUXCLEXAMPLE_STATUS_ERROR;
}
if(encryptedSize != sizeof(encryptedData))
{
return MCUXCLEXAMPLE_STATUS_ERROR;
}
/**************************************************************************/
/* Preparation: setup RSA OAEP decrypt mode with SHA-256 */
/**************************************************************************/
mcuxClRsa_CipherModeConstructor_RSAES_OAEP_Decrypt(
/* mcuxClCipher_ModeDescriptor_t * pCipherMode: */ pCipherMode,
/* mcuxClHash_Algo_t hashAlgorithm: */ mcuxClHash_Algorithm_Sha256
);
/**************************************************************************/
/* Decryption */
/**************************************************************************/
uint32_t decryptedSize = 0u;
uint8_t decryptedData[INPUT_MESSAGE_LENGTH];
MCUXCLBUFFER_INIT(decryptedDataBuf, session, decryptedData, INPUT_MESSAGE_LENGTH);
MCUX_CSSL_FP_FUNCTION_CALL_BEGIN(decrypt_result, decrypt_token, mcuxClCipher_crypt(
/* mcuxClSession_Handle_t session */ session,
/* const mcuxClKey_Handle_t key */ privKey,
/* mcuxClCipher_Mode_t mode */ pCipherMode,
MCUX_CSSL_ANALYSIS_START_PATTERN_NULL_POINTER_CONSTANT()
/* mcuxCl_InputBuffer_t pIv */ NULL, /* label for OAEP decoding, set to NULL if no label is provided */
MCUX_CSSL_ANALYSIS_STOP_PATTERN_NULL_POINTER_CONSTANT()
/* uint32_t ivLength */ (uint32_t)RSA_OAEP_LABEL_LENGTH, /* label length */
/* mcuxCl_InputBuffer_t pIn */ (mcuxCl_InputBuffer_t)encryptedDataBuf,
/* uint32_t inLength */ encryptedSize,
/* mcuxCl_Buffer_t pOut */ decryptedDataBuf,
/* uint32_t * const pOutLength */ &decryptedSize
));
if((MCUX_CSSL_FP_FUNCTION_CALLED(mcuxClCipher_crypt) != decrypt_token) || (MCUXCLCIPHER_STATUS_OK != decrypt_result))
{
return MCUXCLEXAMPLE_STATUS_ERROR;
}
if(decryptedSize != sizeof(decryptedData))
{
return MCUXCLEXAMPLE_STATUS_ERROR;
}
/**************************************************************************/
/* Destroy the current session */
/**************************************************************************/
if(!mcuxClExample_Session_Clean(session))
{
return MCUXCLEXAMPLE_STATUS_ERROR;
}
if(!mcuxClExample_Els_Disable())
{
return MCUXCLEXAMPLE_STATUS_ERROR;
}
/**************************************************************************/
/* Verification */
/**************************************************************************/
if(!mcuxClCore_assertEqual(plainData, decryptedData, sizeof(plainData)))
{
return MCUXCLEXAMPLE_STATUS_ERROR;
}
return MCUXCLEXAMPLE_STATUS_OK;
}
#define RSA_PUBLIC_EXP_BYTE_LENGTH
The public exponent has a length of three bytes.
Definition mcuxClRsa_verify_pssverify_sha2_256_example.c:44
#define RSA_KEY_BYTE_LENGTH
Converting the key-bitlength to bytelength.
Definition mcuxClRsa_verify_pssverify_sha2_256_example.c:43
static const ALIGNED uint8_t modulus[RSA_KEY_BYTE_LENGTH]
Example value for public RSA modulus N.
Definition mcuxClRsa_verify_pssverify_sha2_256_example.c:51
static const uint8_t plainData[INPUT_MESSAGE_LENGTH]
Example plaintext to be encrypted.
Definition mcuxClRsa_Cipher_Crypt_RSAES_OAEP_example.c:107
#define RSA_OAEP_LABEL_LENGTH
The label length is set to 0 in this example.
Definition mcuxClRsa_Cipher_Crypt_RSAES_OAEP_example.c:50
#define INPUT_MESSAGE_LENGTH
Arbitrary size of the message to be encrypted/decrypted.
Definition mcuxClRsa_Cipher_Crypt_RSAES_OAEP_example.c:51
Provides the API for the CL buffer types.
Top-level include file for the mcuxClCipher component.
mcuxClCipher_Status_t mcuxClCipher_crypt(mcuxClSession_Handle_t session, mcuxClKey_Handle_t key, mcuxClCipher_Mode_t mode, mcuxCl_InputBuffer_t pIv, uint32_t ivLength, mcuxCl_InputBuffer_t pIn, uint32_t inLength, mcuxCl_Buffer_t pOut, uint32_t *const pOutLength)
One-shot encryption/decryption function.
Definition of macros.
Top-level include file for the ELS driver.
Top-level include file for the mcuxClHash component.
Top-level include file for the mcuxClKey component.
Top level header of mcuxClRandom component.
Top level header of mcuxClRandomModes component.
Top-level include file for the mcuxClRsa component.
Top-level include file for the mcuxClSession component.
#define MCUXCLBUFFER_INIT(name, info, ptr, size)
Initialize an input/output buffer (mcuxCl_Buffer_t).
Definition mcuxClBuffer.h:71
#define MCUXCLBUFFER_INIT_RO(name, info, ptr, size)
Initialize an input buffer (mcuxCl_InputBuffer_t) with plain CPU handling.
Definition mcuxClBuffer.h:88
const uint8_t * mcuxCl_InputBuffer_t
Input buffer type.
Definition mcuxClBuffer_Pointer.h:46
struct mcuxClCipher_ModeDescriptor mcuxClCipher_ModeDescriptor_t
Cipher mode/algorithm descriptor type.
Definition mcuxClCipher_Types.h:54
#define MCUXCLELS_RESET_DO_NOT_CANCEL
Set this option at mcuxClEls_ResetOption_t to abort the requested command if another ELS operation is...
Definition mcuxClEls_Common.h:119
static mcuxClHash_Algo_t mcuxClHash_Algorithm_Sha256
Sha-256 algorithm Sha-256 hash calculation using the Hash functionality of ELS, it supports RTF.
Definition mcuxClHashModes_Algorithms.h:121
#define MCUXCLKEY_STATUS_OK
Key operation successful.
Definition mcuxClKey_Constants.h:39
mcuxClKey_Status_t mcuxClKey_init(mcuxClSession_Handle_t pSession, mcuxClKey_Handle_t key, mcuxClKey_Type_t type, const uint8_t *pKeyData, uint32_t keyDataLength)
Initializes a key handle.
const mcuxClKey_TypeDescriptor_t * mcuxClKey_Type_t
Key type handle type.
Definition mcuxClKey_Types.h:111
struct mcuxClKey_TypeDescriptor mcuxClKey_TypeDescriptor_t
Key type descriptor type.
Definition mcuxClKey_Types.h:104
mcuxClKey_Descriptor_t *const mcuxClKey_Handle_t
Key handle type.
Definition mcuxClKey_Types.h:88
mcuxClRandom_Status_t mcuxClRandom_ncInit(mcuxClSession_Handle_t pSession)
Non-cryptographic PRNG initialization function.
#define MCUXCLRSA_STATUS_OK
RSA operation was successful.
Definition mcuxClRsa_Types.h:54
mcuxClSession_Descriptor_t *const mcuxClSession_Handle_t
Type for mcuxClSession Handle.
Definition mcuxClSession_Types.h:113
#define MCUX_CSSL_FP_FUNCTION_CALL_BEGIN(...)
Call a flow protected function and check the protection token.
Definition mcuxCsslFlowProtection.h:581
#define MCUX_CSSL_FP_FUNCTION_CALLED(...)
Expectation of a called function.
Definition mcuxCsslFlowProtection.h:735
#define MCUX_CSSL_FP_FUNCTION_CALL_END(...)
End a function call section started by MCUX_CSSL_FP_FUNCTION_CALL_BEGIN.
Definition mcuxCsslFlowProtection.h:616
#define MCUXCLRANDOM_STATUS_OK
Random function returned successfully.
Definition mcuxClRandom_Constants.h:46
Structure type for Rsa plain key data.
Definition mcuxClRsa_KeyTypes.h:185
mcuxClRsa_KeyEntry_t modulus
Key entry for the modulus.
Definition mcuxClRsa_KeyTypes.h:186
uint8_t * pKeyEntryData
Pointer to buffer containing the key entry data in big-endian byte order.
Definition mcuxClRsa_Types.h:131
Structure for mcuxClSession Descriptor.
Definition mcuxClSession_Types.h:121