SecureRand.cpp File Reference

#include "blocxx/BLOCXX_config.h"
#include "blocxx/Array.hpp"
#include "blocxx/Assertion.hpp"
#include "blocxx/Exec.hpp"
#include "blocxx/FileSystem.hpp"
#include "blocxx/Mutex.hpp"
#include "blocxx/MutexLock.hpp"
#include "blocxx/GlobalMutex.hpp"
#include "blocxx/Secure.hpp"
#include "blocxx/SecureRand.hpp"
#include "blocxx/SSLCtxMgr.hpp"
#include "blocxx/String.hpp"
#include "blocxx/Thread.hpp"
#include "blocxx/ThreadOnce.hpp"
#include "blocxx/UnnamedPipe.hpp"
#include "blocxx/UserUtils.hpp"
#include "blocxx/Process.hpp"
#include <cmath>
#include <csignal>
#include <cstring>
#include <limits>
#include <unistd.h>
#include <fcntl.h>
#include <openssl/rand.h>
#include <openssl/err.h>
#include <sys/resource.h>
#include <sys/time.h>

Go to the source code of this file.


Classes

struct  BLOCXX_NAMESPACE::Secure::Impl::log2< N >
struct  BLOCXX_NAMESPACE::Secure::Impl::log2< 1 >
struct  BLOCXX_NAMESPACE::Secure::Impl::bits_precision< Number >

Namespaces

namespace  BLOCXX_NAMESPACE
 Taken from RFC 1321.
namespace  BLOCXX_NAMESPACE::Secure
namespace  BLOCXX_NAMESPACE::Secure::Impl

Functions

void BLOCXX_NAMESPACE::Secure::rand_init ()
 Initializes and seeds the cryptographic PRNG, if this has not been done already.
unsigned char * BLOCXX_NAMESPACE::Secure::rand (unsigned char *buf, std::size_t n)
 Generates n cryptographically secure pseudo-random bytes and stores them in buf.
::pid_t BLOCXX_NAMESPACE::Secure::fork_reseed ()
 Forks and reseeds the PRNG so that a compromise of the child cannot compromise the parent's PRNG state, and a compromise of the parent cannot compromise the child's PRNG state.
template<typename UnsignedInt >
UnsignedInt BLOCXX_NAMESPACE::Secure::Impl::rand_uint_lt (UnsignedInt n)
template unsigned char BLOCXX_NAMESPACE::Secure::Impl::rand_uint_lt< unsigned char > (unsigned char)
template unsigned short BLOCXX_NAMESPACE::Secure::Impl::rand_uint_lt< unsigned short > (unsigned short)
template unsigned int BLOCXX_NAMESPACE::Secure::Impl::rand_uint_lt< unsigned int > (unsigned int)
template unsigned long BLOCXX_NAMESPACE::Secure::Impl::rand_uint_lt< unsigned long > (unsigned long)
template unsigned long long BLOCXX_NAMESPACE::Secure::Impl::rand_uint_lt< unsigned long long > (unsigned long long)
template<typename Integer >
Integer BLOCXX_NAMESPACE::Secure::Impl::rand_range (Integer min_value, Integer max_value)
template char BLOCXX_NAMESPACE::Secure::Impl::rand_range (char, char)
template signed char BLOCXX_NAMESPACE::Secure::Impl::rand_range (signed char, signed char)
template unsigned char BLOCXX_NAMESPACE::Secure::Impl::rand_range (unsigned char, unsigned char)
template short BLOCXX_NAMESPACE::Secure::Impl::rand_range (short, short)
template int BLOCXX_NAMESPACE::Secure::Impl::rand_range (int, int)
template long BLOCXX_NAMESPACE::Secure::Impl::rand_range (long, long)
template unsigned long long BLOCXX_NAMESPACE::Secure::Impl::rand_range (unsigned long long, unsigned long long)
template<typename Real >
Real BLOCXX_NAMESPACE::Secure::Impl::rand_unit_interval ()
template float BLOCXX_NAMESPACE::Secure::Impl::rand_unit_interval< float > ()
template double BLOCXX_NAMESPACE::Secure::Impl::rand_unit_interval< double > ()
template long double BLOCXX_NAMESPACE::Secure::Impl::rand_unit_interval< long double > ()
void BLOCXX_NAMESPACE::Secure::rand_save_state ()
static void randomALRMHandler (int sig)


Function Documentation

static void randomALRMHandler ( int  sig  )  [static]

Definition at line 372 of file SecureRand.cpp.


doxygen