You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

linux_entropy.h 746B

12345678910111213141516171819202122232425262728293031323334
  1. #ifndef _IPXE_LINUX_ENTROPY_H
  2. #define _IPXE_LINUX_ENTROPY_H
  3. /** @file
  4. *
  5. * /dev/random-based entropy source
  6. *
  7. */
  8. FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
  9. #ifdef ENTROPY_LINUX
  10. #define ENTROPY_PREFIX_linux
  11. #else
  12. #define ENTROPY_PREFIX_linux __linux_
  13. #endif
  14. /**
  15. * min-entropy per sample
  16. *
  17. * @ret min_entropy min-entropy of each sample
  18. */
  19. static inline __always_inline min_entropy_t
  20. ENTROPY_INLINE ( linux, min_entropy_per_sample ) ( void ) {
  21. /* linux_get_noise() reads a single byte from /dev/random,
  22. * which is supposed to block until a sufficient amount of
  23. * entropy is available. We therefore assume that each sample
  24. * contains exactly 8 bits of entropy.
  25. */
  26. return MIN_ENTROPY ( 8.0 );
  27. }
  28. #endif /* _IPXE_LINUX_ENTROPY_H */