snej / monocypher-cpp

An idiomatic C++ wrapper for the Monocypher crypto library
Other
11 stars 0 forks source link

Cross-platform RNG #4

Closed snej closed 4 years ago

snej commented 4 years ago

arc4random_buf is not available cross-platform. As I said in #3:

I misled myself about arc4random — the main project I work on uses it on Apple/Linux/Windows, so I thought it was built-in, but it turns out that's because we have a shim that implements it on platforms where it's not present. However, I've noticed that C++ has std::random_device which is defined as a nondeterministic RNG except on platforms where that doesn't exist (i.e. embedded systems, I guess.) I may consider using that instead.