diff --git a/heliosbooth/js/jscrypto/random.js b/heliosbooth/js/jscrypto/random.js index dd69f9d4fcb14add53e641eef94072b377b93844..8e363a6d0d561d3bbfd21a515b472b717d7cefde 100644 --- a/heliosbooth/js/jscrypto/random.js +++ b/heliosbooth/js/jscrypto/random.js @@ -26,10 +26,9 @@ Random.getRandomInteger = function(max) { var bit_length = max.bitLength(); Random.setupGenerator(); var random; - random = sjcl.random.randomWords(Math.ceil(bit_length / 32)+2, 0); + random = sjcl.random.randomWords(Math.ceil(bit_length / 32) + 2, 6); // we get a bit array instead of a BigInteger in this case var rand_bi = new BigInt(sjcl.codec.hex.fromBits(random), 16); return rand_bi.mod(max); - return BigInt._from_java_object(random).mod(max); };