Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upTracking issue for stabilizing randomness #27703
Comments
alexcrichton
added
T-libs
B-unstable
labels
Aug 12, 2015
This comment has been minimized.
This comment has been minimized.
|
|
aturon
added
the
I-nominated
label
Jan 27, 2016
This comment has been minimized.
This comment has been minimized.
|
Nominating for discussion at libs meeting: we're not ready to stabilize anything here, but I'd like to discuss the plan. |
This comment has been minimized.
This comment has been minimized.
|
Unfortunately the libs team didn't get a chance to talk about this in terms of stabilization for 1.8, but I'm going to leave the nominated tag as I think we should chat about this regardless. |
This comment has been minimized.
This comment has been minimized.
briansmith
commented
Feb 1, 2016
•
|
Suggestions:
Obviously, I am biased, but I think a better API for a CSPRNG is the very simple one in ring: https://briansmith.org/rustdoc/ring/rand/index.html. This type of interface is sufficient for every use of a CSPRNG I've ever needed. Note that an implementation of an interface like |
briansmith
referenced this issue
Feb 1, 2016
Closed
Replace use of crypto/rand with more direct use of OS RNG #58
This comment has been minimized.
This comment has been minimized.
briansmith
commented
Mar 23, 2016
|
Note that |
This comment has been minimized.
This comment has been minimized.
briansmith
commented
Apr 24, 2016
|
More feedback: Currently For some applications, this is unacceptable. The interface should have results returned using However, it is also the case that some implementations may experience errors that they cannot avoid, so it may be worth allowing an implementation to panic or abort the process if it has no other choice on failure. |
This comment has been minimized.
This comment has been minimized.
That’s |
This comment has been minimized.
This comment has been minimized.
briansmith
commented
May 11, 2016
I'm assuming that the |
This comment has been minimized.
This comment has been minimized.
briansmith
commented
May 19, 2016
|
Just FYI, I outlined what I think such an API should look like at |
This comment has been minimized.
This comment has been minimized.
aneeshusa
commented
Jun 14, 2016
|
+1 from me on the design of Ideal randomness APIs are infallible, for example OpenBSD's getentropy(2), or Linux's getrandom(2) with a wrapper. It would be nice to have an |
alexcrichton
removed
the
I-nominated
label
Jul 13, 2016
bstrie
referenced this issue
Oct 6, 2016
Closed
Stewardship and future of the rand lib in the nursery #36999
burdges
referenced this issue
Mar 13, 2017
Closed
Add conditional compilation to allow use on stable #3
This comment has been minimized.
This comment has been minimized.
Pratyush
commented
Apr 20, 2017
|
I'm not sure what the current status of this issue is, but tt would be ideal to have at least some portion of |
Mark-Simulacrum
added
the
C-tracking-issue
label
Jul 22, 2017
This comment has been minimized.
This comment has been minimized.
burdges
commented
Jul 27, 2017
•
|
I agree with @briansmith that Above that, there are as more users who care about the performance of I'd suggest we clearly warn about the side channel vulnerabilities the We should remove functionality from |
This comment has been minimized.
This comment has been minimized.
|
wrt constant-time generation, I assume you're talking about a userspace CSPRNG seeded from the kernel? There was some discussion in the recent internals thread about this, and I argued that user-space CSPRNGs are dangerous, and some agreed. The takeaway is that the discussion there seems to be leaning towards a) cryptographically-secure generation by default and, b) not providing user-space PRNGs by default. |
This comment has been minimized.
This comment has been minimized.
burdges
commented
Jul 28, 2017
|
I meant there should be versions that use constant time comparisons in the methods of |
This comment has been minimized.
This comment has been minimized.
|
Sorry, my point isn't that being constant-time isn't a good thing (and I know that "constant time" should really be "timing doesn't leak information about the seed"), but rather that this discussion seems to assume a user-land CSPRNG. A user-land CSPRNG is fine, but my point is simply that the default should be to not use a user-land CSPRNG for the reasons outlined in the thread I linked to. It's fine if users want to enable it (presuming we document the security risks), but it shouldn't be the default. |
This comment has been minimized.
This comment has been minimized.
burdges
commented
Jul 29, 2017
|
I see no user-land CSPRNG assumptions here. There is a discussion about There are legitimate needs for short lived user-land CSPRNGs in protocols with deterministic commitments, inside KDFs, etc., but those usages are niche enough that an external crate suffices. |
This comment has been minimized.
This comment has been minimized.
Common misconception, but it's not true. Properly-seeded CSPRNGs can never run out of entropy.
Probably a misreading on my part. To me, the discussion of constant-time CSPRNGs implied a user-land implementation (constant-timeness isn't a concern when using using kernel-provided randomness - you just get what the kernel gives you, take it or leave it). That's the only reason I was concerned. |
This comment has been minimized.
This comment has been minimized.
|
The |
alexcrichton commentedAug 12, 2015
Long ago we had
std::randand nowadays we haveextern crate rand. This is such core functionality it likely wants to move back into the standard library at some point, and in the meantime this issue serves as a tracking issue for therandfeature in the standard library.The process for adding this functionality to the standard library will likely look like something along the lines of rust-lang/rfcs#1242.
cc @huonw