MCUX CLNS
MCUX Crypto Library Normal Secure
 
Loading...
Searching...
No Matches
Looping flow protection

Support for flow protected loops. More...

Macros

#define MCUX_CSSL_FP_LOOP_DECL(id)
 Declaration of a flow protected loop.
 
#define MCUX_CSSL_FP_LOOP_ITERATION(...)
 Perform a loop iteration.
 
#define MCUX_CSSL_FP_LOOP_ITERATIONS(id, count)
 Expected number of loop iterations.
 

Detailed Description

Support for flow protected loops.

Declaration
MCUX_CSSL_FP_LOOP_DECL
Event
MCUX_CSSL_FP_LOOP_ITERATION
Expectation
MCUX_CSSL_FP_LOOP_ITERATIONS

Macro Definition Documentation

◆ MCUX_CSSL_FP_LOOP_DECL

#define MCUX_CSSL_FP_LOOP_DECL (   id)

Declaration of a flow protected loop.

To inform the flow protection mechanism about a loop that needs to be protected, a loop identifier needs to be declared. This identifier can then be used in the event and expectation macros. For example:

MCUX_CSSL_FP_LOOP_DECL(someLoopIdentifier);
for (uint32_t i = 0; i < 8; ++i)
{
MCUX_CSSL_FP_LOOP_ITERATION(someLoopIdentifier);
}
// ...
MCUX_CSSL_FP_LOOP_ITERATIONS(someLoopIdentifier, 8)
);
#define MCUX_CSSL_FP_FUNCTION_EXIT(...)
Flow protection handler for the function exit point.
Definition mcuxCsslFlowProtection.h:286
#define MCUX_CSSL_FP_LOOP_DECL(id)
Declaration of a flow protected loop.
Definition mcuxCsslFlowProtection.h:810
#define MCUX_CSSL_FP_LOOP_ITERATIONS(id, count)
Expected number of loop iterations.
Definition mcuxCsslFlowProtection.h:873
#define MCUX_CSSL_FP_LOOP_ITERATION(...)
Perform a loop iteration.
Definition mcuxCsslFlowProtection.h:838
Event
MCUX_CSSL_FP_LOOP_ITERATION
Expectation
MCUX_CSSL_FP_LOOP_ITERATIONS
Parameters
idIdentifier for the loop that is flow protected.

◆ MCUX_CSSL_FP_LOOP_ITERATION

#define MCUX_CSSL_FP_LOOP_ITERATION (   ...)

Perform a loop iteration.

This loop iteration macro informs the flow mechanism that an iteration event is performed for the loop declared by MCUX_CSSL_FP_LOOP_DECL with the given id. For example:

MCUX_CSSL_FP_LOOP_DECL(someLoopIdentifier);
for (uint32_t i = 0; i < 8; ++i)
{
MCUX_CSSL_FP_LOOP_ITERATION(someLoopIdentifier);
}
Declaration
MCUX_CSSL_FP_LOOP_DECL
Expectation
MCUX_CSSL_FP_LOOP_ITERATIONS
Parameters
...The following parameters need to be passed (comma separated):
  • id: Identifier for the loop that is flow protected.
  • expect: Zero or more (comma separated) declarations of expected code flow behavior related to this event.

◆ MCUX_CSSL_FP_LOOP_ITERATIONS

#define MCUX_CSSL_FP_LOOP_ITERATIONS (   id,
  count 
)

Expected number of loop iterations.

This expectation macro indicates to the flow protection mechanism that the loop declared by MCUX_CSSL_FP_LOOP_DECL with the given id has made count iterations. For example:

MCUX_CSSL_FP_LOOP_DECL(someLoopIdentifier);
for (uint32_t i = 0; i < 8; ++i)
{
MCUX_CSSL_FP_LOOP_ITERATION(someLoopIdentifier);
}
// ...
MCUX_CSSL_FP_LOOP_ITERATIONS(someLoopIdentifier, 8)
);
Declaration
MCUX_CSSL_FP_LOOP_DECL
Event
MCUX_CSSL_FP_LOOP_ITERATION
See also
MCUX_CSSL_FP_FUNCTION_ENTRY
MCUX_CSSL_FP_FUNCTION_EXIT
MCUX_CSSL_FP_FUNCTION_EXIT_WITH_CHECK
MCUX_CSSL_FP_EXPECT
Parameters
idIdentifier of the flow protected loop.
countNumber of expected iterations.