Rtos API example
randLIB.h File Reference
Pseudo Random Library API: More...
Go to the source code of this file.
Functions | |
void | randLIB_seed_random (void) |
This library is made for getting random numbers for Timing needs in protocols. | |
void | randLIB_add_seed (uint64_t seed) |
Update seed for pseudo-random generator. | |
uint8_t | randLIB_get_8bit (void) |
Generate 8-bit random number. | |
uint16_t | randLIB_get_16bit (void) |
Generate 16-bit random number. | |
uint32_t | randLIB_get_32bit (void) |
Generate 32-bit random number. | |
uint64_t | randLIB_get_64bit (void) |
Generate 64-bit random number. | |
void * | randLIB_get_n_bytes_random (void *data_ptr, uint8_t count) |
Generate n-bytes random numbers. | |
uint16_t | randLIB_get_random_in_range (uint16_t min, uint16_t max) |
Generate a random number within a range. | |
uint32_t | randLIB_randomise_base (uint32_t base, uint16_t min_factor, uint16_t max_factor) |
Randomise a base 32-bit number by a jitter factor. |
Detailed Description
Pseudo Random Library API:
Network Bootstrap Control API:
- randLIB_seed_random(), Set seed for pseudo random
- randLIB_get_8bit(), Generate 8-bit random number
- randLIB_get_16bit(),Generate 16-bit random number
- randLIB_get_32bit(),Generate 32-bit random number
- randLIB_get_n_bytes_random(), Generate n-bytes random numbers
Definition in file randLIB.h.
Function Documentation
void randLIB_add_seed | ( | uint64_t | seed ) |
uint16_t randLIB_get_16bit | ( | void | ) |
uint32_t randLIB_get_32bit | ( | void | ) |
uint64_t randLIB_get_64bit | ( | void | ) |
uint8_t randLIB_get_8bit | ( | void | ) |
void* randLIB_get_n_bytes_random | ( | void * | data_ptr, |
uint8_t | count | ||
) |
uint16_t randLIB_get_random_in_range | ( | uint16_t | min, |
uint16_t | max | ||
) |
uint32_t randLIB_randomise_base | ( | uint32_t | base, |
uint16_t | min_factor, | ||
uint16_t | max_factor | ||
) |
Randomise a base 32-bit number by a jitter factor.
The result is linearly distributed in the jitter range, which is expressed as fixed-point unsigned 1.15 values. For example, to produce a number in the range [0.75 * base, 1.25 * base], set min_factor to 0x6000 and max_factor to 0xA000.
Result is clamped to 0xFFFFFFFF if it overflows.
- Parameters:
-
base The base 32-bit value min_factor The minimum value for the random factor max_factor The maximum value for the random factor
void randLIB_seed_random | ( | void | ) |
This library is made for getting random numbers for Timing needs in protocols.
**not safe to use for security or cryptographic operations.** Init seed for Pseudo Random.
Makes call(s) to the platform's arm_random_seed_get() to seed the pseudo-random generator.
- Returns:
- None
Generated on Sun Jul 17 2022 08:25:35 by 1.7.2