You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Here _SIZE_BYTE is defined as 255 (on line 10). Since the nextInt method generates integers in the half-open interval[0, max) for a given upper bound max, the value 255 will never be generated. This means that the generated entropy will not be uniformly random. This is an issue if the library is used to generate private keys (e.g. using BIP32).
The text was updated successfully, but these errors were encountered:
theosirian
added a commit
to spruceid/dart-bip39
that referenced
this issue
Oct 14, 2021
bip39.generateMnemonic
uses the Random.secure() CSPRNG from thedart:math
library to generate entropy for the mnemonic in_randomBytes
.bip39/lib/src/bip39_base.dart
Lines 40 to 47 in 3633daa
Here
_SIZE_BYTE
is defined as 255 (on line 10). Since thenextInt
method generates integers in the half-open interval[0, max)
for a given upper boundmax
, the value 255 will never be generated. This means that the generated entropy will not be uniformly random. This is an issue if the library is used to generate private keys (e.g. using BIP32).The text was updated successfully, but these errors were encountered: