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

Example of using function mcuxClRsa_verify to perform the RSA signature verification with EMSA-PSS-VERIFY padding scheme according to PKCS #1 v2.2. More...

#include <mcuxClToolchain.h>
#include <mcuxClSession.h>
#include <mcuxClExample_Session_Helper.h>
#include <mcuxCsslFlowProtection.h>
#include <mcuxClCore_FunctionIdentifiers.h>
#include <mcuxClRandom.h>
#include <mcuxClBuffer.h>
#include <mcuxClRsa.h>
#include <mcuxClCore_Examples.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 RSA_MESSAGE_DIGEST_LENGTH
 The example uses a Sha2-256 digest, which is 32 bytes long.
 
#define RSA_PSS_SALT_LENGTH
 The salt for the PSS padding is 32 bytes long.
 

Functions

 MCUXCLEXAMPLE_FUNCTION (mcuxClRsa_verify_pssverify_sha2_256_example)
 Performs a session set-up; a call to function mcuxClRsa_verify using mode mcuxClRsa_Mode_Verify_Pss_Sha2_256; a session clean-up.
 

Variables

static const ALIGNED uint8_t modulus [RSA_KEY_BYTE_LENGTH]
 Example value for public RSA modulus N.
 
static const ALIGNED uint8_t exponent [RSA_PUBLIC_EXP_BYTE_LENGTH]
 Example value for public RSA exponent e.
 
static const ALIGNED uint8_t message [RSA_MESSAGE_DIGEST_LENGTH]
 Example value for Sha2-256 message digest.
 
static const ALIGNED uint8_t signature [RSA_KEY_BYTE_LENGTH]
 Example value for RSA signature s.
 

Detailed Description

Example of using function mcuxClRsa_verify to perform the RSA signature verification with EMSA-PSS-VERIFY padding scheme according to PKCS #1 v2.2.

Macro Definition Documentation

◆ RSA_KEY_BIT_LENGTH

#define RSA_KEY_BIT_LENGTH

The example uses a 2048-bit key.

◆ RSA_KEY_BYTE_LENGTH

◆ RSA_PUBLIC_EXP_BYTE_LENGTH

#define RSA_PUBLIC_EXP_BYTE_LENGTH

The public exponent has a length of three bytes.

Examples
mcuxClRsa_verify_pssverify_sha2_256_example.c.

◆ RSA_MESSAGE_DIGEST_LENGTH

#define RSA_MESSAGE_DIGEST_LENGTH

The example uses a Sha2-256 digest, which is 32 bytes long.

Examples
mcuxClRsa_sign_pss_sha2_256_example.c, and mcuxClRsa_verify_pssverify_sha2_256_example.c.

◆ RSA_PSS_SALT_LENGTH

#define RSA_PSS_SALT_LENGTH

The salt for the PSS padding is 32 bytes long.

Examples
mcuxClRsa_sign_pss_sha2_256_example.c, and mcuxClRsa_verify_pssverify_sha2_256_example.c.

Function Documentation

◆ MCUXCLEXAMPLE_FUNCTION()

MCUXCLEXAMPLE_FUNCTION ( mcuxClRsa_verify_pssverify_sha2_256_example  )

Performs a session set-up; a call to function mcuxClRsa_verify using mode mcuxClRsa_Mode_Verify_Pss_Sha2_256; a session clean-up.

Return values
MCUXCLEXAMPLE_STATUS_OKThe example code completed successfully
MCUXCLEXAMPLE_STATUS_ERRORThe example code failed

Initialize ELS, Enable the ELS

Destroy Session and cleanup Session

Disable the ELS

Variable Documentation

◆ modulus

◆ exponent

◆ message

◆ signature