325 #ifndef ti_drivers_RNG__include 326 #define ti_drivers_RNG__include 350 #define RNG_STATUS_RESERVED (-32) 358 #define RNG_STATUS_SUCCESS ((int_fast16_t)0) 366 #define RNG_STATUS_ERROR ((int_fast16_t)-1) 377 #define RNG_STATUS_RESOURCE_UNAVAILABLE ((int_fast16_t)-2) 384 #define RNG_STATUS_INVALID_INPUTS ((int_fast16_t)-3) 389 #define RNG_STATUS_CANCELED ((int_fast16_t)-4) 396 #define RNG_ENTROPY_EXHAUSTED ((int_fast16_t)-5) 403 #define RNG_STATUS_INIT_NOT_ALLOWED ((int_fast16_t)-6) 411 #define RNG_STATUS_NOISE_INPUT_INVALID ((int_fast16_t)-7) 419 #define RNG_STATUS_NOT_INITIALIZED ((int_fast16_t)-8) 424 #define RNG_MAX_BIT_LENGTH ((size_t)1u << 20u) 533 int_fast16_t returnValue,
535 size_t randomBitsLength);
706 int_fast16_t
RNG_getRandomBits(RNG_Handle handle,
void *randomBits,
size_t randomBitsLength);
762 const void *lowerLimit,
763 const void *upperLimit,
765 size_t randomNumberBitLength);
821 const void *lowerLimit,
822 const void *upperLimit,
824 size_t randomNumberBitLength);
910 const void *lowerLimit,
911 const void *upperLimit,
913 size_t randomNumberBitLength);
966 const void *lowerLimit,
967 const void *upperLimit,
969 size_t randomNumberBitLength);
const RNG_Params RNG_defaultParams
Default RNG_Params structure.
The CryptoKey type is an opaque representation of a cryptographic key.
RNG_ReturnBehavior returnBehavior
Definition: RNG.h:551
int_fast16_t RNG_init(void)
This function initializes the RNG module.
RNG_RandomBitsCallbackFxn randomBitsCallbackFxn
Definition: RNG.h:556
int_fast16_t RNG_generateKey(RNG_Handle handle, CryptoKey *key)
Generate random bits and output them to the given CryptoKey object.
const size_t RNG_poolByteSize
The byte size of the pool.
void * object
Definition: RNG.h:440
CryptoKey datastructure.
Definition: CryptoKey.h:211
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 ra...
RNG_ReturnBehavior
The way in which RNG function calls return after generating the requested entropy.
Definition: RNG.h:477
RNG_Handle RNG_construct(const RNG_Config *config, const RNG_Params *params)
Constructs a new RNG object.
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 ra...
RNG_CryptoKeyCallbackFxn cryptoKeyCallbackFxn
Definition: RNG.h:552
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.
Definition: RNG.h:532
void RNG_close(RNG_Handle handle)
Function to close a RNG peripheral specified by the RNG handle.
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 sp...
void const * hwAttrs
Definition: RNG.h:443
uint32_t timeout
Definition: RNG.h:561
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...
int_fast16_t RNG_getRandomBits(RNG_Handle handle, void *randomBits, size_t randomBitsLength)
Generate random bits and output to the given array.
int_fast16_t RNG_cancelOperation(RNG_Handle handle)
Aborts an ongoing RNG operation and clears internal buffers.
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...
RNG_Handle RNG_open(uint_least8_t index, const RNG_Params *params)
This function opens a given RNG peripheral.
RNG Parameters.
Definition: RNG.h:549
RNG Global configuration.
Definition: RNG.h:437
void RNG_Params_init(RNG_Params *params)
Function to initialize the RNG_Params struct to its defaults.
const RNG_Config * RNG_Handle
A handle that is returned from a RNG_open() call.
Definition: RNG.h:449
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.
Definition: RNG.h:512