random_bytes()-related improvements

See #4260
3 files changed