Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: TYBLE16_simple_data_logger TYBLE16_MP3_Air
crys_rnd.h File Reference
This file contains the CRYS APIs used for random number generation. The random-number generation module implements referenced standard [SP800-90]. More...
Go to the source code of this file.
Data Structures | |
struct | CRYS_RND_WorkBuff_t |
struct | CRYS_RND_State_t |
struct | CRYS_PrngFipsKatCtx_t |
Typedefs | |
typedef uint32_t(* | SaSiRndGenerateVectWorkFunc_t )(\void *rndState_ptr,\uint16_t outSizeBytes,\uint8_t *out_ptr) |
Enumerations | |
enum | CRYS_RND_mode_t { CRYS_RND_Fast = 0, CRYS_RND_Slow = 1, CRYS_RND_ModeLast = 0x7FFFFFFF } |
Functions | |
CIMPORT_C CRYSError_t | CRYS_RND_Instantiation (void *rndState_ptr, CRYS_RND_WorkBuff_t *rndWorkBuff_ptr) |
This function initializes the RND context. It must be called at least once prior to using this context with any API that requires it as a parameter (e.g., other RND APIs, asymmetric cryptography key generation and signatures). It is called as part of ARM TrustZone CryptoCell library initialization, which initializes and returns the primary RND context. This primary context can be used as a single global context for all RND needs. Alternatively, other contexts may be initialized and used with a more limited scope (for specific applications or specific threads). The call to this function must be followed by a call to CRYS_RND_SetGenerateVectorFunc API to set the generate vector function. It implements referenced standard [SP800-90] - 10.2.1.3.2 - CTR-DRBG Instantiate algorithm using AES (FIPS-PUB 197) and Derivation Function (DF). | |
CIMPORT_C CRYSError_t | CRYS_RND_UnInstantiation (void *rndState_ptr) |
Clears existing RNG instantiation state. | |
CIMPORT_C CRYSError_t | CRYS_RND_Reseeding (void *rndState_ptr, CRYS_RND_WorkBuff_t *rndWorkBuff_ptr) |
This function is used for reseeding the RNG with additional entropy and additional user-provided input. (additional data should be provided by calling CRYS_RND_AddAdditionalInput prior to using this API). It implements referenced standard [SP800-90] - 10.2.1.4.2 - CTR-DRBG Reseeding algorithm, using AES (FIPS-PUB 197) and Derivation Function (DF). | |
CIMPORT_C CRYSError_t | CRYS_RND_GenerateVector (void *rndState_ptr, uint16_t outSizeBytes, uint8_t *out_ptr) |
Generates a random vector according to the algorithm defined in referenced standard [SP800-90] - 10.2.1.5.2 - CTR-DRBG. The generation algorithm uses AES (FIPS-PUB 197) and Derivation Function (DF). | |
CIMPORT_C CRYSError_t | CRYS_RND_GenerateVectorInRange (void *rndState_ptr, SaSiRndGenerateVectWorkFunc_t rndGenerateVectFunc, uint32_t rndSizeInBits, uint8_t *maxVect_ptr, uint8_t *rndVect_ptr) |
Generates a random vector with specific limitations by testing candidates (described and used in FIPS 186-4: B.1.2, B.4.2 etc.). | |
CIMPORT_C CRYSError_t | CRYS_RND_AddAdditionalInput (void *rndState_ptr, uint8_t *additonalInput_ptr, uint16_t additonalInputSize) |
Used for adding additional input/personalization data provided by the user, to be later used by the CRYS_RND_Instantiation/CRYS_RND_Reseeding/CRYS_RND_GenerateVector functions. | |
CIMPORT_C CRYSError_t | CRYS_RND_EnterKatMode (void *rndState_ptr, uint8_t *entrData_ptr, uint32_t entrSize, uint8_t *nonce_ptr, uint32_t nonceSize, CRYS_RND_WorkBuff_t *workBuff_ptr) |
The CRYS_RND_EnterKatMode function sets KAT mode bit into StateFlag of global CRYS_RND_WorkingState structure. | |
CIMPORT_C void | CRYS_RND_DisableKatMode (void *rndState_ptr) |
The CRYS_RND_DisableKatMode function disables KAT mode bit into StateFlag of global CRYS_RND_State_t structure. |
Detailed Description
This file contains the CRYS APIs used for random number generation. The random-number generation module implements referenced standard [SP800-90].
Definition in file crys_rnd.h.
Generated on Tue Jul 12 2022 13:55:06 by
