MCUX CLNS
MCUX Crypto Library Normal Secure
mcuxClPsaDriver_keygen_export_public_key_oracle_example.c File Reference

Example for generating and exporting internal key. More...

#include "common.h"
#include <mcuxClEls.h>
#include <mcuxClSession.h>
#include <mcuxClKey.h>
#include <mcuxCsslFlowProtection.h>
#include <mcuxClToolchain.h>
#include <stdbool.h>
#include <mcuxClPsaDriver.h>
#include <mcuxClCore_Examples.h>

Macros

#define LIFETIME_INTERNAL
 
#define LIFETIME_EXTERNAL
 

Functions

static const uint8_t expectKeyRet [MCUXCLELS_ECC_PUBLICKEY_SIZE__attribute__ ((aligned(4)))
 
static bool load_key_udf (mcuxClEls_KeyIndex_t targetKeyIdx, mcuxClEls_KeyProp_t targetKeyProperties, uint8_t *pOutKey)
 Internal function that loads a known key into the ELS key store via mcuxClEls_KeyProvision_Async. More...
 
static bool rfc3394_wrap (const uint8_t *pInput, size_t inputLength, mcuxClEls_KeyIndex_t keyIdx, uint8_t *pOutput, mcuxClEls_KeyProp_t properties)
 Internal function that performs RFC3394 key wrapping. More...
 
bool mcuxClPsaDriver_keygen_export_public_key_oracle_example (void)
 

Detailed Description

Example for generating and exporting internal key.

Function Documentation

◆ load_key_udf()

static bool load_key_udf ( mcuxClEls_KeyIndex_t  targetKeyIdx,
mcuxClEls_KeyProp_t  targetKeyProperties,
uint8_t *  pOutKey 
)
static

Internal function that loads a known key into the ELS key store via mcuxClEls_KeyProvision_Async.

Parameters
targetKeyIdxThe key index at which the key shall be loaded
targetKeyPropertiesThe target properties of the key
pOutKeyPointer to a memory location which receives the key which was loaded
Examples
mcuxClPsaDriver_keygen_export_public_key_oracle_example.c.

◆ rfc3394_wrap()

static bool rfc3394_wrap ( const uint8_t *  pInput,
size_t  inputLength,
mcuxClEls_KeyIndex_t  keyIdx,
uint8_t *  pOutput,
mcuxClEls_KeyProp_t  properties 
)
static

Internal function that performs RFC3394 key wrapping.

Return values
trueWrapping successful.
falseWrapping error.
Examples
mcuxClPsaDriver_keygen_export_public_key_oracle_example.c.