Skip to content
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

feat: consume less entropy for PRNG #11102

Merged
merged 2 commits into from Mar 25, 2023

Conversation

coryan
Copy link
Member

@coryan coryan commented Mar 24, 2023

We initialized our PRNG with a lot of entropy. This was overkill, and the entropy sources are not always an infinite resource.


This change is Reviewable

We initialized our PRNG with a lot of entropy. This was overkill, and
the entropy sources are not always an infinite resource.
@codecov
Copy link

codecov bot commented Mar 24, 2023

Codecov Report

Patch coverage: 100.00% and project coverage change: -0.01 ⚠️

Comparison is base (810ccfa) 93.78% compared to head (5ed75ae) 93.78%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #11102      +/-   ##
==========================================
- Coverage   93.78%   93.78%   -0.01%     
==========================================
  Files        1737     1737              
  Lines      156898   156897       -1     
==========================================
- Hits       147152   147145       -7     
- Misses       9746     9752       +6     
Impacted Files Coverage Δ
google/cloud/internal/random.h 100.00% <100.00%> (ø)

... and 7 files with indirect coverage changes

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@coryan coryan marked this pull request as ready for review March 24, 2023 19:25
@coryan coryan requested a review from a team as a code owner March 24, 2023 19:25
/// Create a new PRNG.
inline DefaultPRNG MakeDefaultPRNG() {
// Fetch a few (typically 64) bits of entropy to initialize the PRNG. We used
// to fetch a lot more entropy, but that is overkill for our purposes.
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'd reword to avoid talking about what we used to do, and rather speak to what we now do.

Perhaps just "Fetch a few bits ..., which is sufficient for our purposes"?

@coryan
Copy link
Member Author

coryan commented Mar 24, 2023

/gcbrun

@coryan coryan added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Mar 24, 2023
@google-cloud-cpp-bot google-cloud-cpp-bot removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Mar 24, 2023
@coryan coryan enabled auto-merge (squash) March 24, 2023 21:59
@coryan coryan merged commit cae4aa9 into googleapis:main Mar 25, 2023
59 checks passed
@coryan coryan deleted the feat-reduce-entropy-usage branch March 25, 2023 21:16
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.

None yet

3 participants