-rw-r--r-- | frontend/beta/js/Clipperz/Crypto/PRNG.js | 4 | ||||
-rw-r--r-- | frontend/delta/js/Clipperz/Crypto/PRNG.js | 4 | ||||
-rw-r--r-- | frontend/gamma/js/Clipperz/Crypto/PRNG.js | 4 |
3 files changed, 6 insertions, 6 deletions
diff --git a/frontend/beta/js/Clipperz/Crypto/PRNG.js b/frontend/beta/js/Clipperz/Crypto/PRNG.js index 92966d0..6fdeca4 100644 --- a/frontend/beta/js/Clipperz/Crypto/PRNG.js +++ b/frontend/beta/js/Clipperz/Crypto/PRNG.js @@ -255,131 +255,131 @@ Clipperz.Crypto.PRNG.MouseRandomnessSource.prototype = MochiKit.Base.update(new //------------------------------------------------------------------------- 'numberOfRandomBitsCollected': function() { return this._numberOfRandomBitsCollected; }, 'setNumberOfRandomBitsCollected': function(aValue) { this._numberOfRandomBitsCollected = aValue; }, //------------------------------------------------------------------------- 'collectEntropy': function(anEvent) { var mouseLocation; var randomBit; var mask; mask = 0xffffffff >>> (32 - this.numberOfBitsToCollectAtEachEvent()); mouseLocation = anEvent.mouse().client; randomBit = ((mouseLocation.x ^ mouseLocation.y) & mask); this.appendRandomBitsToRandomBitsCollector(randomBit) }, //------------------------------------------------------------------------- 'numberOfRandomBits': function() { return 1; }, //------------------------------------------------------------------------- __syntaxFix__: "syntax fix" }); //***************************************************************************** Clipperz.Crypto.PRNG.CryptoRandomRandomnessSource = function(args) { args = args || {}; this._intervalTime = args.intervalTime || 1000; this._browserCrypto = args.browserCrypto; Clipperz.Crypto.PRNG.RandomnessSource.call(this, args); this.collectEntropy(); return this; } Clipperz.Crypto.PRNG.CryptoRandomRandomnessSource.prototype = MochiKit.Base.update(new Clipperz.Crypto.PRNG.RandomnessSource, { 'intervalTime': function() { return this._intervalTime; }, 'browserCrypto': function () { return this._browserCrypto; }, //------------------------------------------------------------------------- 'collectEntropy': function() { var bytesToCollect; if (this.boostMode() == true) { - bytesToCollect = 8; + bytesToCollect = 64; } else { - bytesToCollect = 32; + bytesToCollect = 8; } var randomValuesArray = new Uint8Array(bytesToCollect); this.browserCrypto().getRandomValues(randomValuesArray); for (var i = 0; i < randomValuesArray.length; i++) { this.updateGeneratorWithValue(randomValuesArray[i]); } setTimeout(this.collectEntropy, this.intervalTime()); }, //------------------------------------------------------------------------- __syntaxFix__: "syntax fix" }); //############################################################################# Clipperz.Crypto.PRNG.Fortuna = function(args) { var i,c; args = args || {}; this._key = args.seed || null; if (this._key == null) { this._counter = 0; this._key = new Clipperz.ByteArray(); } else { this._counter = 1; } this._aesKey = null; this._firstPoolReseedLevel = args.firstPoolReseedLevel || 32 || 64; this._numberOfEntropyAccumulators = args.numberOfEntropyAccumulators || 32; this._accumulators = []; c = this.numberOfEntropyAccumulators(); for (i=0; i<c; i++) { this._accumulators.push(new Clipperz.Crypto.PRNG.EntropyAccumulator()); } this._randomnessSources = []; this._reseedCounter = 0; return this; } Clipperz.Crypto.PRNG.Fortuna.prototype = MochiKit.Base.update(null, { 'toString': function() { return "Clipperz.Crypto.PRNG.Fortuna"; }, //------------------------------------------------------------------------- 'key': function() { return this._key; }, 'setKey': function(aValue) { this._key = aValue; this._aesKey = null; }, diff --git a/frontend/delta/js/Clipperz/Crypto/PRNG.js b/frontend/delta/js/Clipperz/Crypto/PRNG.js index 7885429..80d972f 100644 --- a/frontend/delta/js/Clipperz/Crypto/PRNG.js +++ b/frontend/delta/js/Clipperz/Crypto/PRNG.js @@ -257,131 +257,131 @@ Clipperz.Crypto.PRNG.MouseRandomnessSource.prototype = MochiKit.Base.update(new //------------------------------------------------------------------------- 'numberOfRandomBitsCollected': function() { return this._numberOfRandomBitsCollected; }, 'setNumberOfRandomBitsCollected': function(aValue) { this._numberOfRandomBitsCollected = aValue; }, //------------------------------------------------------------------------- 'collectEntropy': function(anEvent) { var mouseLocation; var randomBit; var mask; mask = 0xffffffff >>> (32 - this.numberOfBitsToCollectAtEachEvent()); mouseLocation = anEvent.mouse().client; randomBit = ((mouseLocation.x ^ mouseLocation.y) & mask); this.appendRandomBitsToRandomBitsCollector(randomBit) }, //------------------------------------------------------------------------- 'numberOfRandomBits': function() { return 1; }, //------------------------------------------------------------------------- __syntaxFix__: "syntax fix" }); //***************************************************************************** Clipperz.Crypto.PRNG.CryptoRandomRandomnessSource = function(args) { args = args || {}; this._intervalTime = args.intervalTime || 1000; this._browserCrypto = args.browserCrypto; Clipperz.Crypto.PRNG.RandomnessSource.call(this, args); this.collectEntropy(); return this; } Clipperz.Crypto.PRNG.CryptoRandomRandomnessSource.prototype = MochiKit.Base.update(new Clipperz.Crypto.PRNG.RandomnessSource, { 'intervalTime': function() { return this._intervalTime; }, 'browserCrypto': function () { return this._browserCrypto; }, //------------------------------------------------------------------------- 'collectEntropy': function() { var bytesToCollect; if (this.boostMode() == true) { - bytesToCollect = 8; + bytesToCollect = 64; } else { - bytesToCollect = 32; + bytesToCollect = 8; } var randomValuesArray = new Uint8Array(bytesToCollect); this.browserCrypto().getRandomValues(randomValuesArray); for (var i = 0; i < randomValuesArray.length; i++) { this.updateGeneratorWithValue(randomValuesArray[i]); } setTimeout(this.collectEntropy, this.intervalTime()); }, //------------------------------------------------------------------------- __syntaxFix__: "syntax fix" }); //############################################################################# Clipperz.Crypto.PRNG.Fortuna = function(args) { var i,c; args = args || {}; this._key = args.seed || null; if (this._key == null) { this._counter = 0; this._key = new Clipperz.ByteArray(); } else { this._counter = 1; } this._aesKey = null; this._firstPoolReseedLevel = args.firstPoolReseedLevel || 32 || 64; this._numberOfEntropyAccumulators = args.numberOfEntropyAccumulators || 32; this._accumulators = []; c = this.numberOfEntropyAccumulators(); for (i=0; i<c; i++) { this._accumulators.push(new Clipperz.Crypto.PRNG.EntropyAccumulator()); } this._randomnessSources = []; this._reseedCounter = 0; return this; } Clipperz.Crypto.PRNG.Fortuna.prototype = MochiKit.Base.update(null, { 'toString': function() { return "Clipperz.Crypto.PRNG.Fortuna"; }, //------------------------------------------------------------------------- 'key': function() { return this._key; }, 'setKey': function(aValue) { this._key = aValue; this._aesKey = null; }, 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 @@ -257,131 +257,131 @@ Clipperz.Crypto.PRNG.MouseRandomnessSource.prototype = MochiKit.Base.update(new //------------------------------------------------------------------------- 'numberOfRandomBitsCollected': function() { return this._numberOfRandomBitsCollected; }, 'setNumberOfRandomBitsCollected': function(aValue) { this._numberOfRandomBitsCollected = aValue; }, //------------------------------------------------------------------------- 'collectEntropy': function(anEvent) { var mouseLocation; var randomBit; var mask; mask = 0xffffffff >>> (32 - this.numberOfBitsToCollectAtEachEvent()); mouseLocation = anEvent.mouse().client; randomBit = ((mouseLocation.x ^ mouseLocation.y) & mask); this.appendRandomBitsToRandomBitsCollector(randomBit) }, //------------------------------------------------------------------------- 'numberOfRandomBits': function() { return 1; }, //------------------------------------------------------------------------- __syntaxFix__: "syntax fix" }); //***************************************************************************** Clipperz.Crypto.PRNG.CryptoRandomRandomnessSource = function(args) { args = args || {}; this._intervalTime = args.intervalTime || 1000; this._browserCrypto = args.browserCrypto; Clipperz.Crypto.PRNG.RandomnessSource.call(this, args); this.collectEntropy(); return this; } Clipperz.Crypto.PRNG.CryptoRandomRandomnessSource.prototype = MochiKit.Base.update(new Clipperz.Crypto.PRNG.RandomnessSource, { 'intervalTime': function() { return this._intervalTime; }, 'browserCrypto': function () { return this._browserCrypto; }, //------------------------------------------------------------------------- 'collectEntropy': function() { var bytesToCollect; if (this.boostMode() == true) { - bytesToCollect = 8; + bytesToCollect = 64; } else { - bytesToCollect = 32; + bytesToCollect = 8; } var randomValuesArray = new Uint8Array(bytesToCollect); this.browserCrypto().getRandomValues(randomValuesArray); for (var i = 0; i < randomValuesArray.length; i++) { this.updateGeneratorWithValue(randomValuesArray[i]); } setTimeout(this.collectEntropy, this.intervalTime()); }, //------------------------------------------------------------------------- __syntaxFix__: "syntax fix" }); //############################################################################# Clipperz.Crypto.PRNG.Fortuna = function(args) { var i,c; args = args || {}; this._key = args.seed || null; if (this._key == null) { this._counter = 0; this._key = new Clipperz.ByteArray(); } else { this._counter = 1; } this._aesKey = null; this._firstPoolReseedLevel = args.firstPoolReseedLevel || 32 || 64; this._numberOfEntropyAccumulators = args.numberOfEntropyAccumulators || 32; this._accumulators = []; c = this.numberOfEntropyAccumulators(); for (i=0; i<c; i++) { this._accumulators.push(new Clipperz.Crypto.PRNG.EntropyAccumulator()); } this._randomnessSources = []; this._reseedCounter = 0; return this; } Clipperz.Crypto.PRNG.Fortuna.prototype = MochiKit.Base.update(null, { 'toString': function() { return "Clipperz.Crypto.PRNG.Fortuna"; }, //------------------------------------------------------------------------- 'key': function() { return this._key; }, 'setKey': function(aValue) { this._key = aValue; this._aesKey = null; }, |