Example for the mcuxClKey component.
#include <mcuxClCore_Examples.h>
#include <stdbool.h>
#include <mcuxClExample_Session_Helper.h>
#include <mcuxClExample_Key_Helper.h>
{
0xb97d0b7cu, 0xd0101f81u, 0x7a6c470eu, 0xe0f6920du
};
MCUXCLEXAMPLE_FUNCTION(mcuxClKey_example)
{
MCUXCLEXAMPLE_ALLOCATE_AND_INITIALIZE_SESSION(&session, 0u, 0u);
uint32_t keyDesc[MCUXCLKEY_DESCRIPTOR_SIZE_IN_WORDS];
if(!mcuxClExample_Key_Init_And_Load(&session,
key,
&key_properties,
key_buffer, MCUXCLEXAMPLE_CONST_EXTERNAL_KEY))
{
return MCUXCLEXAMPLE_STATUS_ERROR;
}
&session,
key));
{
return MCUXCLEXAMPLE_STATUS_ERROR;
}
if(!mcuxClExample_Session_Clean(&session))
{
return MCUXCLEXAMPLE_STATUS_ERROR;
}
return MCUXCLEXAMPLE_STATUS_OK;
}
static uint32_t const aes128_key[MCUXCLELS_CIPHER_KEY_SIZE_AES_128/sizeof(uint32_t)]
Key for the AES encryption.
Definition mcuxClEls_Cipher_Aes128_Ecb_Encrypt_example.c:42
Top-level interface header for the mcuxClAes component.
Definition of function identifiers for the flow protection mechanism.
Top-level include file for the mcuxClKey component.
Top-level include file for the mcuxClSession component.
Provides the API for the CSSL flow protection mechanism.
#define MCUXCLAES_AES128_KEY_SIZE_IN_WORDS
AES-128 key size in words.
Definition mcuxClAes_Constants.h:42
static const mcuxClKey_Type_t mcuxClKey_Type_Aes128
Key type pointer for AES-128 based keys.
Definition mcuxClAes_KeyTypes.h:50
#define MCUXCLELS_KEYPROPERTY_KEY_SIZE_128
This value of mcuxClEls_KeyProp_t.ksize indicates a 128 bit key.
Definition mcuxClEls_Types.h:101
#define MCUXCLELS_KEYPROPERTY_ACTIVE_TRUE
This value of mcuxClEls_KeyProp_t.kactv indicates that the slot contains an active key.
Definition mcuxClEls_Types.h:106
#define MCUXCLKEY_STATUS_OK
Key operation successful.
Definition mcuxClKey_Constants.h:39
mcuxClKey_Status_t mcuxClKey_flush(mcuxClSession_Handle_t pSession, mcuxClKey_Handle_t key)
Flush key from destination which can be a key slot of coprocessor or memory buffer.
mcuxClKey_Descriptor_t *const mcuxClKey_Handle_t
Key handle type.
Definition mcuxClKey_Types.h:88
#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
Type for ELS key store key properties.
Definition mcuxClEls_Types.h:226
uint32_t ksize
Key size.
Definition mcuxClEls_Types.h:237
struct mcuxClEls_KeyProp_t::@41 bits
Access mcuxClEls_KeyProp_t bit-wise.
uint32_t kactv
Status flag to indicate whether the key slot contains an active key or not.
Definition mcuxClEls_Types.h:240
struct mcuxClEls_KeyProp_t::@40 word
Access mcuxClEls_KeyProp_t word-wise.
uint32_t value
Accesses the bit field as a full word; initialize with a combination of constants from MCUXCLELS_KEYP...
Definition mcuxClEls_Types.h:229
Structure for mcuxClSession Descriptor.
Definition mcuxClSession_Types.h:121