Repository navigation
Conversation
This improves entropy of Dice and makes PRNG state recovery harder. As a pleasant side effect this also makes the Dice app more like a physical dice - dependent on how it is shaken, but in a hard to predict manner. Using PRNG output as one of the seeds preserves 32-bits of previous PRNG entropy when reseeding. For std::minstd_rand that means entire entropy.
|
Build size and comparison to main:
|
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is an improved version of #2478 - this preserves PRNG existing entropy when re-seeding.
This improves entropy of Dice and makes PRNG state recovery harder.
As a pleasant side effect this also makes the Dice app more like a physical dice - dependent on how it is shaken, but in a hard to predict manner.
Using PRNG output as one of the seeds preserves 32-bits of previous PRNG entropy when reseeding. For
std::minstd_randthat means - its entire entropy.This PR:
static_cast<uint32_t>(gen())TL;DR I think this could be a good addition to #2473 and a pretty cool thing on it's own as it makes the Dice app more like a real physical dice. 😎 🎲
This PR provides better security than #2478 at virtually no cost.