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

Support for flow protected branches. More...

Macros

#define MCUX_CSSL_FP_BRANCH_DECL(id)
 Declaration of a flow protected branch.
#define MCUX_CSSL_FP_BRANCH_POSITIVE(...)
 Positive scenario for a branch is executed.
#define MCUX_CSSL_FP_BRANCH_NEGATIVE(...)
 Negative scenario of a branch is executed.
#define MCUX_CSSL_FP_BRANCH_TAKEN_POSITIVE(...)
 Expectation that positive branch has been taken.
#define MCUX_CSSL_FP_BRANCH_TAKEN_NEGATIVE(...)
 Expectation that negative branch has been taken.

Detailed Description

Macro Definition Documentation

◆ MCUX_CSSL_FP_BRANCH_DECL

#define MCUX_CSSL_FP_BRANCH_DECL ( id)

Declaration of a flow protected branch.

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

MCUX_CSSL_FP_BRANCH_DECL(someBranchIdentifier);
if (condition)
{
MCUX_CSSL_FP_BRANCH_POSITIVE(someBranchIdentifier);
}
else
{
MCUX_CSSL_FP_BRANCH_NEGATIVE(someBranchIdentifier);
}
// ...
MCUX_CSSL_FP_BRANCH_TAKEN(someBranchIdentifier,
MCUX_CSSL_FP_BRANCH_POSITIVE_SCENARIO, condition)
);
#define MCUX_CSSL_FP_FUNCTION_EXIT(...)
Flow protection handler for the function exit point.
Definition mcuxCsslFlowProtection.h:306
#define MCUX_CSSL_FP_BRANCH_DECL(id)
Declaration of a flow protected branch.
Definition mcuxCsslFlowProtection.h:939
#define MCUX_CSSL_FP_BRANCH_NEGATIVE(...)
Negative scenario of a branch is executed.
Definition mcuxCsslFlowProtection.h:1017
#define MCUX_CSSL_FP_BRANCH_POSITIVE(...)
Positive scenario for a branch is executed.
Definition mcuxCsslFlowProtection.h:978
Events
MCUX_CSSL_FP_BRANCH_POSITIVE
MCUX_CSSL_FP_BRANCH_NEGATIVE
Expectations
MCUX_CSSL_FP_BRANCH_TAKEN_POSITIVE
MCUX_CSSL_FP_BRANCH_TAKEN_NEGATIVE
Parameters
idIdentifier for the branch that is flow protected.

◆ MCUX_CSSL_FP_BRANCH_POSITIVE

#define MCUX_CSSL_FP_BRANCH_POSITIVE ( ...)

Positive scenario for a branch is executed.

This branch event macro informs the flow mechanism that the positive scenario of the branch is executed for the branch declared by MCUX_CSSL_FP_BRANCH_DECL with the given id. For example:

MCUX_CSSL_FP_BRANCH_DECL(someBranchIdentifier);
if (condition)
{
MCUX_CSSL_FP_BRANCH_POSITIVE(someBranchIdentifier);
}
else
{
MCUX_CSSL_FP_BRANCH_NEGATIVE(someBranchIdentifier);
}
// ...
MCUX_CSSL_FP_BRANCH_TAKEN_POSITIVE(someBranchIdentifier)
)
);
#define MCUX_CSSL_FP_BRANCH_TAKEN_POSITIVE(...)
Expectation that positive branch has been taken.
Definition mcuxCsslFlowProtection.h:1060
#define MCUX_CSSL_FP_CONDITIONAL_IMPL(condition,...)
Conditional expectation aggregation.
Definition mcuxCsslFlowProtection_SecureCounter_Common.h:157
Declaration
MCUX_CSSL_FP_BRANCH_DECL
Expectation
MCUX_CSSL_FP_BRANCH_TAKEN_POSITIVE
Parameters
...The following parameters need to be passed (comma separated):
  • id: Identifier for the branch for which the positive scenario is executed.
  • expect: Zero or more (comma separated) declarations of expected code flow behavior related to this event.

◆ MCUX_CSSL_FP_BRANCH_NEGATIVE

#define MCUX_CSSL_FP_BRANCH_NEGATIVE ( ...)

Negative scenario of a branch is executed.

This branch event macro informs the flow mechanism that the positive scenario of the branch is executed for the branch declared by MCUX_CSSL_FP_BRANCH_DECL with the given id. For example:

MCUX_CSSL_FP_BRANCH_DECL(someBranchIdentifier);
if (condition)
{
MCUX_CSSL_FP_BRANCH_POSITIVE(someBranchIdentifier);
}
else
{
MCUX_CSSL_FP_BRANCH_NEGATIVE(someBranchIdentifier);
}
// ...
MCUX_CSSL_FP_BRANCH_TAKEN_NEGATIVE(someBranchIdentifier)
)
);
#define MCUX_CSSL_FP_BRANCH_TAKEN_NEGATIVE(...)
Expectation that negative branch has been taken.
Definition mcuxCsslFlowProtection.h:1105
Declaration
MCUX_CSSL_FP_BRANCH_DECL
Expectation
MCUX_CSSL_FP_BRANCH_TAKEN_NEGATIVE
Parameters
...The following parameters need to be passed (comma separated):
  • id: Identifier for the branch for which the negative scenario is executed.
  • expect: Zero or more (comma separated) declarations of expected code flow behavior related to this event.

◆ MCUX_CSSL_FP_BRANCH_TAKEN_POSITIVE

#define MCUX_CSSL_FP_BRANCH_TAKEN_POSITIVE ( ...)

Expectation that positive branch has been taken.

This expectation macro indicates to the flow protection mechanism that the branch declared by MCUX_CSSL_FP_BRANCH_DECL with the given id has executed the positive scenario (under the given condition). For example:

MCUX_CSSL_FP_BRANCH_DECL(someBranchIdentifier);
if (condition)
{
MCUX_CSSL_FP_BRANCH_POSITIVE(someBranchIdentifier);
}
else
{
MCUX_CSSL_FP_BRANCH_NEGATIVE(someBranchIdentifier);
}
// ...
// Providing the condition as part of the branch expectation.
// Alternatively, the expectation can be placed in a conditional block.
MCUX_CSSL_FP_BRANCH_TAKEN_POSITIVE(someBranchIdentifier, condition)
);
Declaration
MCUX_CSSL_FP_BRANCH_DECL
Event
MCUX_CSSL_FP_BRANCH_POSITIVE
See also
MCUX_CSSL_FP_FUNCTION_ENTRY
MCUX_CSSL_FP_FUNCTION_EXIT
MCUX_CSSL_FP_FUNCTION_EXIT_WITH_CHECK
MCUX_CSSL_FP_EXPECT
MCUX_CSSL_FP_CONDITIONAL
Parameters
...The following parameters need to be passed (comma separated):
  • id: Identifier of the flow protected branch.
  • condition: Optional, condition under which this branch is taken.

◆ MCUX_CSSL_FP_BRANCH_TAKEN_NEGATIVE

#define MCUX_CSSL_FP_BRANCH_TAKEN_NEGATIVE ( ...)

Expectation that negative branch has been taken.

This expectation macro indicates to the flow protection mechanism that the branch declared by MCUX_CSSL_FP_BRANCH_DECL with the given id has executed the negative scenario (under the given condition). For example:

MCUX_CSSL_FP_BRANCH_DECL(someBranchIdentifier);
if (condition)
{
MCUX_CSSL_FP_BRANCH_POSITIVE(someBranchIdentifier);
}
else
{
MCUX_CSSL_FP_BRANCH_NEGATIVE(someBranchIdentifier);
}
// ...
// Providing the branch expectation as part of a conditional block.
// Alternatively, the condition can be provided in the branch expectation.
MCUX_CSSL_FP_BRANCH_TAKEN_NEGATIVE(someBranchIdentifier)
)
);
#define MCUX_CSSL_FP_CONDITIONAL(condition,...)
Handling of conditionally expected code flow behavior.
Definition mcuxCsslFlowProtection.h:1425
Declaration
MCUX_CSSL_FP_BRANCH_DECL
Event
MCUX_CSSL_FP_BRANCH_NEGATIVE
See also
MCUX_CSSL_FP_FUNCTION_ENTRY
MCUX_CSSL_FP_FUNCTION_EXIT
MCUX_CSSL_FP_FUNCTION_EXIT_WITH_CHECK
MCUX_CSSL_FP_EXPECT
MCUX_CSSL_FP_CONDITIONAL
Parameters
...The following parameters need to be passed (comma separated):
  • id: Identifier of the flow protected branch.
  • condition: Optional, condition under which this branch is taken.