Advertisement
AnthonyCagliano

Untitled

Nov 17th, 2022
44
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.95 KB | None | 0 0
  1. /************************************
  2. * @enum sampling\_mode
  3. * Defines sampling modes for @b csrand\_init
  4. */
  5. enum sampling_mode {
  6. SAMPLING_THOROUGH,
  7. SAMPLING_FAST
  8. };
  9.  
  10. /*******************************************************************************
  11. * @brief Initializes the secure psuedo-random generator
  12. * @param sampling_mode Sampling mode to use for finding an entropic bit. See @b sampling_mode.
  13. * @return [bool] True if init succeeded, False otherwise
  14. * @note Sampling mode controls the speed (and accuracy) of the source-selection algorithm.
  15. * Setting SAMPLING\_THOROUGH retrieves 1024 samples per bit polled and takes ~4 seconds to run.
  16. * Setting SAMPLING\_FAST retrieves 512 samples per bit polled and takes ~2 seconds to run.
  17. * @note Using the faster sampling mode may result in a less-entropic source byte being selected due to less
  18. * samples being collected. It is recommended to use THOROUGH.
  19. */
  20. bool csrand_init(bool sampling_mode);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement