MCUX CLNS MCUX Crypto Library Normal Secure |

mcuxClCss_Rng.h
Go to the documentation of this file.
1 /*--------------------------------------------------------------------------*/
2 /* Copyright 2020-2021 NXP */
3 /* */
4 /* NXP Confidential. 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 license */
10 /* terms, then you may not retain, install, activate or otherwise use the */
11 /* software. */
12 /*--------------------------------------------------------------------------*/
13
20 #ifndef MCUXCLCSS_RNG_H_
21 #define MCUXCLCSS_RNG_H_
22
23 #include <mcuxClCss_Common.h> // Common functionality
24
25
34 /**********************************************
35 * CONSTANTS
36 **********************************************/
43 #define MCUXCLCSS_RNG_DTRNG_CONFIG_SIZE ((uint8_t) 84)
44 #define MCUXCLCSS_RNG_DTRNG_EVAL_CONFIG_SIZE ((uint8_t) 52)
45 #define MCUXCLCSS_RNG_DTRNG_EVAL_RESULT_SIZE ((uint8_t) 188)
46
47 #define MCUXCLCSS_RNG_DRBG_TEST_EXTRACT_OUTPUT_MIN_SIZE 4U
48 #define MCUXCLCSS_RNG_DRBG_TEST_EXTRACT_OUTPUT_MAX_SIZE ((uint32_t) 1U << 16U)
49
54 /**********************************************
55 * FUNCTIONS
56 **********************************************/
57
101 MCUX_CSSL_FP_FUNCTION_DECL(mcuxClCss_Rng_DrbgRequest_Async)
102 MCUXCLCSS_API mcuxClCss_Status_Protected_t mcuxClCss_Rng_DrbgRequest_Async(
103 uint8_t * pOutput,
104 size_t outputLength
105 );
106
107
127 MCUX_CSSL_FP_FUNCTION_DECL(mcuxClCss_Rng_DrbgTestInstantiate_Async)
128 MCUXCLCSS_API mcuxClCss_Status_Protected_t mcuxClCss_Rng_DrbgTestInstantiate_Async(
129 uint8_t const * pEntropy
130 );
131
163 MCUX_CSSL_FP_FUNCTION_DECL(mcuxClCss_Rng_DrbgTestExtract_Async)
164 MCUXCLCSS_API mcuxClCss_Status_Protected_t mcuxClCss_Rng_DrbgTestExtract_Async(
165 uint8_t * pOutput,
166 size_t outputLength
167 );
168
190 MCUX_CSSL_FP_FUNCTION_DECL(mcuxClCss_Rng_DrbgTestAesEcb_Async)
191 MCUXCLCSS_API mcuxClCss_Status_Protected_t mcuxClCss_Rng_DrbgTestAesEcb_Async(
192 uint8_t const * pDataKey,
193 uint8_t * pOutput
194 );
195
219 MCUX_CSSL_FP_FUNCTION_DECL(mcuxClCss_Rng_DrbgTestAesCtr_Async)
220 MCUXCLCSS_API mcuxClCss_Status_Protected_t mcuxClCss_Rng_DrbgTestAesCtr_Async(
221 uint8_t const * pData,
222 size_t dataLength,
223 uint8_t const * pIvKey,
224 uint8_t * pOutput
225 );
226
257 MCUX_CSSL_FP_FUNCTION_DECL(mcuxClCss_Rng_Dtrng_ConfigLoad_Async)
258 MCUXCLCSS_API mcuxClCss_Status_Protected_t mcuxClCss_Rng_Dtrng_ConfigLoad_Async(
259 uint8_t const * pInput
260 );
261
292 MCUX_CSSL_FP_FUNCTION_DECL(mcuxClCss_Rng_Dtrng_ConfigEvaluate_Async)
293 MCUXCLCSS_API mcuxClCss_Status_Protected_t mcuxClCss_Rng_Dtrng_ConfigEvaluate_Async(
294 uint8_t const * pInput,
295 uint8_t * pOutput
296 );
297
298
316 MCUX_CSSL_FP_FUNCTION_DECL(mcuxClCss_Prng_GetRandomWord)
317 MCUXCLCSS_API mcuxClCss_Status_Protected_t mcuxClCss_Prng_GetRandomWord(
318 uint32_t * pWord
319 );
320
339 MCUX_CSSL_FP_FUNCTION_DECL(mcuxClCss_Prng_GetRandom)
340 MCUXCLCSS_API mcuxClCss_Status_Protected_t mcuxClCss_Prng_GetRandom(
341 uint8_t * pOutput,
342 size_t outputLength
343 );
344 /* mcuxClCss_Rng_Functions */
348
349 /* mcuxClCss_Rng */
353
354 #endif /* MCUXCLCSS_RNG_H_ */
mcuxClCss_Prng_GetRandomWord
MCUXCLCSS_API mcuxClCss_Status_Protected_t mcuxClCss_Prng_GetRandomWord(uint32_t *pWord)
Returns one random word from the CSS PRNG.
MCUXCLCSS_API
#define MCUXCLCSS_API
Marks a function as a public API function of the mcuxClCss component.
Definition: mcuxClCss_Common.h:40
mcuxClCss_Rng_Dtrng_ConfigEvaluate_Async
MCUXCLCSS_API mcuxClCss_Status_Protected_t mcuxClCss_Rng_Dtrng_ConfigEvaluate_Async(uint8_t const *pInput, uint8_t *pOutput)
Performs characterization of the CSS DTRNG.
mcuxClCss_Rng_DrbgTestInstantiate_Async
MCUXCLCSS_API mcuxClCss_Status_Protected_t mcuxClCss_Rng_DrbgTestInstantiate_Async(uint8_t const *pEntropy)
Instantiates the DRBG in test mode.
mcuxClCss_Common.h
CSSv2 header for common functionality.
mcuxClCss_Rng_DrbgTestAesEcb_Async
MCUXCLCSS_API mcuxClCss_Status_Protected_t mcuxClCss_Rng_DrbgTestAesEcb_Async(uint8_t const *pDataKey, uint8_t *pOutput)
Encrypts data using the AES-ECB engine of the DRBG.
mcuxClCss_Rng_Dtrng_ConfigLoad_Async
MCUXCLCSS_API mcuxClCss_Status_Protected_t mcuxClCss_Rng_Dtrng_ConfigLoad_Async(uint8_t const *pInput)
Loads a configuration of the CSS DTRNG.
mcuxClCss_Rng_DrbgTestExtract_Async
MCUXCLCSS_API mcuxClCss_Status_Protected_t mcuxClCss_Rng_DrbgTestExtract_Async(uint8_t *pOutput, size_t outputLength)
Performs a DRBG extraction.
mcuxClCss_Rng_DrbgRequest_Async
MCUXCLCSS_API mcuxClCss_Status_Protected_t mcuxClCss_Rng_DrbgRequest_Async(uint8_t *pOutput, size_t outputLength)
Writes random data from the CSS DRBG to the given buffer.
mcuxClCss_Rng_DrbgTestAesCtr_Async
MCUXCLCSS_API mcuxClCss_Status_Protected_t mcuxClCss_Rng_DrbgTestAesCtr_Async(uint8_t const *pData, size_t dataLength, uint8_t const *pIvKey, uint8_t *pOutput)
Encrypts data using the AES-CTR engine of the DRBG.
mcuxClCss_Prng_GetRandom
MCUXCLCSS_API mcuxClCss_Status_Protected_t mcuxClCss_Prng_GetRandom(uint8_t *pOutput, size_t outputLength)
Writes random data from the CSS PRNG to the given buffer.
MCUX_CSSL_FP_FUNCTION_DECL
#define MCUX_CSSL_FP_FUNCTION_DECL(id)
Declaration of a flow protected function.
Definition: mcuxCsslFlowProtection.h:119
mcuxClCss_Status_Protected_t
uint64_t mcuxClCss_Status_Protected_t
Type for CSS driver protected status codes.
Definition: mcuxClCss_Types.h:183