| Vernon Mauery | 8977d12 | 2018-10-24 14:02:16 -0700 | [diff] [blame] | 1 | #include <openssl/rand.h> |
| 2 | |||||
| 3 | namespace crypto | ||||
| 4 | { | ||||
| 5 | |||||
| 6 | struct prng | ||||
| 7 | { | ||||
| 8 | static unsigned int rand() | ||||
| 9 | { | ||||
| 10 | unsigned int v; | ||||
| 11 | RAND_bytes(reinterpret_cast<unsigned char*>(&v), sizeof(v)); | ||||
| 12 | return v; | ||||
| 13 | } | ||||
| 14 | }; | ||||
| 15 | |||||
| 16 | } // namespace crypto | ||||