src/lib/entropy/getentropy/getentropy.cpp
/**
* Gather 256 bytes entropy from getentropy(2).  Note that maximum
* buffer size is limited to 256 bytes.  On OpenBSD this does neither
* block nor fail.
*/
Gather 256 bytes entropy from getentropy(2).  Note that maximum
buffer size is limited to 256 bytes.  On OpenBSD this does neither
block nor fail.
Gather 256 bytes entropy from getentropy ( 2 ) . Note that maximum buffer size is limited to 256 bytes . On OpenBSD this does neither block nor fail .
size_t Getentropy::poll(RandomNumberGenerator& rng)
   {
   secure_vector<uint8_t> buf(256);
   if(::getentropy(buf.data(), buf.size()) == 0)
      {
      rng.add_entropy(buf.data(), buf.size());
      return buf.size() * 8;
      }
   return 0;
   }
size_t Getentropy :: poll ( RandomNumberGenerator & rng ) { secure_vector < uint8_t > buf ( 256 ) ; if ( :: getentropy ( buf . data ( ) , buf . size ( ) ) == 0 ) { rng . add_entropy ( buf . data ( ) , buf . size ( ) ) ; return buf . size ( ) * 8 ; } return 0 ; }
Gather 256 bytes entropy from getentropy(2).
Gather 256 bytes entropy from getentropy ( 2 ) .