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

Incomplete entropy: RNG doesn't include 0xff bytes #67

Open
MatthewLM opened this issue Oct 19, 2021 · 0 comments
Open

Incomplete entropy: RNG doesn't include 0xff bytes #67

MatthewLM opened this issue Oct 19, 2021 · 0 comments

Comments

@MatthewLM
Copy link

For Random.nextInt(int max), max is exclusive (https://api.dart.dev/stable/2.14.4/dart-math/Random/nextInt.html). This means the _randomBytes() function (https://github.com/dart-bitcoin/bitcoin_flutter/blob/master/lib/src/ecpair.dart#L92) does not include 255. _SIZE_BYTE should be 256.

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

No branches or pull requests

1 participant