Exemple #1
0
int Random::randomInt()
{
	QMutexLocker locker(global_random_mutex());
	SecureArray a = global_random()->nextBytes(sizeof(int));
	int x;
	memcpy(&x, a.data(), a.size());
	return x;
}
Exemple #2
0
bool haveSecureRandom()
{
	if(!global_check_load())
		return false;

	QMutexLocker locker(global_random_mutex());
	if(global_random()->provider()->name() != "default")
		return true;

	return false;
}
Exemple #3
0
SecureArray Random::randomArray(int size)
{
	QMutexLocker locker(global_random_mutex());
	return global_random()->nextBytes(size);
}
Exemple #4
0
uchar Random::randomChar()
{
	QMutexLocker locker(global_random_mutex());
	return global_random()->nextByte();
}