author | Giulio Cesare Solaroli <giulio.cesare@clipperz.com> | 2014-06-21 08:50:00 (UTC) |
---|---|---|
committer | Giulio Cesare Solaroli <giulio.cesare@clipperz.com> | 2014-06-21 09:20:16 (UTC) |
commit | 6dd16d9359e3a4dc306802588b09acd43947a606 (patch) (unidiff) | |
tree | f3ab7778e037e42cb47c810f9d435d40de5adf15 /frontend/gamma/js/Clipperz/Crypto | |
parent | a6852c93138f3c4596fb4df8bce5b7d19ef50478 (diff) | |
download | clipperz-6dd16d9359e3a4dc306802588b09acd43947a606.zip clipperz-6dd16d9359e3a4dc306802588b09acd43947a606.tar.gz clipperz-6dd16d9359e3a4dc306802588b09acd43947a606.tar.bz2 |
Inproved PRNG configuration
Diffstat (limited to 'frontend/gamma/js/Clipperz/Crypto') (more/less context) (ignore whitespace changes)
-rw-r--r-- | frontend/gamma/js/Clipperz/Crypto/PRNG.js | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/frontend/gamma/js/Clipperz/Crypto/PRNG.js b/frontend/gamma/js/Clipperz/Crypto/PRNG.js index 7885429..80d972f 100644 --- a/frontend/gamma/js/Clipperz/Crypto/PRNG.js +++ b/frontend/gamma/js/Clipperz/Crypto/PRNG.js | |||
@@ -309,27 +309,27 @@ Clipperz.Crypto.PRNG.CryptoRandomRandomnessSource.prototype = MochiKit.Base.upda | |||
309 | }, | 309 | }, |
310 | 310 | ||
311 | 'browserCrypto': function () { | 311 | 'browserCrypto': function () { |
312 | return this._browserCrypto; | 312 | return this._browserCrypto; |
313 | }, | 313 | }, |
314 | 314 | ||
315 | //------------------------------------------------------------------------- | 315 | //------------------------------------------------------------------------- |
316 | 316 | ||
317 | 'collectEntropy': function() { | 317 | 'collectEntropy': function() { |
318 | varbytesToCollect; | 318 | varbytesToCollect; |
319 | 319 | ||
320 | if (this.boostMode() == true) { | 320 | if (this.boostMode() == true) { |
321 | bytesToCollect = 8; | 321 | bytesToCollect = 64; |
322 | } else { | 322 | } else { |
323 | bytesToCollect = 32; | 323 | bytesToCollect = 8; |
324 | } | 324 | } |
325 | 325 | ||
326 | var randomValuesArray = new Uint8Array(bytesToCollect); | 326 | var randomValuesArray = new Uint8Array(bytesToCollect); |
327 | this.browserCrypto().getRandomValues(randomValuesArray); | 327 | this.browserCrypto().getRandomValues(randomValuesArray); |
328 | for (var i = 0; i < randomValuesArray.length; i++) { | 328 | for (var i = 0; i < randomValuesArray.length; i++) { |
329 | this.updateGeneratorWithValue(randomValuesArray[i]); | 329 | this.updateGeneratorWithValue(randomValuesArray[i]); |
330 | } | 330 | } |
331 | 331 | ||
332 | setTimeout(this.collectEntropy, this.intervalTime()); | 332 | setTimeout(this.collectEntropy, this.intervalTime()); |
333 | }, | 333 | }, |
334 | 334 | ||
335 | //------------------------------------------------------------------------- | 335 | //------------------------------------------------------------------------- |