MCUX CLNS
MCUX Crypto Library Normal Secure
 
Loading...
Searching...
No Matches
mcuxClKey_Functions.h
Go to the documentation of this file.
1/*--------------------------------------------------------------------------*/
2/* Copyright 2020-2024 NXP */
3/* */
4/* NXP Proprietary. This software is owned or controlled by NXP and may */
5/* only be used strictly in accordance with the applicable license terms. */
6/* By expressly accepting such terms or by downloading, installing, */
7/* activating and/or otherwise using the software, you are agreeing that */
8/* you have read, and that you agree to comply with and are bound by, such */
9/* license terms. If you do not agree to be bound by the applicable */
10/* license terms, then you may not retain, install, activate or otherwise */
11/* use the software. */
12/*--------------------------------------------------------------------------*/
13
20#ifndef MCUXCLKEY_FUNCTIONS_H_
21#define MCUXCLKEY_FUNCTIONS_H_
22
23#include <mcuxClConfig.h> // Exported features flags header
24#include <mcuxClSession.h>
25#include <mcuxClSession_Types.h>
26
27#include <mcuxClKey_Types.h>
28#ifdef MCUXCL_FEATURE_KEY_DERIVATION
29#include <mcuxClMac_Types.h>
30#endif /* MCUXCL_FEATURE_KEY_DERIVATION */
31
34#include <mcuxClEls.h>
35
36#ifdef __cplusplus
37extern "C" {
38#endif
39
40/**********************************************
41 * FUNCTIONS
42 **********************************************/
43
84 const uint8_t * pKeyData,
85 uint32_t keyDataLength
86);
87
100 mcuxClKey_Handle_t privKey,
101 mcuxClKey_Handle_t pubKey
102);
103
124 mcuxClSession_Handle_t pSession,
126 mcuxClKey_Protection_t protection,
127 uint8_t * pAuxData,
128 mcuxClKey_Handle_t parentKey
129);
130
149 mcuxClSession_Handle_t pSession,
151 uint32_t dstSlot
152);
153
172 mcuxClSession_Handle_t pSession,
174 uint32_t * dstData
175);
176
194 mcuxClSession_Handle_t pSession,
196);
197
198
199#ifdef MCUXCL_FEATURE_KEY_DERIVATION
219MCUX_CSSL_ANALYSIS_START_SUPPRESS_DECLARED_BUT_NEVER_DEFINED("Definition is provided assuming library is built properly")
220MCUX_CSSL_FP_FUNCTION_DECL(mcuxClKey_derivation)
222 mcuxClSession_Handle_t pSession,
223 mcuxClKey_Derivation_t derivationMode,
224 mcuxClKey_Handle_t derivationKey,
225 mcuxClKey_DerivationInput_t inputs[],
226 uint32_t numberOfInputs,
227 mcuxClKey_Handle_t derivedKey
228);
229MCUX_CSSL_ANALYSIS_STOP_SUPPRESS_DECLARED_BUT_NEVER_DEFINED()
230#endif /* MCUXCL_FEATURE_KEY_DERIVATION */
231
250 mcuxClEls_KeyProp_t * key_properties
251);
252
253#ifdef MCUXCL_FEATURE_KEY_GENERATION
281MCUX_CSSL_ANALYSIS_START_SUPPRESS_DECLARED_BUT_NEVER_DEFINED("Definition is provided assuming library is built properly")
282MCUX_CSSL_FP_FUNCTION_DECL(mcuxClKey_generate_keypair)
283MCUX_CSSL_FP_PROTECTED_TYPE(mcuxClKey_Status_t) mcuxClKey_generate_keypair(
284 mcuxClSession_Handle_t pSession,
285 mcuxClKey_Generation_t generation,
286 mcuxClKey_Handle_t privKey,
287 mcuxClKey_Handle_t pubKey
288); /* generate a fresh new key (pair) */
289MCUX_CSSL_ANALYSIS_STOP_SUPPRESS_DECLARED_BUT_NEVER_DEFINED()
290#endif /* MCUXCL_FEATURE_KEY_GENERATION */
291
292
293#ifdef MCUXCL_FEATURE_KEY_AGREEMENT
312MCUX_CSSL_ANALYSIS_START_SUPPRESS_DECLARED_BUT_NEVER_DEFINED("Definition is provided assuming library is built properly")
313MCUX_CSSL_FP_FUNCTION_DECL(mcuxClKey_agreement)
315 mcuxClSession_Handle_t pSession,
316 mcuxClKey_Agreement_t agreement,
318 mcuxClKey_Handle_t otherKey,
319 mcuxClKey_Agreement_AdditionalInput_t additionalInputs[],
320 uint32_t numberOfInputs,
321 uint8_t * pOut,
322 uint32_t * const pOutLength
323); /* determine a shared key on based on public and private inputs */
324MCUX_CSSL_ANALYSIS_STOP_SUPPRESS_DECLARED_BUT_NEVER_DEFINED()
325
326#ifdef MCUXCL_FEATURE_KEY_SELFTEST
327MCUX_CSSL_ANALYSIS_START_SUPPRESS_DECLARED_BUT_NEVER_DEFINED("Definition is provided assuming library is built properly")
328MCUX_CSSL_FP_FUNCTION_DECL(mcuxClKey_agreement_selftest)
329MCUX_CSSL_FP_PROTECTED_TYPE(mcuxClKey_Status_t) mcuxClKey_agreement_selftest(
331 mcuxClKey_Agreement_t agreement,
332 mcuxClKey_Test_t test
333);
334MCUX_CSSL_ANALYSIS_STOP_SUPPRESS_DECLARED_BUT_NEVER_DEFINED()
335#endif /* MCUXCL_FEATURE_KEY_SELFTEST */
336
337#endif /* MCUXCL_FEATURE_KEY_AGREEMENT */
338
339
340 /* mcuxClKey_Functions */
344
345#ifdef __cplusplus
346} /* extern "C" */
347#endif
348
349#endif /* MCUXCLKEY_FUNCTIONS_H_ */
Definition of function identifiers for the flow protection mechanism.
Top-level include file for the ELS driver.
Type definitions for the mcuxClKey component.
Type definitions for the mcuxClMac component.
Top-level include file for the mcuxClSession component.
Type definitions for the mcuxClSession component.
Provides the API for the CSSL flow protection mechanism.
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_Status_t mcuxClKey_loadCopro(mcuxClSession_Handle_t pSession, mcuxClKey_Handle_t key, uint32_t dstSlot)
Load key into destination key slot of a coprocessor.
mcuxClKey_Status_t mcuxClKey_setProtection(mcuxClSession_Handle_t pSession, mcuxClKey_Handle_t key, mcuxClKey_Protection_t protection, uint8_t *pAuxData, mcuxClKey_Handle_t parentKey)
Configures they protection mechanism for to the given key handle.
mcuxClKey_Status_t mcuxClKey_setKeyproperties(mcuxClKey_Handle_t key, mcuxClEls_KeyProp_t *key_properties)
Set the requested key properties of the destination key.
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.
mcuxClKey_Status_t mcuxClKey_loadMemory(mcuxClSession_Handle_t pSession, mcuxClKey_Handle_t key, uint32_t *dstData)
Load key into destination memory buffer.
void mcuxClKey_linkKeyPair(mcuxClSession_Handle_t pSession, mcuxClKey_Handle_t privKey, mcuxClKey_Handle_t pubKey)
Establishes a key pair link between a private and public key handle.
const mcuxClKey_TypeDescriptor_t * mcuxClKey_Type_t
Key type handle type.
Definition mcuxClKey_Types.h:111
uint32_t mcuxClKey_Status_t
Type for Key component error codes.
Definition mcuxClKey_Types.h:47
const mcuxClKey_ProtectionDescriptor_t * mcuxClKey_Protection_t
Key protection mechanism type.
Definition mcuxClKey_Types.h:141
const mcuxClKey_GenerationDescriptor_t *const mcuxClKey_Generation_t
Key generation type.
Definition mcuxClKey_Types.h:225
mcuxClKey_Descriptor_t *const mcuxClKey_Handle_t
Key handle type.
Definition mcuxClKey_Types.h:88
mcuxClSession_Descriptor_t *const mcuxClSession_Handle_t
Type for mcuxClSession Handle.
Definition mcuxClSession_Types.h:113
#define MCUX_CSSL_FP_FUNCTION_DECL(...)
Declaration of a flow protected function.
Definition mcuxCsslFlowProtection.h:125
#define MCUX_CSSL_FP_PROTECTED_TYPE(resultType)
Based on a given base type, builds a return type with flow protection.
Definition mcuxCsslFlowProtection.h:81
Type for ELS key store key properties.
Definition mcuxClEls_Types.h:226