Initialize pptr to pseudo-random place before seeding.

This commit is contained in:
onovy 2014-01-05 12:59:03 +01:00
parent b86d5883bc
commit 897ad54f5e
2 changed files with 2 additions and 2 deletions

View file

@ -1628,7 +1628,7 @@ if (typeof Crypto == "undefined" || !Crypto.util) {
sr.pool[sr.pptr++] = t >>> 8; sr.pool[sr.pptr++] = t >>> 8;
sr.pool[sr.pptr++] = t & 255; sr.pool[sr.pptr++] = t & 255;
} }
sr.pptr = 0; sr.pptr = Math.floor(sr.poolSize * Math.random());
sr.seedTime(); sr.seedTime();
// entropy // entropy
var entropyStr = ""; var entropyStr = "";

View file

@ -141,7 +141,7 @@
sr.pool[sr.pptr++] = t >>> 8; sr.pool[sr.pptr++] = t >>> 8;
sr.pool[sr.pptr++] = t & 255; sr.pool[sr.pptr++] = t & 255;
} }
sr.pptr = 0; sr.pptr = Math.floor(sr.poolSize * Math.random());
sr.seedTime(); sr.seedTime();
// entropy // entropy
var entropyStr = ""; var entropyStr = "";