aboutsummaryrefslogtreecommitdiff
path: root/rng.cpp
blob: f149425554008d595c0aac46abc4c3bd9b50ce01 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include <stdexcept>
#include <cstring>
#include <cassert>
#include "rng.h"

#ifdef __APPLE__
#include <cstdlib>
#else
#include <bsd/stdlib.h>
#endif

using namespace std;


uint32_t CryptoRng::get(){
	return arc4random();
}

uint32_t CryptoRng::get_uniform(uint32_t upbound){
	return arc4random_uniform(upbound);
}