MCUX CLNS
MCUX Crypto Library Normal Secure
 
Loading...
Searching...
No Matches
mcuxClExample_ELS_Key_Helper.h
1/*--------------------------------------------------------------------------*/
2/* Copyright 2022 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
14#ifndef MCUXCLEXAMPLE_ELS_KEY_HELPER_H_
15#define MCUXCLEXAMPLE_ELS_KEY_HELPER_H_
16
17#include <mcuxClConfig.h> // Exported features flags header
18#include <mcuxClCore_Platform.h>
19#include <mcuxClEls.h>
20#include <mcuxClExample_RFC3394_Helper.h>
23
28static inline bool mcuxClExample_Els_KeyDelete(mcuxClEls_KeyIndex_t keyIdx)
29{
31 // mcuxClEls_KeyDelete_Async is a flow-protected function: Check the protection token and the return value
33 {
34 return false; // Expect that no error occurred, meaning that the mcuxClEls_KeyDelete_Async operation was started.
35 }
37
38 MCUX_CSSL_FP_FUNCTION_CALL_BEGIN(result, token, mcuxClEls_WaitForOperation(MCUXCLELS_ERROR_FLAGS_CLEAR)); // Wait for the mcuxClEls_KeyDelete_Async operation to complete.
39 // mcuxClEls_WaitForOperation is a flow-protected function: Check the protection token and the return value
41 {
42 return false;
43 }
45 return true;
46}
47
51static inline bool mcuxClExample_Els_KeyDeleteAll(void)
52{
54 // mcuxClEls_Reset_Async is a flow-protected function: Check the protection token and the return value
56 {
57 return false;
58 }
60
61 MCUX_CSSL_FP_FUNCTION_CALL_BEGIN(result, token, mcuxClEls_WaitForOperation(MCUXCLELS_ERROR_FLAGS_CLEAR)); // Wait for the mcuxClEls_Reset_Async operation to complete.
62 // mcuxClEls_WaitForOperation is a flow-protected function: Check the protection token and the return value
64 {
65 return false;
66 }
68 return true;
69}
70
71
72#endif /* MCUXCLEXAMPLE_ELS_KEY_HELPER_H_ */
Definition of function identifiers for the flow protection mechanism.
Top-level include file for the ELS driver.
Provides the API for the CSSL flow protection mechanism.
#define MCUXCLELS_ERROR_FLAGS_CLEAR
Set this option at mcuxClEls_ErrorHandling_t to clear all ELS error flags.
Definition mcuxClEls_Common.h:110
MCUXCLELS_API mcuxClEls_Status_t mcuxClEls_Reset_Async(mcuxClEls_ResetOption_t options)
Perform a synchronous reset of the ELS.
MCUXCLELS_API mcuxClEls_Status_t mcuxClEls_WaitForOperation(mcuxClEls_ErrorHandling_t errorHandling)
Wait for an ELS operation and optionally clear the error status.
MCUXCLELS_API mcuxClEls_Status_t mcuxClEls_KeyDelete_Async(mcuxClEls_KeyIndex_t keyIdx)
Deletes a key from keystore at the given index.
#define MCUXCLELS_STATUS_OK
No error occurred.
Definition mcuxClEls_Types.h:171
#define MCUXCLELS_STATUS_OK_WAIT
An _Async function successfully started an ELS command. Call mcuxClEls_WaitForOperation to complete i...
Definition mcuxClEls_Types.h:172
uint32_t mcuxClEls_KeyIndex_t
Type for ELS keystore indices.
Definition mcuxClEls_Types.h:222
#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