diff --git a/lib/rng.dart b/lib/rng.dart index 547c7e3..5233f11 100644 --- a/lib/rng.dart +++ b/lib/rng.dart @@ -52,8 +52,12 @@ class CryptoRNG extends RNG { Uint8List generateInternal() { final b = Uint8List(16); - for (var i = 0; i < 16; i++) { - b[i] = _secureRandom.nextInt(256); + for (var i = 0; i < 16; i += 4) { + var k = _secureRandom.nextInt(1 << 32); + b[i] = k; + b[i + 1] = k >> 8; + b[i + 2] = k >> 16; + b[i + 3] = k >> 24; } return b;