Merge pull request #51 from onovy/random-pptr-seed
Initialize pptr to pseudo-random place before seeding.
This commit is contained in:
commit
b100c39dac
2 changed files with 2 additions and 2 deletions
|
@ -1634,7 +1634,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 = "";
|
||||||
|
|
|
@ -147,7 +147,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 = "";
|
||||||
|
|
Loading…
Add table
Reference in a new issue