7 * All random functions uses "/dev/urandom".
13 * Returns a random number with a maximum size of 'sizeBits'.
14 * If 'forceSize' is true the size is exactly 'sizeBits', so the highest bit will always be 1.
16 * For example, for 'sizeBits' = 12 and 'forceSize' = true, the returned number will be in the following range:
19 * For 'sizeBits' = 12 and 'forceSize' = false, the returned number will be in the following range:
22 static mpz_class
randSize(int sizeBits
, bool forceSize
= true);
25 * Return a random number n such as:
28 static mpz_class
randLimits(const mpz_class
& from
, const mpz_class
& to
);
30 static mpz_class
randPrime(const int size_bits
);
34 * Read a rand from "/dev/urandom" of size 'size' in byte to the given array 'to'.
36 static void readRand(char* to
, int size
);