Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /************************************
- * @enum sampling\_mode
- * Defines sampling modes for @b csrand\_init
- */
- enum sampling_mode {
- SAMPLING_THOROUGH,
- SAMPLING_FAST
- };
- /*******************************************************************************
- * @brief Initializes the secure psuedo-random generator
- * @param sampling_mode Sampling mode to use for finding an entropic bit. See @b sampling_mode.
- * @return [bool] True if init succeeded, False otherwise
- * @note Sampling mode controls the speed (and accuracy) of the source-selection algorithm.
- * Setting SAMPLING\_THOROUGH retrieves 1024 samples per bit polled and takes ~4 seconds to run.
- * Setting SAMPLING\_FAST retrieves 512 samples per bit polled and takes ~2 seconds to run.
- * @note Using the faster sampling mode may result in a less-entropic source byte being selected due to less
- * samples being collected. It is recommended to use THOROUGH.
- */
- bool csrand_init(bool sampling_mode);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement