Add internal multi-backend entropy system#10748
Conversation
|
Thanks for your pull request, @0xEAB! Bugzilla referencesYour PR doesn't reference any Bugzilla issue. If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog. Testing this PR locallyIf you don't have a local development environment setup, you can use Digger to test this PR: dub run digger -- build "master + phobos#10748" |
75430df to
cfa3fcf
Compare
LightBender
left a comment
There was a problem hiding this comment.
For now I am OK with this because it's V2. But we need to have a long conversation about how to handle platform level interfaces in V3 that doesn't involve shoving everything into scattered internal folders.
|
std/internal/entropy/entropy.d
Outdated
| return getEntropy(buffer[0 .. length]); | ||
| } | ||
|
|
||
| // Used to manually set the entropy source to use |
There was a problem hiding this comment.
Public declaration 'forceEntropySource' is undocumented.
```
Use `///`
There was a problem hiding this comment.
IMHO it doesn’t make much sense to document functionality in std.internal anyway.
I’m a bit surprised that I don’t get away with it unlike other modules in said package.
To be honest, I’m tempted to just add exclusions for the files in dscanner.ini.
There was a problem hiding this comment.
At this point, I think I have documented things to an extent that goes far beyond what could be reasonably required for an internal module. I’ll look into D-Scanner warnings that are still left, but I get more and more tempted to add exclusions. (I’ve already added one for the has-public-examples check.)
Sure thing! I’m only improvising here and I wasn’t really sure how to organize the code. I went with a multi-module approach for encapsulation reasons. Although I have to admit the value of having that is questionable at best. |
|
Each of these package files are so small, it's probably not worth having them split per platform. Just one module and |
|
Adam approved this a few weeks ago: #10748 (review) |
|
I’m not sure who defeated whom, but the style check finally passes. |
This provides a entropy (CSPRNG) multi-backend system for internal use.
getrandom()from libc on Linux.std.random).Unlike
getrandom()backwards compatibility shim #10741, this works without compiler assistance.This patch should be reviewed thoroughly. Thanks!
Obsoletes dlang/dmd#21158.
Replaces #10739 and #10741.