diff --git a/core/random.js b/core/random.js index 2a6f135..6ae049f 100644 --- a/core/random.js +++ b/core/random.js @@ -366,3 +366,13 @@ sjcl.random = { } }; +(function(){ + try { + // get cryptographically strong entropy in Webkit + var ab = new Uint32Array(32), i; + crypto.getRandomValues(ab); + sjcl.random.addEntropy(ab, 1024, "crypto.getRandomValues"); + } catch (e) { + // no getRandomValues :-( + } +})();