MCUX CLNS
MCUX Crypto Library Normal Secure
 
Loading...
Searching...
No Matches
mcuxClRsa_Cipher_Crypt_RSAES_PKCS1_v1_5_example.c File Reference

Example for the mcuxCRsa component. More...

#include <mcuxClSession.h>
#include <mcuxClKey.h>
#include <mcuxClRandom.h>
#include <mcuxClRandomModes.h>
#include <mcuxClRsa.h>
#include <mcuxClCipher.h>
#include <mcuxClBuffer.h>
#include <mcuxClCore_Examples.h>
#include <mcuxClCore_Macros.h>
#include <mcuxClExample_Session_Helper.h>
#include <mcuxClEls.h>
#include <mcuxClExample_ELS_Helper.h>

Macros

#define RSA_KEY_BIT_LENGTH
 The example uses a 2048-bit key.
 
#define RSA_KEY_BYTE_LENGTH
 Converting the key-bitlength to bytelength.
 
#define RSA_PUBLIC_EXP_BYTE_LENGTH
 The public exponent has a length of three bytes.
 
#define INPUT_MESSAGE_LENGTH
 Arbitrary size of the message to be encrypted/decrypted.
 
#define CPU_WA_BUFFER_SIZE
 
#define PKC_WA_BUFFER_SIZE
 

Functions

static const uint8_t modulus[RSA_KEY_BYTE_LENGTH__attribute__ ((aligned(4)))
 Example value for public RSA modulus N.
 
 MCUXCLEXAMPLE_FUNCTION (mcuxClRsa_Cipher_Crypt_RSAES_PKCS1_v1_5_example)
 

Variables

static const uint8_t plainData [INPUT_MESSAGE_LENGTH]
 Example plaintext to be encrypted.
 

Detailed Description

Example for the mcuxCRsa component.

Macro Definition Documentation

◆ RSA_KEY_BIT_LENGTH

#define RSA_KEY_BIT_LENGTH

The example uses a 2048-bit key.

◆ RSA_KEY_BYTE_LENGTH

#define RSA_KEY_BYTE_LENGTH

Converting the key-bitlength to bytelength.

◆ RSA_PUBLIC_EXP_BYTE_LENGTH

#define RSA_PUBLIC_EXP_BYTE_LENGTH

The public exponent has a length of three bytes.

◆ INPUT_MESSAGE_LENGTH

#define INPUT_MESSAGE_LENGTH

Arbitrary size of the message to be encrypted/decrypted.

Function Documentation

◆ __attribute__()

static const uint8_t modulus[RSA_KEY_BYTE_LENGTH] __attribute__ ( (aligned(4))  )
static

Example value for public RSA modulus N.

Example value for public RSA exponent e.

Example value for qInv.

Example value for exponent DQ.

Example value for exponent DP.

Example value for prime factor Q.

Example value for prime factor P.

◆ MCUXCLEXAMPLE_FUNCTION()

MCUXCLEXAMPLE_FUNCTION ( mcuxClRsa_Cipher_Crypt_RSAES_PKCS1_v1_5_example  )

Initialize ELS, Enable the ELS

Disable the ELS

Variable Documentation

◆ plainData

const uint8_t plainData[INPUT_MESSAGE_LENGTH]
static

Example plaintext to be encrypted.