MCUX CLNS
MCUX Crypto Library Normal Secure
 
Loading...
Searching...
No Matches
mcuxClOsccaSm2_CommonParams.h
Go to the documentation of this file.
1/*--------------------------------------------------------------------------*/
2/* Copyright 2022-2024 NXP */
3/* */
4/* NXP Proprietary. 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 */
10/* license terms, then you may not retain, install, activate or otherwise */
11/* use the software. */
12/*--------------------------------------------------------------------------*/
13
21#ifndef MCUXCLOSCCASM2_COMMONPARAMS_H_
22#define MCUXCLOSCCASM2_COMMONPARAMS_H_
23
24#include <mcuxClCore_Examples.h>
25#if MCUXCL_FEATURE_RANDOMMODES_OSCCA_TRNG == 0
26#include <mcuxClRandom.h>
27#include <mcuxClRandomModes.h>
28#include <mcuxClMemory.h>
30#endif
31
32#if MCUXCL_FEATURE_RANDOMMODES_OSCCA_TRNG == 0
33static const uint8_t mcuxClOsscaSm2_Example_PatchedRngValue[MCUXCLOSCCASM2_EXAMPLE_PATCH_SIZE] = {
34 0xa1, 0xba, 0xf0, 0xb2, 0x9f, 0x2b, 0x3d, 0x0d,
35 0x12, 0x73, 0x2f, 0x43, 0x36, 0xb6, 0x6e, 0x77,
36 0xd5, 0x21, 0x95, 0x72, 0x1e, 0xdb, 0x9a, 0x52,
37 0xf8, 0x6d, 0x0a, 0x56, 0x55, 0xc2, 0x45, 0x82,
38 0x10, 0x08, 0xe9, 0xd4, 0xbd, 0xce, 0xcd, 0x72,
39 0x74, 0xd4, 0x70, 0x85, 0x09, 0x25, 0x7a, 0xe5,
40 0xcf, 0x00, 0x98, 0x91, 0xce, 0x55, 0x5a, 0xce,
41 0x5c, 0x81, 0xc2, 0x29, 0xda, 0xd5, 0x1b, 0x83
42};
43
44static mcuxClRandom_Status_t RNG_Patch_function(
46 mcuxClRandom_Context_t pCustomCtx,
47 uint8_t *pOut,
48 uint32_t outLength
49)
50{
51 (void)pCustomCtx;
52 (void)session;
53 if(outLength > sizeof(mcuxClOsscaSm2_Example_PatchedRngValue))
54 {
56 }
57 MCUX_CSSL_FP_FUNCTION_CALL_VOID_BEGIN(memCopyToken, mcuxClMemory_copy(pOut, mcuxClOsscaSm2_Example_PatchedRngValue, outLength, outLength));
59 {
60 return MCUXCLEXAMPLE_STATUS_ERROR;
61 }
63
65}
66#endif /* MCUXCL_FEATURE_RANDOMMODES_PATCHMODE */
67
68#endif /* MCUXCLOSCCASM2_COMMONPARAMS_H_ */
Definition of function identifiers for the flow protection mechanism.
Top-level include file for the memory operations.
Top level header of mcuxClRandom component.
Top level header of mcuxClRandomModes component.
void mcuxClMemory_copy(uint8_t *pDst, uint8_t const *pSrc, size_t length, size_t bufLength)
Copies a memory buffer to another location.
uint32_t mcuxClRandom_Status_t
Type for status codes of mcuxClRandom component functions.
Definition mcuxClRandom_Types.h:48
mcuxClRandom_ContextDescriptor_t * mcuxClRandom_Context_t
Random context type.
Definition mcuxClRandom_Types.h:71
mcuxClSession_Descriptor_t *const mcuxClSession_Handle_t
Type for mcuxClSession Handle.
Definition mcuxClSession_Types.h:113
#define MCUX_CSSL_FP_FUNCTION_CALL_VOID_BEGIN(...)
Call a flow protected void function and check the protection token.
Definition mcuxCsslFlowProtection.h:652
#define MCUX_CSSL_FP_FUNCTION_CALL_VOID_END(...)
End a void function call section started by MCUX_CSSL_FP_FUNCTION_CALL_VOID_BEGIN.
Definition mcuxCsslFlowProtection.h:683
#define MCUX_CSSL_FP_FUNCTION_CALLED(...)
Expectation of a called function.
Definition mcuxCsslFlowProtection.h:735
#define MCUXCLRANDOM_STATUS_ERROR
Random function returned error.
Definition mcuxClRandom_Constants.h:43
#define MCUXCLRANDOM_STATUS_OK
Random function returned successfully.
Definition mcuxClRandom_Constants.h:46