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/* SPDX-License-Identifier: BSD-3-Clause */
5/* */
6/* Redistribution and use in source and binary forms, with or without */
7/* modification, are permitted provided that the following conditions are */
8/* met: */
9/* */
10/* 1. Redistributions of source code must retain the above copyright */
11/* notice, this list of conditions and the following disclaimer. */
12/* */
13/* 2. Redistributions in binary form must reproduce the above copyright */
14/* notice, this list of conditions and the following disclaimer in the */
15/* documentation and/or other materials provided with the distribution. */
16/* */
17/* 3. Neither the name of the copyright holder nor the names of its */
18/* contributors may be used to endorse or promote products derived from */
19/* this software without specific prior written permission. */
20/* */
21/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS */
22/* IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED */
23/* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A */
24/* PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */
25/* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */
26/* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED */
27/* TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR */
28/* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF */
29/* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING */
30/* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS */
31/* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
32/*--------------------------------------------------------------------------*/
33
39
40#ifndef MCUXCLKEY_FUNCTIONS_H_
41#define MCUXCLKEY_FUNCTIONS_H_
42
43#include <mcuxClConfig.h> // Exported features flags header
44#include <mcuxClSession.h>
45#include <mcuxClSession_Types.h>
46
47#include <mcuxClKey_Types.h>
48#ifdef MCUXCL_FEATURE_KEY_DERIVATION
49#include <mcuxClMac_Types.h>
50#endif /* MCUXCL_FEATURE_KEY_DERIVATION */
51
54#include <mcuxClEls.h>
55
56#ifdef __cplusplus
57extern "C" {
58#endif
59
60/**********************************************
61 * FUNCTIONS
62 **********************************************/
63
70
96 const uint8_t * pKeyData,
97 uint32_t keyDataLength
98);
99
111 mcuxClSession_Handle_t pSession,
112 mcuxClKey_Handle_t privKey,
113 mcuxClKey_Handle_t pubKey
114);
115
136 mcuxClSession_Handle_t pSession,
138 mcuxClKey_Protection_t protection,
139 uint8_t * pAuxData,
140 mcuxClKey_Handle_t parentKey
141);
142
161 mcuxClSession_Handle_t pSession,
163 uint32_t dstSlot
164);
165
184 mcuxClSession_Handle_t pSession,
186 uint32_t * dstData
187);
188
206 mcuxClSession_Handle_t pSession,
208);
209
210
211#ifdef MCUXCL_FEATURE_KEY_DERIVATION
231MCUX_CSSL_ANALYSIS_START_SUPPRESS_DECLARED_BUT_NEVER_DEFINED("Definition is provided assuming library is built properly")
232MCUX_CSSL_FP_FUNCTION_DECL(mcuxClKey_derivation)
234 mcuxClSession_Handle_t pSession,
235 mcuxClKey_Derivation_t derivationMode,
236 mcuxClKey_Handle_t derivationKey,
237 mcuxClKey_DerivationInput_t inputs[],
238 uint32_t numberOfInputs,
239 mcuxClKey_Handle_t derivedKey
240);
241MCUX_CSSL_ANALYSIS_STOP_SUPPRESS_DECLARED_BUT_NEVER_DEFINED()
242#endif /* MCUXCL_FEATURE_KEY_DERIVATION */
243
262 mcuxClEls_KeyProp_t * key_properties
263);
264
265#ifdef MCUXCL_FEATURE_KEY_GENERATION
293MCUX_CSSL_ANALYSIS_START_SUPPRESS_DECLARED_BUT_NEVER_DEFINED("Definition is provided assuming library is built properly")
294MCUX_CSSL_FP_FUNCTION_DECL(mcuxClKey_generate_keypair)
295MCUX_CSSL_FP_PROTECTED_TYPE(mcuxClKey_Status_t) mcuxClKey_generate_keypair(
296 mcuxClSession_Handle_t pSession,
297 mcuxClKey_Generation_t generation,
298 mcuxClKey_Handle_t privKey,
299 mcuxClKey_Handle_t pubKey
300); /* generate a fresh new key (pair) */
301MCUX_CSSL_ANALYSIS_STOP_SUPPRESS_DECLARED_BUT_NEVER_DEFINED()
302#endif /* MCUXCL_FEATURE_KEY_GENERATION */
303
304
305#ifdef MCUXCL_FEATURE_KEY_AGREEMENT
324MCUX_CSSL_ANALYSIS_START_SUPPRESS_DECLARED_BUT_NEVER_DEFINED("Definition is provided assuming library is built properly")
325MCUX_CSSL_FP_FUNCTION_DECL(mcuxClKey_agreement)
327 mcuxClSession_Handle_t pSession,
328 mcuxClKey_Agreement_t agreement,
330 mcuxClKey_Handle_t otherKey,
331 mcuxClKey_Agreement_AdditionalInput_t additionalInputs[],
332 uint32_t numberOfInputs,
333 uint8_t * pOut,
334 uint32_t * const pOutLength
335); /* determine a shared key on based on public and private inputs */
336MCUX_CSSL_ANALYSIS_STOP_SUPPRESS_DECLARED_BUT_NEVER_DEFINED()
337
338#ifdef MCUXCL_FEATURE_KEY_SELFTEST
339MCUX_CSSL_ANALYSIS_START_SUPPRESS_DECLARED_BUT_NEVER_DEFINED("Definition is provided assuming library is built properly")
340MCUX_CSSL_FP_FUNCTION_DECL(mcuxClKey_agreement_selftest)
341MCUX_CSSL_FP_PROTECTED_TYPE(mcuxClKey_Status_t) mcuxClKey_agreement_selftest(
343 mcuxClKey_Agreement_t agreement,
344 mcuxClKey_Test_t test
345);
346MCUX_CSSL_ANALYSIS_STOP_SUPPRESS_DECLARED_BUT_NEVER_DEFINED()
347#endif /* MCUXCL_FEATURE_KEY_SELFTEST */
348
349#endif /* MCUXCL_FEATURE_KEY_AGREEMENT */
350
351
352 /* mcuxClKey_Functions */
356
357#ifdef __cplusplus
358} /* extern "C" */
359#endif
360
361#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:131
uint32_t mcuxClKey_Status_t
Type for Key component error codes.
Definition mcuxClKey_Types.h:67
const mcuxClKey_ProtectionDescriptor_t * mcuxClKey_Protection_t
Key protection mechanism type.
Definition mcuxClKey_Types.h:161
const mcuxClKey_GenerationDescriptor_t *const mcuxClKey_Generation_t
Key generation type.
Definition mcuxClKey_Types.h:245
mcuxClKey_Descriptor_t *const mcuxClKey_Handle_t
Key handle type.
Definition mcuxClKey_Types.h:108
mcuxClSession_Descriptor_t *const mcuxClSession_Handle_t
Type for mcuxClSession Handle.
Definition mcuxClSession_Types.h:133
#define MCUX_CSSL_FP_FUNCTION_DECL(...)
Declaration of a flow protected function.
Definition mcuxCsslFlowProtection.h:145
#define MCUX_CSSL_FP_PROTECTED_TYPE(resultType)
Based on a given base type, builds a return type with flow protection.
Definition mcuxCsslFlowProtection.h:101
Type for ELS key store key properties.
Definition mcuxClEls_Types.h:246