forked from I2P_Developers/i2p.i2p
* FortunaRandomSource:
- Fix bug that wasted entropy in nextInt()
- Improved synchronization
This commit is contained in:
@@ -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