activemq-cpp-3.9.0
|
#include <src/main/decaf/security/SecureRandom.h>
Public Member Functions | |
SecureRandom () | |
Creates a new instance of a secure random number generator that implements the default random number algorithm. More... | |
SecureRandom (const std::vector< unsigned char > &seed) | |
Creates a new instance of a secure random number generator that implements the default random number algorithm. More... | |
SecureRandom (const unsigned char *seed, int size) | |
Creates a new instance of a secure random number generator that implements the default random number algorithm. More... | |
virtual | ~SecureRandom () |
virtual void | nextBytes (std::vector< unsigned char > &buf) |
Modifies the byte array by a random sequence of bytes generated by this random number generator. More... | |
virtual void | nextBytes (unsigned char *buf, int size) |
Modifies the byte array by a random sequence of bytes generated by this random number generator. More... | |
virtual void | setSeed (unsigned long long seed) |
Modifies the seed using linear congruential formula presented in The Art of Computer Programming, Volume 2, Section 3.2.1. More... | |
virtual void | setSeed (const std::vector< unsigned char > &seed) |
Supplements or sets the seed of this secure random number generator, calls to this method never reduces randomness. More... | |
virtual void | setSeed (const unsigned char *seed, int size) |
Supplements or sets the seed of this secure random number generator, calls to this method never reduces randomness. More... | |
![]() | |
Random () | |
Construct a random generator with the current time of day in milliseconds as the initial state. More... | |
Random (unsigned long long seed) | |
Construct a random generator with the given seed as the initial state. More... | |
virtual | ~Random () |
bool | nextBoolean () |
Answers the next pseudo-random, uniformly distributed boolean value generated by this generator. More... | |
double | nextDouble () |
Generates a normally distributed random double number between 0.0 inclusively and 1.0 exclusively. More... | |
float | nextFloat () |
Generates a normally distributed random float number between 0.0 inclusively and 1.0 exclusively. More... | |
double | nextGaussian () |
Pseudo-randomly generates (approximately) a normally distributed double value with mean 0.0 and a standard deviation value of 1.0 using the polar method of G. More... | |
int | nextInt () |
Generates a uniformly distributed 32-bit int value from the this random number sequence. More... | |
int | nextInt (int n) |
Returns to the caller a new pseudo-random integer value which is uniformly distributed between 0 (inclusively) and the value of n (exclusively). More... | |
long long | nextLong () |
Generates a uniformly distributed 64-bit int value from the this random number sequence. More... | |
Protected Member Functions | |
virtual int | next (int bits) |
Answers a pseudo-random uniformly distributed int value of the number of bits specified by the argument bits as described by Donald E. More... | |
decaf::security::SecureRandom::SecureRandom | ( | ) |
Creates a new instance of a secure random number generator that implements the default random number algorithm.
The SecureRandom instance that is created with this constructor is unseeded and can be seeded by calling the setSeed method. Calls to nextBytes on an unseeded SecureRandom result in the object seeding itself.
decaf::security::SecureRandom::SecureRandom | ( | const std::vector< unsigned char > & | seed | ) |
Creates a new instance of a secure random number generator that implements the default random number algorithm.
The SecureRandom instance created by this constructor is seeded using the passed byte array.
seed | The seed bytes to use to seed this secure random number generator. |
decaf::security::SecureRandom::SecureRandom | ( | const unsigned char * | seed, |
int | size | ||
) |
Creates a new instance of a secure random number generator that implements the default random number algorithm.
The SecureRandom instance created by this constructor is seeded using the passed byte array.
seed | The seed bytes to use to seed this secure random number generator. |
size | The number of bytes in the seed buffer. |
NullPointerException | if the seed buffer is NULL. |
IllegalArgumentException | if the size value is negative. |
|
virtual |
|
protectedvirtual |
Answers a pseudo-random uniformly distributed int
value of the number of bits specified by the argument bits
as described by Donald E.
Knuth in The Art of Computer Programming, Volume 2: Seminumerical Algorithms, section 3.2.1.
bits | number of bits of the returned value |
Reimplemented from decaf::util::Random.
|
virtual |
Modifies the byte array by a random sequence of bytes generated by this random number generator.
buf | non-null array to contain the new random bytes |
Reimplemented from decaf::util::Random.
|
virtual |
Modifies the byte array by a random sequence of bytes generated by this random number generator.
buf | non-null array to contain the new random bytes |
NullPointerException | if buff is NULL |
IllegalArgumentException | if size is negative |
Reimplemented from decaf::util::Random.
|
virtual |
Modifies the seed using linear congruential formula presented in The Art of Computer Programming, Volume 2, Section 3.2.1.
seed | the seed that alters the state of the random number generator |
Reimplemented from decaf::util::Random.
|
virtual |
Supplements or sets the seed of this secure random number generator, calls to this method never reduces randomness.
seed | A vector of bytes that is used update the seed of the RNG. |
|
virtual |
Supplements or sets the seed of this secure random number generator, calls to this method never reduces randomness.
seed | The seed bytes to use to seed this secure random number generator. |
size | The number of bytes in the seed buffer. |
NullPointerException | if the seed buffer is NULL. |
IllegalArgumentException | if the size value is negative. |