Skip to content

librand: Revise crypto part of document #13820

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 13, 2014
Merged

Conversation

klutzy
Copy link
Contributor

@klutzy klutzy commented Apr 28, 2014

This patch adds document which explains when to use OSRng in
cryptographic context, and explains why we use /dev/urandom instead
of /dev/random.

`/dev/urandom`; kernel internally runs cryptographically secure pseudorandom
number generator (CSPRNG) based on entropy pool, so the "quality" of
`/dev/random` is not better than `/dev/urandom` in most cases.
The pitfall is when your application runs at boot time.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe this last bit could be written "However, this means that /dev/urandom can yield somewhat predictable randomness if the entropy pool is very small, such as immediately after booting. If an application likely to be run soon after booting, or on a system with very few entropy sources, one should consider using /dev/random via ReaderRng."

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great. copy-pasted!

This patch adds document which explains when to use `OSRng` in
cryptographic context, and explains why we use `/dev/urandom` instead
of `/dev/random`.
bors added a commit that referenced this pull request May 13, 2014
This patch adds document which explains when to use `OSRng` in
cryptographic context, and explains why we use `/dev/urandom` instead
of `/dev/random`.
@bors bors merged commit c92f519 into rust-lang:master May 13, 2014
@klutzy klutzy deleted the urandom branch May 13, 2014 06:25
arcnmx pushed a commit to arcnmx/rust that referenced this pull request Jan 9, 2023
Fix binding mode hints always adding parentheses to or-patterns
flip1995 pushed a commit to flip1995/rust that referenced this pull request Dec 26, 2024
Looks like typo for me.

Looking at blame
rust-lang/rust-clippy@b76b0ae#diff-ac15e787d7d276b24f251f4f5bdedf1e6ac81aa1e2ea0db27219e9a7fa8b0b30L66
the same typo was before.

Is logic here actually correct? Tests passed locally, but i expected
some changes.

changelog: none
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants