RNG driver header.
The Random Number Generator (RNG) module generates random data of variable lengths from a pool of entropy. The pool of entropy is maintained by the driver using implementation-specific sources of entropy. The output is suitable for applications requiring cryptographically random data such as keying material for private or symmetric keys.
Unlike most drivers, there is a global instance of RNG driver data that is always available once RNG_init() is called. This data will contain the entropy pool and any needed state information required to refill the pool. RNG_init() should be called once before using other RNG driver APIs.
Before starting a RNG operation, the application must do the following:
At any time after calling RNG_init(), the application may call RNG_fillPoolIfLessThan() to add entropy to the pool which will then make future requests for entropy execute faster. Note that the driver never automatically refills the pool. However, if the pool is empty, the RNG driver will still generate entropy upon request (for example when RNG_getRandomBits() is called).
The application is responsible for deciding when it is appropriate to spend the time and energy to refill the pool. One suggested location to do so is the idle thread.
Use RNG_getRandomBits() to obtain random bits from the entropy pool and copy them to a buffer/array. The caller must allocate memory sufficient to hold at least the number of bits of random data requested.
After the RNG operation completes, the application should either start another operation or close the driver by calling RNG_close(). Note that the singleton instance of the driver, along with its associated pool of entropy will still exist and will be used by any future RNG_open() calls. Note that closing the driver instance may not be strictly required, but is good practice.
The entropy pool and any required state to generate more entropy is maintained in memory, in the driver's global instance data. The entirety of this data is stored in two global variables called RNG_instanceData and RNG_instancePool. It is up to the system to provide adequate protection (primarily confidentiality and integrity) of these in-memory assets.
Functions which provide for generation of a value within a range use an algorithm which is timing-constant when the following parameters are held constant: lowerLimit, upperLimit, bitLength, and endianess. Thus, while the driver may create multiple candidates for the value to find one within the range, timing will not leak the final value's relation to the limits. However, timing may leak the bitLength, the endianess, and the use of CryptoUtils_limitZero, CryptoUtils_limitOne, or NULL for the limit values.
The following examples do not show the process of initializing the RNG module and refilling the pool. See ti_drivers_RNG_Synopsis RNG Driver Synopsis for an example showing those parts of RNG operation. *
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
#include <ti/drivers/cryptoutils/cryptokey/CryptoKey.h>
Go to the source code of this file.
Data Structures | |
struct | RNG_Config |
RNG Global configuration. More... | |
struct | RNG_Params |
RNG Parameters. More... | |
Macros | |
#define | RNG_STATUS_RESERVED (-32) |
#define | RNG_STATUS_SUCCESS ((int_fast16_t)0) |
Successful status code. More... | |
#define | RNG_STATUS_ERROR ((int_fast16_t)-1) |
Generic error status code. More... | |
#define | RNG_STATUS_RESOURCE_UNAVAILABLE ((int_fast16_t)-2) |
An error status code returned if the hardware or software resource is currently unavailable. More... | |
#define | RNG_STATUS_INVALID_INPUTS ((int_fast16_t)-3) |
Operation failed due to invalid inputs. More... | |
#define | RNG_STATUS_CANCELED ((int_fast16_t)-4) |
The ongoing operation was canceled. More... | |
#define | RNG_ENTROPY_EXHAUSTED ((int_fast16_t)-5) |
The pool of entropy has been exhausted and additional entropy cannot be generated. A reset of the system may be required to generate more entropy. More... | |
#define | RNG_STATUS_INIT_NOT_ALLOWED ((int_fast16_t)-6) |
Some implementations have restrictions on how often or when RNG_init may be called. See the documentation for the implementation for more information. More... | |
#define | RNG_STATUS_NOISE_INPUT_INVALID ((int_fast16_t)-7) |
Some implementations require a noise input during initialization which is conditioned to seed the RNG driver. RNG_init() will return this error if the noise input pointer is not intialized with valid information. See documentation for the implementation for more information. More... | |
#define | RNG_STATUS_NOT_INITIALIZED ((int_fast16_t)-7) |
RNG driver not intialized. More... | |
#define | RNG_MAX_BIT_LENGTH ((size_t)1u << 20u) /* 1 MiB */ |
Maximum number of bits that may be requested in a single call. More... | |
Typedefs | |
typedef const RNG_Config * | RNG_Handle |
A handle that is returned from a RNG_open() call. More... | |
typedef void(* | RNG_CryptoKeyCallbackFxn) (RNG_Handle handle, int_fast16_t returnValue, CryptoKey *key) |
The definition of a callback function used by the RNG driver when RNG_generateKey(), RNG_generateLEKeyInRange(), or RNG_generateBEKeyInRange() is called with RNG_RETURN_BEHAVIOR_CALLBACK. More... | |
typedef void(* | RNG_RandomBitsCallbackFxn) (RNG_Handle handle, int_fast16_t returnValue, uint8_t *randomBits, size_t randomBitsLength) |
The definition of a callback function used by the RNG driver when RNG_getRandomBits(), RNG_getLERandomNumberInRange(), or RNG_getBERandomNumberInRange is called with RNG_RETURN_BEHAVIOR_CALLBACK. More... | |
Enumerations | |
enum | RNG_ReturnBehavior { RNG_RETURN_BEHAVIOR_CALLBACK = 1, RNG_RETURN_BEHAVIOR_BLOCKING = 2, RNG_RETURN_BEHAVIOR_POLLING = 4 } |
The way in which RNG function calls return after generating the requested entropy. More... | |
Functions | |
int_fast16_t | RNG_init (void) |
This function initializes the RNG module. More... | |
int_fast16_t | RNG_fillPoolIfLessThan (size_t bytes) |
Fills the pool with entropy if the number of bytes with entropy in the pool is less than the value specified. More... | |
void | RNG_Params_init (RNG_Params *params) |
Function to initialize the RNG_Params struct to its defaults. More... | |
RNG_Handle | RNG_open (uint_least8_t index, const RNG_Params *params) |
This function opens a given RNG peripheral. More... | |
void | RNG_close (RNG_Handle handle) |
Function to close a RNG peripheral specified by the RNG handle. More... | |
int_fast16_t | RNG_getRandomBits (RNG_Handle handle, void *randomBits, size_t randomBitsLength) |
Generate random bits and output to the given array. More... | |
int_fast16_t | RNG_getLERandomNumberInRange (RNG_Handle handle, const void *lowerLimit, const void *upperLimit, void *randomNumber, size_t randomNumberBitLength) |
Generate random number, stored in little-endian (LE) format, where the number is within the specified range. More... | |
int_fast16_t | RNG_getBERandomNumberInRange (RNG_Handle handle, const void *lowerLimit, const void *upperLimit, void *randomNumber, size_t randomNumberBitLength) |
Generate random number, stored in big-endian (BE) format, where the number is within the specified range. More... | |
int_fast16_t | RNG_generateKey (RNG_Handle handle, CryptoKey *key) |
Generate random bits and output them to the given CryptoKey object. More... | |
int_fast16_t | RNG_generateLEKeyInRange (RNG_Handle handle, const void *lowerLimit, const void *upperLimit, CryptoKey *key, size_t randomNumberBitLength) |
Generate random number, in little-endian (LE) format, where the number is within the specified range. Store the random number in the given CryptoKey object. More... | |
int_fast16_t | RNG_generateBEKeyInRange (RNG_Handle handle, const void *lowerLimit, const void *upperLimit, CryptoKey *key, size_t randomNumberBitLength) |
Generate random number, stored in big-endian (BE) format, where the number is within the specified range. Store the random number in the given CryptoKey object. More... | |
RNG_Handle | RNG_construct (const RNG_Config *config, const RNG_Params *params) |
Constructs a new RNG object. More... | |
int_fast16_t | RNG_cancelOperation (RNG_Handle handle) |
Aborts an ongoing RNG operation and clears internal buffers. More... | |
Variables | |
const RNG_Params | RNG_defaultParams |
Default RNG_Params structure. More... | |
const size_t | RNG_poolByteSize |
The byte size of the pool. More... | |
#define RNG_STATUS_RESERVED (-32) |
Common RNG status code reservation offset. RNG driver implementations should offset status codes with RNG_STATUS_RESERVED growing negatively.
Example implementation specific status codes:
#define RNG_STATUS_SUCCESS ((int_fast16_t)0) |
Successful status code.
Functions return RNG_STATUS_SUCCESS if the function was executed successfully.
#define RNG_STATUS_ERROR ((int_fast16_t)-1) |
Generic error status code.
Functions return RNG_STATUS_ERROR if the function was not executed successfully.
#define RNG_STATUS_RESOURCE_UNAVAILABLE ((int_fast16_t)-2) |
An error status code returned if the hardware or software resource is currently unavailable.
RNG driver implementations may have hardware or software limitations on how many clients can simultaneously perform operations. This status code is returned if the mutual exclusion mechanism signals that an operation cannot currently be performed.
#define RNG_STATUS_INVALID_INPUTS ((int_fast16_t)-3) |
Operation failed due to invalid inputs.
Functions return RNG_STATUS_INVALID_INPUTS if input validation fails.
#define RNG_STATUS_CANCELED ((int_fast16_t)-4) |
The ongoing operation was canceled.
#define RNG_ENTROPY_EXHAUSTED ((int_fast16_t)-5) |
The pool of entropy has been exhausted and additional entropy cannot be generated. A reset of the system may be required to generate more entropy.
#define RNG_STATUS_INIT_NOT_ALLOWED ((int_fast16_t)-6) |
Some implementations have restrictions on how often or when RNG_init may be called. See the documentation for the implementation for more information.
#define RNG_STATUS_NOISE_INPUT_INVALID ((int_fast16_t)-7) |
Some implementations require a noise input during initialization which is conditioned to seed the RNG driver. RNG_init() will return this error if the noise input pointer is not intialized with valid information. See documentation for the implementation for more information.
#define RNG_STATUS_NOT_INITIALIZED ((int_fast16_t)-7) |
RNG driver not intialized.
#define RNG_MAX_BIT_LENGTH ((size_t)1u << 20u) /* 1 MiB */ |
Maximum number of bits that may be requested in a single call.
typedef const RNG_Config* RNG_Handle |
A handle that is returned from a RNG_open() call.
typedef void(* RNG_CryptoKeyCallbackFxn) (RNG_Handle handle, int_fast16_t returnValue, CryptoKey *key) |
The definition of a callback function used by the RNG driver when RNG_generateKey(), RNG_generateLEKeyInRange(), or RNG_generateBEKeyInRange() is called with RNG_RETURN_BEHAVIOR_CALLBACK.
handle | Handle of the client that started the RNG operation. |
returnValue | Return status code describing the outcome of the operation. |
key | The CryptoKey that describes the location the generated entropy will be copied to. |
typedef void(* RNG_RandomBitsCallbackFxn) (RNG_Handle handle, int_fast16_t returnValue, uint8_t *randomBits, size_t randomBitsLength) |
The definition of a callback function used by the RNG driver when RNG_getRandomBits(), RNG_getLERandomNumberInRange(), or RNG_getBERandomNumberInRange is called with RNG_RETURN_BEHAVIOR_CALLBACK.
handle | Handle of the client that started the RNG operation. |
returnValue | Return status code describing the outcome of the operation. |
randomBits | Pointer to an array that stores the random bits output by this function. |
randomBitsLength | The length of the random data generated, in bits. |
enum RNG_ReturnBehavior |
The way in which RNG function calls return after generating the requested entropy.
Not all RNG implementations support all of the return behavior options.
Not all RNG operations exhibit the specified return behavior. Functions that do not require significant computation and cannot offload that computation to a background thread behave like regular functions. Which functions exhibit the specified return behavior is not implementation dependent. Specifically, a software-backed implementation run on the same CPU as the application will emulate the return behavior while not actually offloading the computation to the background thread.
RNG functions exhibiting the specified return behavior have restrictions on the context from which they may be called.
Task | Hwi | Swi | |
---|---|---|---|
RNG_RETURN_BEHAVIOR_CALLBACK | X | ||
RNG_RETURN_BEHAVIOR_BLOCKING | X | ||
RNG_RETURN_BEHAVIOR_POLLING | X | X | X |
int_fast16_t RNG_init | ( | void | ) |
This function initializes the RNG module.
RNG_STATUS_SUCCESS | The operation succeeded. |
RNG_STATUS_ERROR | The operation failed. |
RNG_STATUS_RESOURCE_UNAVAILABLE | The required hardware resource was not available. Try again later. |
int_fast16_t RNG_fillPoolIfLessThan | ( | size_t | bytes | ) |
Fills the pool with entropy if the number of bytes with entropy in the pool is less than the value specified.
bytes | Pool will be filled if current level is less than this number. Use RNG_POOL_BYTE_SIZE (from ti_drivers_config.h) to always fill. |
RNG_STATUS_SUCCESS | The operation succeeded. |
RNG_STATUS_ERROR | The operation failed. |
RNG_STATUS_RESOURCE_UNAVAILABLE | The required hardware resource was not available. Try again later. |
RNG_ENTROPY_EXHAUSTED | Pool could not be refilled, device may need reset. |
RNG_STATUS_NOT_INITIALIZED | RNG not intialized. |
void RNG_Params_init | ( | RNG_Params * | params | ) |
Function to initialize the RNG_Params struct to its defaults.
params | An pointer to RNG_Params structure for initialization |
Default values are:
returnBehavior = RNG_RETURN_BEHAVIOR_BLOCKING
cryptoKeyCallbackFxn = NULL
randomBitsCallbackFxn = NULL
timeout = SemaphoreP_WAIT_FOREVER
custom = NULL
RNG_Handle RNG_open | ( | uint_least8_t | index, |
const RNG_Params * | params | ||
) |
This function opens a given RNG peripheral.
index | Logical peripheral number for the RNG indexed into the RNG_config table |
params | Pointer to an parameter block, if NULL it will use default values. |
void RNG_close | ( | RNG_Handle | handle | ) |
Function to close a RNG peripheral specified by the RNG handle.
handle | A RNG handle returned from RNG_open() |
int_fast16_t RNG_getRandomBits | ( | RNG_Handle | handle, |
void * | randomBits, | ||
size_t | randomBitsLength | ||
) |
Generate random bits and output to the given array.
Generates random a random number of bits with length of randomBitsLength
. The output length in bytes will be the minimum number of bytes needed to contain randomBitsLength
. The output will be placed at the address pointed to by randomBits
. The user shall be responsible for allocating sufficient memory starting at the address pointed at by randomBits
to hold the number of bytes output.
CryptoKey
instead.handle | A RNG handle returned from RNG_open(). |
randomBits | Pointer to an array that stores the random bits output by this function. |
randomBitsLength | The length of the random data required, in bits. A maximum of 1MiB is allowed. |
RNG_STATUS_SUCCESS | The operation succeeded. |
RNG_STATUS_ERROR | The operation failed. |
RNG_STATUS_RESOURCE_UNAVAILABLE | The required hardware resource was not available. Try again later. |
RNG_STATUS_INVALID_INPUTS | Inputs provided are not valid. |
RNG_ENTROPY_EXHAUSTED | Requested number of bytes could not be obtained. Device may need reset. |
RNG_STATUS_NOT_INITIALIZED | RNG not intialized. |
int_fast16_t RNG_getLERandomNumberInRange | ( | RNG_Handle | handle, |
const void * | lowerLimit, | ||
const void * | upperLimit, | ||
void * | randomNumber, | ||
size_t | randomNumberBitLength | ||
) |
Generate random number, stored in little-endian (LE) format, where the number is within the specified range.
Generates random a random number within the range [lowerLimit, upperLimit) of bit size randomNumberBitLength
. The output length in bytes will be the minimum number of bytes needed to contain randomNumberBitLength
. The output will be placed at the address pointed to by randomNumber
. The user shall be responsible for allocating sufficient memory starting at the address pointed at by randomNumber
to hold the number of bytes output.
Note that the special values of CryptoUtils_limitZero and CryptoUtils_limitOne are available to pass in for the lowerLimit
. (These values can also be used for the upperLimit
but their use for the upperLimit has no practical use.)
If lowerLimit
is NULL then the lower limit is taken as 0. If upperLimit
is NULL then the upper limit is taken as 2(bitLength
+ 1).
CryptoKey
instead.handle | A RNG handle returned from RNG_open(). |
lowerLimit | Pointer to an array that stores the lower limit (inclusive) in LE format for the generated number. |
upperLimit | Pointer to an array that stores the upper limit (exclusive) in LE format for the generated number. |
randomNumber | Pointer to an array that stores the random number output by this function. |
randomNumberBitLength | The length, in bits, of both the limit values and the random number to be generated. |
RNG_STATUS_SUCCESS | The operation succeeded. |
RNG_STATUS_ERROR | The operation failed. |
RNG_STATUS_RESOURCE_UNAVAILABLE | The required hardware resource was not available. Try again later. |
RNG_STATUS_INVALID_INPUTS | Inputs provided are not valid. |
RNG_ENTROPY_EXHAUSTED | Requested number of bytes could not be obtained. Device may need reset. |
RNG_STATUS_NOT_INITIALIZED | RNG not intialized. |
int_fast16_t RNG_getBERandomNumberInRange | ( | RNG_Handle | handle, |
const void * | lowerLimit, | ||
const void * | upperLimit, | ||
void * | randomNumber, | ||
size_t | randomNumberBitLength | ||
) |
Generate random number, stored in big-endian (BE) format, where the number is within the specified range.
Generates random a random number within the range [lowerLimit, upperLimit) of bit size randomNumberBitLength
. The output length in bytes will be the minimum number of bytes needed to contain randomNumberBitLength
. The output will be placed at the address pointed to by randomNumber
. The user shall be responsible for allocating sufficient memory starting at the address pointed at by randomNumber
to hold the number of bytes output.
Note that the special values of CryptoUtils_limitZero and CryptoUtils_limitOne are available to pass in for the lowerLimit
. (These values can also be used for the upperLimit
but their use for the upperLimit has no practical use.)
If lowerLimit
is NULL then the lower limit is taken as 0. If upperLimit
is NULL then the upper limit is taken as 2(bitLength
+ 1).
CryptoKey
instead.handle | A RNG handle returned from RNG_open(). |
lowerLimit | Pointer to an array that stores the lower limit (inclusive) in BE format for the generated number. |
upperLimit | Pointer to an array that stores the upper limit (exclusive) in BE format for the generated number. |
randomNumber | Pointer to an array that stores the random number output by this function. |
randomNumberBitLength | The length, in bits, of both the limit value and the random number to be generated. |
RNG_STATUS_SUCCESS | The operation succeeded. |
RNG_STATUS_ERROR | The operation failed. |
RNG_STATUS_RESOURCE_UNAVAILABLE | The required hardware resource was not available. Try again later. |
RNG_STATUS_INVALID_INPUTS | Inputs provided are not valid. |
RNG_ENTROPY_EXHAUSTED | Requested number of bytes could not be obtained. Device may need reset. |
RNG_STATUS_NOT_INITIALIZED | RNG not intialized. |
int_fast16_t RNG_generateKey | ( | RNG_Handle | handle, |
CryptoKey * | key | ||
) |
Generate random bits and output them to the given CryptoKey
object.
Generates a random bitstream of the size defined in the key
CryptoKey in the range 0 <= key
buffer < 2 ^ (entropy length * 8). The entropy will be generated and stored according to the storage requirements defined in the CryptoKey. The length of the entropy generated will be the same as the key length.
handle | A RNG handle returned from RNG_open(). |
key | Pointer to a blank CryptoKey, initialized with a length and appropriate storage for storing a key of the specified length. |
RNG_STATUS_SUCCESS | The operation succeeded. |
RNG_STATUS_ERROR | The operation failed. |
RNG_STATUS_RESOURCE_UNAVAILABLE | The required hardware resource was not available. Try again later. |
RNG_STATUS_INVALID_INPUTS | Inputs provided are not valid. |
RNG_ENTROPY_EXHAUSTED | Requested number of bytes could not be obtained. Device may need reset. |
RNG_STATUS_NOT_INITIALIZED | RNG not intialized. |
int_fast16_t RNG_generateLEKeyInRange | ( | RNG_Handle | handle, |
const void * | lowerLimit, | ||
const void * | upperLimit, | ||
CryptoKey * | key, | ||
size_t | randomNumberBitLength | ||
) |
Generate random number, in little-endian (LE) format, where the number is within the specified range. Store the random number in the given CryptoKey
object.
Generates a random number within the range [lowerLimit, upperLimit) of bit size randomNumberBitLength
. The output length in bytes will be the minimum number of bytes needed to contain randomNumberBitLength
. The output will be placed as specified by the members of key
.
Note that the special values of CryptoUtils_limitZero and CryptoUtils_limitOne are available to pass in for the lowerLimit
. (These values can also be used for the upperLimit
but their use for the upperLimit has no practical use.)
If lowerLimit
is NULL then the lower limit is taken as 0. If upperLimit
is NULL then the upper limit is taken as 2(bitLength
+ 1).
handle | A RNG handle returned from RNG_open(). |
lowerLimit | Pointer to an array that stores the lower limit (inclusive) in LE format for the generated number. |
upperLimit | Pointer to an array that stores the upper limit (exclusive) in LE format for the generated number. |
key | Pointer to a blank CryptoKey, initialized with a length and appropriate storage for storing a key of the specified length. |
randomNumberBitLength | The length, in bits, of both the limit values and the random number to be generated. |
RNG_STATUS_SUCCESS | The operation succeeded. |
RNG_STATUS_ERROR | The operation failed. |
RNG_STATUS_RESOURCE_UNAVAILABLE | The required hardware resource was not available. Try again later. |
RNG_STATUS_INVALID_INPUTS | Inputs provided are not valid. |
RNG_ENTROPY_EXHAUSTED | Requested number of bytes could not be obtained. Device may need reset. |
RNG_STATUS_NOT_INITIALIZED | RNG not intialized. |
int_fast16_t RNG_generateBEKeyInRange | ( | RNG_Handle | handle, |
const void * | lowerLimit, | ||
const void * | upperLimit, | ||
CryptoKey * | key, | ||
size_t | randomNumberBitLength | ||
) |
Generate random number, stored in big-endian (BE) format, where the number is within the specified range. Store the random number in the given CryptoKey
object.
Generates a random number within the range [lowerLimit, upperLimit) of bit size randomNumberBitLength
. The output length in bytes will be the minimum number of bytes needed to contain randomNumberBitLength
. The output will be placed as specified by the members of key
.
Note that the special values of CryptoUtils_limitZero and CryptoUtils_limitOne are available to pass in for the lowerLimit
. (These values can also be used for the upperLimit
but their use for the upperLimit has no practical use.)
If lowerLimit
is NULL then the lower limit is taken as 0. If upperLimit
is NULL then the upper limit is taken as 2(bitLength
+ 1).
handle | A RNG handle returned from RNG_open(). |
lowerLimit | Pointer to an array that stores the lower limit (inclusive) in BE format for the generated number. |
upperLimit | Pointer to an array that stores the upper limit (exclusive) in BE format for the generated number. |
key | Pointer to a blank CryptoKey, initialized with a length and appropriate storage for storing a key of the specified length. |
randomNumberBitLength | The length, in bits, of both the limit values and the random number to be generated. |
RNG_STATUS_SUCCESS | The operation succeeded. |
RNG_STATUS_ERROR | The operation failed. |
RNG_STATUS_RESOURCE_UNAVAILABLE | The required hardware resource was not available. Try again later. |
RNG_STATUS_INVALID_INPUTS | Inputs provided are not valid. |
RNG_ENTROPY_EXHAUSTED | Requested number of bytes could not be obtained. Device may need reset. |
RNG_STATUS_NOT_INITIALIZED | RNG not intialized. |
RNG_Handle RNG_construct | ( | const RNG_Config * | config, |
const RNG_Params * | params | ||
) |
Constructs a new RNG object.
Unlike RNG_open(), RNG_construct() does not require the hwAttrs and object to be allocated in a RNG_Config array that is indexed into. Instead, the RNG_Config, hwAttrs, and object can be allocated at any location. This allows for relatively simple run-time allocation of temporary driver instances on the stack or the heap. The drawback is that this makes it more difficult to write device-agnostic code. If you use an ifdef with DeviceFamily, you can choose the correct object and hwAttrs to allocate. That compilation unit will be tied to the device it was compiled for at this point. To change devices, recompilation of the application with a different DeviceFamily setting is necessary.
config | RNG_Config describing the location of the object and hwAttrs. |
params | RNG_Params to configure the driver instance. |
config
points to must be zeroed out prior to calling this function. Otherwise, unexpected behavior may ensue. int_fast16_t RNG_cancelOperation | ( | RNG_Handle | handle | ) |
Aborts an ongoing RNG operation and clears internal buffers.
Aborts an operation to generate random bytes/entropy. The operation will terminate as though an error occurred and the status code of the operation will be RNG_STATUS_CANCELED in this case.
Any entropy already copied out of the pool will have already been removed from the pool and will not be reused for later requests.
Canceling an operation may be delayed if the entropy pool is below its minimum fill mark as the driver will refill the pool before finishing the cancelled operation.
handle | A RNG_Handle returned from RNG_open() |
RNG_STATUS_SUCCESS | The operation was canceled or there was no operation in progress to be canceled. |
const RNG_Params RNG_defaultParams |
Default RNG_Params structure.
const size_t RNG_poolByteSize |
The byte size of the pool.