|
◆ CRYPT_EAL_DrbgInit()
Random number initialization interface, and this interface does not support multiple threads.
Initial DRBG with HiTLS, entropy source and addtional random number in the seed material
are provided by users. This interface does not support multi-threading, the initial random number is the random number generation algorithm described in Nist 800-90a. Usage scenes are as follows:
- seedMeth == NULL && seedCtx == NULL ====> Use the default system entropy source in AES_CTR mode (that is, non-DF cannot use the default entropy source).
- seedMeth == NULL && seedCtx != NULL ===> error reported.
- seedMeth != NULL ====> This function can be used normally, seedCtx function is not restricted, but make sure seedMeth can handle all kinds of situations.
- Attention
- Initialization and deinitialization
- Parameters
-
id | [IN] RAND id |
seedMeth | [IN] Seed method, this parameter and seedCtx can be null at the same time. The default entropy source is used or provided by the user. |
seedCtx | [IN] Seed context information, which can be NULL, but the seedMeth provided by the user needs to be able to handle the situation where seedCtx is null. seedCtx generally needs to contain the entropy source marked as "entropy", additional random number "nonce", and other data. |
pers | [IN] Personal data, which can be NULL. |
persLen | [IN] Personal data length. the range is [0,0x7FFFFFF0]. |
- Return values
-
DRBG | handle, if successful. NULL, if failed. |
|