MCUX CLNS
MCUX Crypto Library Normal Secure
Loading...
Searching...
No Matches
mcuxCsslParamIntegrity.h
Go to the documentation of this file.
1/*--------------------------------------------------------------------------*/
2/* Copyright 2020-2021, 2025 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
22
23#ifndef MCUXCSSLPARAMINTEGRITY_H
24#define MCUXCSSLPARAMINTEGRITY_H
25
26#include <stdint.h>
27#include <stddef.h>
28#include <stdbool.h>
31
39
46
47#define MCUXCSSLPARAMINTEGRITY_BASE_CHECKSUM ((mcuxCsslParamIntegrity_Checksum_t)0xb7151628u)
48
49#define MCUXCSSLPARAMINTEGRITY_CHECK_VALID ((mcuxCsslParamIntegrity_Checksum_t)0x6969u)
50
51#define MCUXCSSLPARAMINTEGRITY_CHECK_INVALID ((mcuxCsslParamIntegrity_Checksum_t)0x9696u)
52
53#define MCUX_CSSL_PI_PARAM_ADD_CASTED_ARG(x) ,( \
54 MCUX_CSSL_ANALYSIS_START_SUPPRESS_TYPECAST_BETWEEN_INTEGER_AND_POINTER("Typecast pointer to integer for parameter integrity evaluation") \
55 (mcuxCsslParamIntegrity_Param_t)(x) \
56 MCUX_CSSL_ANALYSIS_STOP_SUPPRESS_TYPECAST_BETWEEN_INTEGER_AND_POINTER())
57
58#define MCUX_CSSL_PI_VALIDATE(chk, ...) (mcuxCsslParamIntegrity_Validate(chk, MCUX_CSSL_CPP_ARGCOUNT(__VA_ARGS__) MCUX_CSSL_CPP_MAP(MCUX_CSSL_PI_PARAM_ADD_CASTED_ARG, __VA_ARGS__)))
59
60#define MCUX_CSSL_PI_PROTECT(...) (mcuxCsslParamIntegrity_Protect(MCUX_CSSL_CPP_ARGCOUNT(__VA_ARGS__) MCUX_CSSL_CPP_MAP(MCUX_CSSL_PI_PARAM_ADD_CASTED_ARG, __VA_ARGS__)))
61
65
72
76typedef void * mcuxCsslParamIntegrity_AssertionCpuWordSize_t[(4u == sizeof(size_t)) ? (+1) : (-1)];
77
82
87
88
92
99
109
122
126
130
131#endif
Provides the API for the CSSL flow protection mechanism.
Definition of function identifiers for the flow protection mechanism.
#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
uint32_t mcuxCsslParamIntegrity_Param_t
Type of a parameter for the checksum calculation.
Definition mcuxCsslParamIntegrity.h:86
uint32_t mcuxCsslParamIntegrity_Checksum_t
Type of a parameter checksum.
Definition mcuxCsslParamIntegrity.h:81
void * mcuxCsslParamIntegrity_AssertionCpuWordSize_t[(4u==sizeof(size_t)) ?(+1) :(-1)]
Build time assertion to ensure CPU word size of 32 bit.
Definition mcuxCsslParamIntegrity.h:76
mcuxCsslParamIntegrity_Checksum_t mcuxCsslParamIntegrity_Validate(mcuxCsslParamIntegrity_Checksum_t chk, uint32_t nargs,...)
Verifies the correctness of a parameter checksum.
mcuxCsslParamIntegrity_Checksum_t mcuxCsslParamIntegrity_Protect(uint32_t nargs,...)
Calculates a parameter checksum.