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