MCUX CLNS
MCUX Crypto Library Normal Secure
Loading...
Searching...
No Matches

Support for flow protected functions. More...

Macros

#define MCUX_CSSL_FP_PROTECTED_TYPE_IMPL(resultType)
 Based on a given base type, builds a return type with flow protection.
#define MCUX_CSSL_FP_FUNCTION_DECL_IMPL(...)
 Declaration implementation of a flow protected function.
#define MCUX_CSSL_FP_FUNCTION_DEF_IMPL(...)
 Definition implementation of a flow protected function.
#define MCUX_CSSL_FP_FUNCTION_POINTER_IMPL(type, definition)
 Definition implementation of a flow protected function pointer.
#define MCUX_CSSL_FP_FUNCTION_ENTRY_IMPL(...)
 Flow protection handler implementation for the function entry point.
#define MCUX_CSSL_FP_RESULT_IMPL2(type, return)
 Extract the result value from a protected return value.
#define MCUX_CSSL_FP_RESULT_IMPL1(return)
 Extract the result value from a protected return value.
#define MCUX_CSSL_FP_RESULT_IMPL(...)
 Extract the result value from a protected return value.
#define MCUX_CSSL_FP_PROTECTION_TOKEN_IMPL(return)
 Extract the protection token value from a protected return value.
#define MCUX_CSSL_FP_FUNCTION_EXIT_IMPLn(id, result, ...)
 Flow protection handler implementation for the function exit point.
#define MCUX_CSSL_FP_FUNCTION_EXIT_IMPL1(id)
 Flow protection handler implementation for the function exit point.
#define MCUX_CSSL_FP_FUNCTION_EXIT_IMPL2(id, result)
 Flow protection handler implementation for the function exit point.
#define MCUX_CSSL_FP_FUNCTION_EXIT_IMPL(...)
 Flow protection handler implementation for the function exit point.
#define MCUX_CSSL_FP_FUNCTION_EXIT_WITH_CHECK_IMPL(id, pass, fail, ...)
 Flow protection handler implementation for the function exit point which includes an actual check of the code flow.
#define MCUX_CSSL_FP_FUNCTION_EXIT_VOID_IMPL(...)
 Flow protection handler for the exit point of functions with the return type void.
#define MCUX_CSSL_FP_FUNCTION_CALL_IMPL3(type, result, call)
 Event implementation of a flow protected function call.
#define MCUX_CSSL_FP_FUNCTION_CALL_IMPL2(result, call)
 Event implementation of a flow protected function call.
#define MCUX_CSSL_FP_FUNCTION_CALL_IMPL(...)
 Event implementation of a flow protected function call.
#define MCUX_CSSL_FP_FUNCTION_CALL_VOID_IMPL(call)
 Event implementation of a flow protected void function call.
#define MCUX_CSSL_FP_FUNCTION_CALL_PROTECTED_IMPL(result, token, call)
 Implementation of a flow protected function call.
#define MCUX_CSSL_FP_FUNCTION_CALL_VOID_PROTECTED_IMPL(token, call)
 Implementation of a flow protected void function call.
#define MCUX_CSSL_FP_FUNCTION_CALL_BEGIN_IMPL(result, token, call)
 Implementation of a flow protected function call meant to be used from within an unprotected function, that must be terminated by MCUX_CSSL_FP_FUNCTION_CALL_END_IMPL.
#define MCUX_CSSL_FP_FUNCTION_CALL_END_IMPL()
 Implementation of the end of a section started by MCUX_CSSL_FP_FUNCTION_CALL_BEGIN_IMPL.
#define MCUX_CSSL_FP_FUNCTION_CALL_VOID_BEGIN_IMPL(token, call)
 Implementation of a flow protected void function call meant to be used from within an unprotected function, that must be terminated by MCUX_CSSL_FP_FUNCTION_CALL_VOID_END_IMPL.
#define MCUX_CSSL_FP_FUNCTION_CALL_VOID_END_IMPL()
 Implementation of the end of a section started by MCUX_CSSL_FP_FUNCTION_CALL_VOID_BEGIN_IMPL.
#define MCUX_CSSL_FP_FUNCTION_CALLED_IMPL(id)
 Expectation implementation of a called function.
#define MCUX_CSSL_FP_FUNCTION_ENTERED_IMPL(id)
 Expectation implementation of an entered (but not exited) function.

Detailed Description

Support for flow protected functions.

Declaration
MCUX_CSSL_FP_FUNCTION_DECL_IMPL
Event
MCUX_CSSL_FP_FUNCTION_CALL_IMPL
Expectation
MCUX_CSSL_FP_FUNCTION_CALLED_IMPL

Macro Definition Documentation

◆ MCUX_CSSL_FP_PROTECTED_TYPE_IMPL

#define MCUX_CSSL_FP_PROTECTED_TYPE_IMPL ( resultType)

Based on a given base type, builds a return type with flow protection.

See also
MCUX_CSSL_FP_FUNCTION_DEF_IMPL
Parameters
resultTypeThe type to be converted into a protected type.

◆ MCUX_CSSL_FP_FUNCTION_DECL_IMPL

#define MCUX_CSSL_FP_FUNCTION_DECL_IMPL ( ...)

Declaration implementation of a flow protected function.

Event
MCUX_CSSL_FP_FUNCTION_CALL_IMPL
Expectation
MCUX_CSSL_FP_FUNCTION_CALLED_IMPL
Parameters
idIdentifier for the function that is flow protected.
ptrTypeOptional, pointer type matching this function.

◆ MCUX_CSSL_FP_FUNCTION_DEF_IMPL

#define MCUX_CSSL_FP_FUNCTION_DEF_IMPL ( ...)

Definition implementation of a flow protected function.

Parameters
idIdentifier for the function that is flow protected.
ptrTypeOptional, pointer type matching this function.

◆ MCUX_CSSL_FP_FUNCTION_POINTER_IMPL

#define MCUX_CSSL_FP_FUNCTION_POINTER_IMPL ( type,
definition )

Definition implementation of a flow protected function pointer.

Parameters
typeIdentifier for the function pointer type that is flow protected.
definitionActual type definition of the function pointer type.

◆ MCUX_CSSL_FP_FUNCTION_ENTRY_IMPL

#define MCUX_CSSL_FP_FUNCTION_ENTRY_IMPL ( ...)

Flow protection handler implementation for the function entry point.

Parameters
idIdentifier of the function that has just been entered.
expectZero or more (comma separated) declarations of expected code flow behavior.

◆ MCUX_CSSL_FP_RESULT_IMPL2

#define MCUX_CSSL_FP_RESULT_IMPL2 ( type,
return )

Extract the result value from a protected return value.

Parameters
typeType of the result.
returnThe protected return value which contains the result.

◆ MCUX_CSSL_FP_RESULT_IMPL1

#define MCUX_CSSL_FP_RESULT_IMPL1 ( return)

Extract the result value from a protected return value.

Parameters
returnThe protected return value which contains the result.

◆ MCUX_CSSL_FP_RESULT_IMPL

#define MCUX_CSSL_FP_RESULT_IMPL ( ...)

Extract the result value from a protected return value.

Parameters
typeOptional, type of the result.
returnThe protected return value which contains the result.

◆ MCUX_CSSL_FP_PROTECTION_TOKEN_IMPL

#define MCUX_CSSL_FP_PROTECTION_TOKEN_IMPL ( return)

Extract the protection token value from a protected return value.

Parameters
returnThe protected return value which contains the protection token.

◆ MCUX_CSSL_FP_FUNCTION_EXIT_IMPLn

#define MCUX_CSSL_FP_FUNCTION_EXIT_IMPLn ( id,
result,
... )

Flow protection handler implementation for the function exit point.

Return the result via the function return value.

See also
MCUX_CSSL_FP_FUNCTION_EXIT_IMPL
Parameters
idIdentifier of the function from which we will exit.
resultResult that should be encoded in the return value.
Returns
A value in which the result is encoded.

◆ MCUX_CSSL_FP_FUNCTION_EXIT_IMPL1

#define MCUX_CSSL_FP_FUNCTION_EXIT_IMPL1 ( id)

Flow protection handler implementation for the function exit point.

Return a null value.

See also
MCUX_CSSL_FP_FUNCTION_EXIT_IMPL
Parameters
idIdentifier of the function from which we will exit.
Returns
A null value.

◆ MCUX_CSSL_FP_FUNCTION_EXIT_IMPL2

#define MCUX_CSSL_FP_FUNCTION_EXIT_IMPL2 ( id,
result )

Flow protection handler implementation for the function exit point.

Return the result via the function return value.

See also
MCUX_CSSL_FP_FUNCTION_EXIT_IMPL
Parameters
idIdentifier of the function from which we will exit.
resultResult that should be encoded in the return value.
Returns
A value in which the result is encoded.

◆ MCUX_CSSL_FP_FUNCTION_EXIT_IMPL

#define MCUX_CSSL_FP_FUNCTION_EXIT_IMPL ( ...)

Flow protection handler implementation for the function exit point.

Return the result via the function return value.

Implemented as an overloaded macro to simplify the use of the API.

See also
MCUX_CSSL_FP_FUNCTION_EXIT_IMPL1
MCUX_CSSL_FP_FUNCTION_EXIT_IMPL2
MCUX_CSSL_FP_FUNCTION_EXIT_IMPLn
Parameters
idIdentifier of the function from which we will exit.
resultResult that should be encoded in the return value.
expectZero or more (comma separated) declarations of expected code flow behavior.
Returns
A value in which the result is encoded.

◆ MCUX_CSSL_FP_FUNCTION_EXIT_WITH_CHECK_IMPL

#define MCUX_CSSL_FP_FUNCTION_EXIT_WITH_CHECK_IMPL ( id,
pass,
fail,
... )

Flow protection handler implementation for the function exit point which includes an actual check of the code flow.

Parameters
idIdentifier of the function from which we will exit.
passResult that should be encoded in the return value if the flow protection check passed.
failResult that should be encoded in the return value if the flow protection check failed.
expectZero or more (comma separated) declarations of expected code flow behavior.
Returns
pass.

◆ MCUX_CSSL_FP_FUNCTION_EXIT_VOID_IMPL

#define MCUX_CSSL_FP_FUNCTION_EXIT_VOID_IMPL ( ...)

Flow protection handler for the exit point of functions with the return type void.

Parameters
idIdentifier of the function from which we will exit.
expectZero or more (comma separated) declarations of expected code flow behavior.
Returns
A protected return value of type void.

◆ MCUX_CSSL_FP_FUNCTION_CALL_IMPL3

#define MCUX_CSSL_FP_FUNCTION_CALL_IMPL3 ( type,
result,
call )

Event implementation of a flow protected function call.

Parameters
typeType of the result variable.
resultFresh variable name to store the result of call.
callThe (protected) function call that must be performed.

◆ MCUX_CSSL_FP_FUNCTION_CALL_IMPL2

#define MCUX_CSSL_FP_FUNCTION_CALL_IMPL2 ( result,
call )

Event implementation of a flow protected function call.

Parameters
resultFresh variable name to store the result of call.
callThe (protected) function call that must be performed.

◆ MCUX_CSSL_FP_FUNCTION_CALL_IMPL

#define MCUX_CSSL_FP_FUNCTION_CALL_IMPL ( ...)

Event implementation of a flow protected function call.

Declaration
MCUX_CSSL_FP_FUNCTION_DECL_IMPL
Expectation
MCUX_CSSL_FP_FUNCTION_CALLED_IMPL
Parameters
typeOptional, type of the result variable.
resultFresh variable name to store the result of call.
callThe (protected) function call that must be performed.

◆ MCUX_CSSL_FP_FUNCTION_CALL_VOID_IMPL

#define MCUX_CSSL_FP_FUNCTION_CALL_VOID_IMPL ( call)

Event implementation of a flow protected void function call.

Declaration
MCUX_CSSL_FP_FUNCTION_DECL_IMPL
Expectation
MCUX_CSSL_FP_FUNCTION_CALLED_IMPL
Parameters
callThe (protected) function call that must be performed.

◆ MCUX_CSSL_FP_FUNCTION_CALL_PROTECTED_IMPL

#define MCUX_CSSL_FP_FUNCTION_CALL_PROTECTED_IMPL ( result,
token,
call )

Implementation of a flow protected function call.

Declaration
MCUX_CSSL_FP_FUNCTION_DECL_IMPL
Expectation
MCUX_CSSL_FP_FUNCTION_CALLED_IMPL
Parameters
resultFresh variable name to store the result of call.
tokenIntenionally unused, since no flow protection is provided.
callThe (protected) function call that must be performed.

◆ MCUX_CSSL_FP_FUNCTION_CALL_VOID_PROTECTED_IMPL

#define MCUX_CSSL_FP_FUNCTION_CALL_VOID_PROTECTED_IMPL ( token,
call )

Implementation of a flow protected void function call.

Declaration
MCUX_CSSL_FP_FUNCTION_DECL_IMPL
Expectation
MCUX_CSSL_FP_FUNCTION_CALLED_IMPL
Parameters
tokenIntentionally unused, since no flow protection is provided.
callThe (protected) function call that must be performed.

◆ MCUX_CSSL_FP_FUNCTION_CALL_BEGIN_IMPL

#define MCUX_CSSL_FP_FUNCTION_CALL_BEGIN_IMPL ( result,
token,
call )

Implementation of a flow protected function call meant to be used from within an unprotected function, that must be terminated by MCUX_CSSL_FP_FUNCTION_CALL_END_IMPL.

Parameters
resultFresh variable name to store the result of call.
tokenFresh variable name to store the protection token of call.
callThe (protected) function call that must be performed.

◆ MCUX_CSSL_FP_FUNCTION_CALL_END_IMPL

#define MCUX_CSSL_FP_FUNCTION_CALL_END_IMPL ( )

Implementation of the end of a section started by MCUX_CSSL_FP_FUNCTION_CALL_BEGIN_IMPL.

◆ MCUX_CSSL_FP_FUNCTION_CALL_VOID_BEGIN_IMPL

#define MCUX_CSSL_FP_FUNCTION_CALL_VOID_BEGIN_IMPL ( token,
call )

Implementation of a flow protected void function call meant to be used from within an unprotected function, that must be terminated by MCUX_CSSL_FP_FUNCTION_CALL_VOID_END_IMPL.

Parameters
tokenFresh variable name to store the protection token of call.
callThe (protected) function call that must be performed.

◆ MCUX_CSSL_FP_FUNCTION_CALL_VOID_END_IMPL

#define MCUX_CSSL_FP_FUNCTION_CALL_VOID_END_IMPL ( )

Implementation of the end of a section started by MCUX_CSSL_FP_FUNCTION_CALL_VOID_BEGIN_IMPL.

◆ MCUX_CSSL_FP_FUNCTION_CALLED_IMPL

#define MCUX_CSSL_FP_FUNCTION_CALLED_IMPL ( id)

Expectation implementation of a called function.

Declaration
MCUX_CSSL_FP_FUNCTION_DECL_IMPL
Event
MCUX_CSSL_FP_FUNCTION_CALL_IMPL
See also
MCUX_CSSL_FP_FUNCTION_VALUE
Parameters
idIdentifier of the function that is expected to be called.
Returns
A null value.

◆ MCUX_CSSL_FP_FUNCTION_ENTERED_IMPL

#define MCUX_CSSL_FP_FUNCTION_ENTERED_IMPL ( id)

Expectation implementation of an entered (but not exited) function.

Declaration
MCUX_CSSL_FP_FUNCTION_DECL_IMPL
Event
MCUX_CSSL_FP_FUNCTION_CALL_IMPL
See also
MCUX_CSSL_FP_FUNCTION_VALUE
Parameters
idIdentifier of the function that is expected to be entered.
Returns
A null value.