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-2023 NXP */
3/* */
4/* NXP Confidential. 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 license */
10/* terms, then you may not retain, install, activate or otherwise use the */
11/* 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
106 mcuxClSession_Handle_t pSession,
107 mcuxClKey_Handle_t privKey,
108 mcuxClKey_Handle_t pubKey
109);
110
131 mcuxClSession_Handle_t pSession,
133 mcuxClKey_Protection_t protection,
134 uint8_t * pAuxData,
135 mcuxClKey_Handle_t parentKey
136);
137
156 mcuxClSession_Handle_t pSession,
158 uint32_t dstSlot
159);
160
179 mcuxClSession_Handle_t pSession,
181 uint32_t * dstData
182);
183
201 mcuxClSession_Handle_t pSession,
203);
204
205
206#ifdef MCUXCL_FEATURE_KEY_DERIVATION
226MCUX_CSSL_FP_FUNCTION_DECL(mcuxClKey_derivation)
228 mcuxClSession_Handle_t pSession,
229 mcuxClKey_Derivation_t derivationMode,
230 mcuxClKey_Handle_t derivationKey,
231 mcuxClKey_DerivationInput_t inputs[],
232 uint32_t numberOfInputs,
233 mcuxClKey_Handle_t derivedKey
234);
235#endif /* MCUXCL_FEATURE_KEY_DERIVATION */
236
255 mcuxClEls_KeyProp_t * key_properties
256);
257
258#ifdef MCUXCL_FEATURE_KEY_GENERATION
286MCUX_CSSL_FP_FUNCTION_DECL(mcuxClKey_generate_keypair)
287MCUX_CSSL_FP_PROTECTED_TYPE(mcuxClKey_Status_t) mcuxClKey_generate_keypair(
288 mcuxClSession_Handle_t pSession,
289 mcuxClKey_Generation_t generation,
290 mcuxClKey_Handle_t privKey,
291 mcuxClKey_Handle_t pubKey
292); /* generate a fresh new key (pair) */
293#endif /* MCUXCL_FEATURE_KEY_GENERATION */
294
295
296#ifdef MCUXCL_FEATURE_KEY_AGREEMENT
315MCUX_CSSL_FP_FUNCTION_DECL(mcuxClKey_agreement)
317 mcuxClSession_Handle_t pSession,
318 mcuxClKey_Agreement_t agreement,
320 mcuxClKey_Handle_t otherKey,
321 mcuxClKey_Agreement_AdditionalInput_t additionalInputs[],
322 uint32_t numberOfInputs,
323 uint8_t * pOut,
324 uint32_t * const pOutLength
325); /* determine a shared key on based on public and private inputs */
326
327#ifdef MCUXCL_FEATURE_KEY_SELFTEST
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);
334#endif /* MCUXCL_FEATURE_KEY_SELFTEST */
335
336#endif /* MCUXCL_FEATURE_KEY_AGREEMENT */
337
338
339 /* mcuxClKey_Functions */
343
344#ifdef __cplusplus
345} /* extern "C" */
346#endif
347
348#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.
mcuxClKey_Status_t 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