diff options
author | Justus Winter <justus@sequoia-pgp.org> | 2020-08-04 16:50:50 +0200 |
---|---|---|
committer | Justus Winter <justus@sequoia-pgp.org> | 2020-08-04 16:50:50 +0200 |
commit | 7561d2a4926fdaacebe4db8131b4b0279458683b (patch) | |
tree | 0733aa3ebffbd31b9456a5cb2a5954b791b637b7 | |
parent | 1a3565b4cd4720273701389688035fd97d340604 (diff) |
openpgp: Improve documentation for crypto::random.
- See #474.
-rw-r--r-- | openpgp/src/crypto/backend/nettle.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/openpgp/src/crypto/backend/nettle.rs b/openpgp/src/crypto/backend/nettle.rs index 8f9fdeb1..724449f9 100644 --- a/openpgp/src/crypto/backend/nettle.rs +++ b/openpgp/src/crypto/backend/nettle.rs @@ -9,6 +9,14 @@ pub mod hash; pub mod symmetric; /// Fills the given buffer with random data. +/// +/// Fills the given buffer with random data produced by a +/// cryptographically secure pseudorandom number generator (CSPRNG). +/// The output may be used as session keys or to derive long-term +/// cryptographic keys from. However, to create session keys, +/// consider using [`SessionKey::new`]. +/// +/// [`SessionKey::new`]: struct.SessionKey.html#method.new pub fn random<B: AsMut<[u8]>>(mut buf: B) { Yarrow::default().random(buf.as_mut()); } |