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-2026 NXP */
3/* */
4/* NXP Confidential and Proprietary. This software is owned or controlled */
5/* by NXP and may only be used strictly in accordance with the applicable */
6/* license terms. By expressly accepting such terms or by downloading, */
7/* installing, activating and/or otherwise using the software, you are */
8/* agreeing that you have read, and that you agree to comply with and are */
9/* bound by, such license terms. If you do not agree to be bound by the */
10/* applicable license terms, then you may not retain, install, activate or */
11/* otherwise use the software. */
12/*--------------------------------------------------------------------------*/
13
19
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
31
32#ifdef __cplusplus
33extern "C" {
34#endif
35
36/**********************************************
37 * FUNCTIONS
38 **********************************************/
39
46
74 const uint8_t * pKeyData,
75 uint32_t keyDataLength
76);
77
78
91 mcuxClKey_Handle_t privKey,
93);
94
120 mcuxClKey_Encoding_t encoding,
121 const uint8_t * pAuxData,
122 uint32_t auxDataLength
123);
124
135/* To delete a key again from the key slot, call @ref mcuxClKey_flush.
136 */
137/* @attention In case the key is already loaded to a key slot that differs from the @p slot,
138 * the previous slot will be flushed before loading the key to the given new slot.
139 *
140 * @if (MCUXCL_FEATURE_CSSL_FP_USE_SECURE_COUNTER && MCUXCL_FEATURE_CSSL_SC_USE_SW_LOCAL)
141 * @return A code-flow protected error code (see @ref mcuxCsslFlowProtection). The error code can be any error code in @ref MCUXCLKEY_STATUS_, see individual documentation for more information
142 * @else
143 * @return An error code that can be any error code in @ref MCUXCLKEY_STATUS_, see individual documentation for more information
144 * @endif
145 *
146 * @retval #MCUXCLKEY_STATUS_OK on successful operation
147 * @retval #MCUXCLKEY_STATUS_INVALID_INPUT if the given loadOptions do not fit the key type
148 * @retval #MCUXCLKEY_STATUS_FAULT_ATTACK if a fault attack was detected
149 */
160 uint32_t loadOptions
161);
162
182);
183
184
215 mcuxClKey_Generation_t generation,
216 mcuxClKey_Handle_t privKey,
217 mcuxClKey_Handle_t pubKey
218); /* generate a fresh new key (pair) */
219
241 mcuxClKey_Agreement_t agreement,
243 mcuxClKey_Handle_t otherKey,
244 mcuxClKey_Agreement_AdditionalInput_t additionalInputs[],
245 uint32_t numberOfInputs,
246 uint8_t * pOut,
247 uint32_t * const pOutLength
248); /* determine a shared key on based on public and private inputs */
249
250
277 mcuxClKey_Encoding_t encoding,
278 mcuxClKey_Handle_t encodedKey,
279 mcuxClKey_Type_t type,
280 const uint8_t * pPlainKeyData,
281 uint32_t plainKeyDataLength,
282 const uint8_t * pAuxData,
283 uint32_t auxDataLength,
284 uint8_t * pEncodedKeyData,
285 uint32_t * const pEncodedKeyDataLength
286);
287
317 mcuxClKey_Handle_t encodedKey,
318 mcuxClKey_Encoding_t encoding,
319 mcuxClKey_Handle_t recodedKey,
320 const uint8_t * pAuxData,
321 uint32_t auxDataLength,
322 uint8_t * pEncodedKeyData,
323 uint32_t * const pEncodedKeyDataLength
324);
325
342 mcuxClKey_Validation_t validation,
344);
345 /* mcuxClKey_Functions */
349
350#ifdef __cplusplus
351} /* extern "C" */
352#endif
353
354#endif /* MCUXCLKEY_FUNCTIONS_H_ */
Definition of function identifiers for the flow protection mechanism.
Type definitions for the mcuxClKey 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_recode(mcuxClSession_Handle_t session, mcuxClKey_Handle_t encodedKey, mcuxClKey_Encoding_t encoding, mcuxClKey_Handle_t recodedKey, const uint8_t *pAuxData, uint32_t auxDataLength, uint8_t *pEncodedKeyData, uint32_t *const pEncodedKeyDataLength)
Key recoding (re-encoding) function to apply a new encoding to key material.
void mcuxClKey_linkKeyPair(mcuxClSession_Handle_t session, mcuxClKey_Handle_t privKey, mcuxClKey_Handle_t pubKey)
Establishes a key pair link between a private and public key handle.
mcuxClKey_Status_t mcuxClKey_init(mcuxClSession_Handle_t session, mcuxClKey_Handle_t key, mcuxClKey_Type_t type, const uint8_t *pKeyData, uint32_t keyDataLength)
Initializes a key handle.
mcuxClKey_Status_t mcuxClKey_flush(mcuxClSession_Handle_t session, 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 session, mcuxClKey_Handle_t key, uint32_t loadOptions)
Load key into destination key slot of a coprocessor.
mcuxClKey_Status_t mcuxClKey_validate(mcuxClSession_Handle_t session, mcuxClKey_Validation_t validation, mcuxClKey_Handle_t key)
Key validation function.
mcuxClKey_Status_t mcuxClKey_setEncoding(mcuxClSession_Handle_t session, mcuxClKey_Handle_t key, mcuxClKey_Encoding_t encoding, const uint8_t *pAuxData, uint32_t auxDataLength)
Configures the encoding mechanism for the given key handle.
mcuxClKey_Status_t mcuxClKey_generate_keypair(mcuxClSession_Handle_t session, mcuxClKey_Generation_t generation, mcuxClKey_Handle_t privKey, mcuxClKey_Handle_t pubKey)
Key-pair generation function.
mcuxClKey_Status_t mcuxClKey_encode(mcuxClSession_Handle_t session, mcuxClKey_Encoding_t encoding, mcuxClKey_Handle_t encodedKey, mcuxClKey_Type_t type, const uint8_t *pPlainKeyData, uint32_t plainKeyDataLength, const uint8_t *pAuxData, uint32_t auxDataLength, uint8_t *pEncodedKeyData, uint32_t *const pEncodedKeyDataLength)
Key descriptor initialization function including applying a encoding mechanism.
mcuxClKey_Status_t mcuxClKey_agreement(mcuxClSession_Handle_t session, mcuxClKey_Agreement_t agreement, mcuxClKey_Handle_t key, mcuxClKey_Handle_t otherKey, mcuxClKey_Agreement_AdditionalInput_t additionalInputs[], uint32_t numberOfInputs, uint8_t *pOut, uint32_t *const pOutLength)
Key agreement function.
const mcuxClKey_ValidationDescriptor_t *const mcuxClKey_Validation_t
Generic key validation type.
Definition mcuxClKey_Types.h:217
const mcuxClKey_EncodingDescriptor_t * mcuxClKey_Encoding_t
Key encoding mechanism type.
Definition mcuxClKey_Types.h:144
const mcuxClKey_TypeDescriptor_t * mcuxClKey_Type_t
Key type handle type.
Definition mcuxClKey_Types.h:114
uint32_t mcuxClKey_Status_t
Type for Key component error codes.
Definition mcuxClKey_Types.h:45
const mcuxClKey_GenerationDescriptor_t *const mcuxClKey_Generation_t
Key generation type.
Definition mcuxClKey_Types.h:201
const mcuxClKey_AgreementDescriptor_t *const mcuxClKey_Agreement_t
Key agreement type.
Definition mcuxClKey_Types.h:177
mcuxClKey_Descriptor_t *const mcuxClKey_Handle_t
Key handle type.
Definition mcuxClKey_Types.h:91
mcuxClSession_Descriptor_t *const mcuxClSession_Handle_t
Type for mcuxClSession Handle.
Definition mcuxClSession_Types.h:98
#define MCUX_CSSL_FP_FUNCTION_DECL(...)
Declaration of a flow protected function.
Definition mcuxCsslFlowProtection.h:166
#define MCUX_CSSL_FP_PROTECTED_TYPE(resultType)
Based on a given base type, builds a return type with flow protection.
Definition mcuxCsslFlowProtection.h:138