From 6b40cf5ebbf288b32de5774da28db5765f756aa5 Mon Sep 17 00:00:00 2001 From: joboet Date: Wed, 21 Aug 2024 13:23:18 +0200 Subject: [PATCH] std: clarify the strength of `DefaultRandomSource` --- library/std/src/random.rs | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/library/std/src/random.rs b/library/std/src/random.rs index 22971ef645c54..e3d143cf8c8bd 100644 --- a/library/std/src/random.rs +++ b/library/std/src/random.rs @@ -10,12 +10,14 @@ use crate::sys::random as sys; /// The default random source. /// -/// This asks the system for the best random data it can provide, meaning the -/// resulting bytes *should* be usable for cryptographic purposes. Check your -/// platform's documentation for the specific guarantees it provides. The high -/// quality of randomness provided by this source means it is quite slow. If -/// you need a larger quantity of random numbers, consider using another random -/// number generator (potentially seeded from this one). +/// This asks the system for random data suitable for cryptographic purposes +/// such as key generation. If security is a concern, consult the platform +/// documentation below for the specific guarantees your target provides. +/// +/// The high quality of randomness provided by this source means it can be quite +/// slow. If you need a large quantity of random numbers and security is not a +/// concern, consider using an alternative random number generator (potentially +/// seeded from this one). /// /// # Underlying sources ///