iPXE
linux_entropy.h
Go to the documentation of this file.
00001 #ifndef _IPXE_LINUX_ENTROPY_H
00002 #define _IPXE_LINUX_ENTROPY_H
00003 
00004 /** @file
00005  *
00006  * /dev/random-based entropy source
00007  *
00008  */
00009 
00010 FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
00011 
00012 #ifdef ENTROPY_LINUX
00013 #define ENTROPY_PREFIX_linux
00014 #else
00015 #define ENTROPY_PREFIX_linux __linux_
00016 #endif
00017 
00018 /**
00019  * min-entropy per sample
00020  *
00021  * @ret min_entropy     min-entropy of each sample
00022  */
00023 static inline __always_inline min_entropy_t
00024 ENTROPY_INLINE ( linux, min_entropy_per_sample ) ( void ) {
00025 
00026         /* linux_get_noise() reads a single byte from /dev/random,
00027          * which is supposed to block until a sufficient amount of
00028          * entropy is available.  We therefore assume that each sample
00029          * contains exactly 8 bits of entropy.
00030          */
00031         return MIN_ENTROPY ( 8.0 );
00032 }
00033 
00034 #endif /* _IPXE_LINUX_ENTROPY_H */