scclib
Stable Cloud Computing C++ Library
Public Types | Public Member Functions | Static Public Member Functions | List of all members
scc::crypto::RandomEngine Class Reference

The random number generator is initialized with random entropy on first use. More...

#include <random.h>

Public Types

typedef int result_type
 Required for UniformRandomBitGenerator interface.
 

Public Member Functions

int operator() ()
 Required for UniformRandomBitGenerator interface.
 
constexpr int min ()
 Required for UniformRandomBitGenerator interface.
 
constexpr int max ()
 Required for UniformRandomBitGenerator interface.
 

Static Public Member Functions

static void * ctx ()
 Opaque reference to the number generator.
 
static void lock ()
 Lock the number generator while the opaque reference is in use.
 
static void unlock ()
 Unlock the number generator.
 
static void random_seed ()
 Generate a random seed and seed the generator with it.
 
static void seed (const void *, int len)
 Seed the generator.
 
static void seed (const std::string &buf)
 Seed the generator.
 
static void rand_bytes (void *, int len)
 Generate random bytes.
 
static uint32_t rand_uint32 ()
 Generate random word.
 
static int32_t rand_int32 ()
 Generate random word.
 
static uint64_t rand_uint64 ()
 Generate random long word.
 
static int64_t rand_int64 ()
 Generate random long word.
 

Detailed Description

The random number generator is initialized with random entropy on first use.

The same seed will generate different bit sequences between runs.

Examples
crypto/unittest/random.cc.

Definition at line 57 of file random.h.


The documentation for this class was generated from the following file: