dart-bitcoin/bitcoin_flutter

Incomplete entropy: RNG doesn't include 0xff bytes

Opened this issue · 0 comments

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.