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 |
Macros | |
#define | CRYS_RND_MAX_RESEED_COUNTER (0xFFFFFFFF - 0xF) |
#define | CRYS_RND_MAX_GEN_VECTOR_SIZE_BITS 0x7FFFF |
#define | CRYS_RND_MAX_GEN_VECTOR_SIZE_BYTES 0xFFFF |
#define | CRYS_RND_AES_BLOCK_SIZE_IN_WORDS SASI_AES_BLOCK_SIZE_IN_WORDS |
#define | CRYS_RND_SEED_MAX_SIZE_WORDS 12 |
#define | CRYS_RND_ADDITINAL_INPUT_MAX_SIZE_WORDS CRYS_RND_SEED_MAX_SIZE_WORDS |
#define | CRYS_RND_AES_KEY_128_SIZE_WORDS 4 |
#define | CRYS_RND_AES_KEY_192_SIZE_WORDS 6 |
#define | CRYS_RND_AES_KEY_256_SIZE_WORDS 8 |
#define | CRYS_RND_WORK_BUFFER_SIZE_WORDS 1528 |
#define | CRYS_RND_EntropyEstimatData_t CRYS_RND_WorkBuff_t |
#define | crysRndEntrIntBuff crysRndWorkBuff |
#define | CRYS_RND_TRNG_SRC_INNER_OFFSET_WORDS 2 |
#define | CRYS_RND_TRNG_SRC_INNER_OFFSET_BYTES (CRYS_RND_TRNG_SRC_INNER_OFFSET_WORDS*sizeof(uint32_t)) |
#define | CRYS_PRNG_FIPS_KAT_OUT_DATA_SIZE 64 |
Typedefs | |
typedef uint32_t(* | SaSiRndGenerateVectWorkFunc_t) (void *rndState_ptr, uint16_t outSizeBytes, uint8_t *out_ptr) |
Enumerations |
Functions | |
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). More... | |
CRYSError_t | CRYS_RND_UnInstantiation (void *rndState_ptr) |
Clears existing RNG instantiation state. More... | |
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). More... | |
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). More... | |
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.). More... | |
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. More... | |
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. More... | |
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. More... | |
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.