mirror of
https://github.com/i2p/i2p.i2p.git
synced 2026-10-23 15:12:56 +00:00
* FortunaRandomSource:
- Fix bug that wasted entropy in nextInt()
- Improved synchronization
This commit is contained in:
1 parent
d7b48a2256
commit
db42d9ec37
3 files changed
+73
-42
No files matched your search
@@ -14,7 +14,7 @@ import net.i2p.util.Log;
|
||||
*
|
||||
* Note that this class is not fully Thread safe!
|
||||
* The following methods must be synchronized externally, they are not
|
||||
* sycned here or in super():
|
||||
* synced here or in super():
|
||||
* addRandomByte(), addRandomBytes(), nextByte(), nextBytes(), seed()
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -55,7 +55,7 @@ public abstract class BasePRNGStandalone implements IRandomStandalone {
|
||||
// -------------------------------------------------------------------------
|
||||
|
||||
/** The canonical name prefix of the PRNG algorithm. */
|
||||
protected String name;
|
||||
protected final String name;
|
||||
|
||||
/** Indicate if this instance has already been initialised or not. */
|
||||
protected boolean initialised;
|
||||
@@ -75,10 +75,7 @@ public abstract class BasePRNGStandalone implements IRandomStandalone {
|
||||
* @param name the canonical name of this instance.
|
||||
*/
|
||||
protected BasePRNGStandalone(String name) {
|
||||
super();
|
||||
|
||||
this.name = name;
|
||||
initialised = false;
|
||||
buffer = new byte[0];
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user