IRandomStandalone
, RandomEventListenerStandalone
, java.io.Serializable
, java.lang.Cloneable
, java.util.EventListener
AsyncFortunaStandalone
public class FortunaStandalone extends BasePRNGStandalone implements java.io.Serializable, RandomEventListenerStandalone
There are some things users of this class must be aware of:
Serializable
in such a way that it
writes a 64 byte seed to the stream, and reads it back again when being
deserialized. This is the extent of seed file management, however, and
those using this class are encouraged to think deeply about when, how
often, and where to store the seed.References:
修飾子とタイプ | クラス | 説明 |
---|---|---|
static class |
FortunaStandalone.Generator |
The Fortuna generator function.
|
修飾子とタイプ | フィールド | 説明 |
---|---|---|
(package private) FortunaStandalone.Generator |
generator |
|
(package private) static long |
lastRefill |
|
(package private) long |
lastReseed |
|
(package private) static int |
MIN_POOL_SIZE |
|
(package private) static int |
NUM_POOLS |
|
(package private) int |
pool |
|
(package private) int |
pool0Count |
|
(package private) java.security.MessageDigest[] |
pools |
|
(package private) static long |
refillCount |
|
(package private) int |
reseedCount |
|
static java.lang.String |
SEED |
buffer, initialised, name, ndx
コンストラクタ | 説明 |
---|---|
FortunaStandalone() |
修飾子とタイプ | メソッド | 説明 |
---|---|---|
void |
addRandomByte(byte b) |
Supplement, or possibly replace, the random state of this PRNG with
a random byte.
|
void |
addRandomBytes(byte[] buf,
int offset,
int length) |
Supplement, or possibly replace, the random state of this PRNG with
a sequence of new random bytes.
|
void |
addRandomEvent(RandomEventStandalone event) |
|
protected void |
allocBuffer() |
|
void |
fillBlock() |
|
void |
seed(byte[] val) |
|
void |
setup(java.util.Map<java.lang.String,byte[]> attributes) |
addRandomBytes, clone, init, isInitialised, name, nextByte, nextBytes, nextBytes
static final int NUM_POOLS
static final int MIN_POOL_SIZE
final FortunaStandalone.Generator generator
final java.security.MessageDigest[] pools
long lastReseed
int pool
int pool0Count
int reseedCount
static long refillCount
static long lastRefill
public static final java.lang.String SEED
protected void allocBuffer()
public void seed(byte[] val)
public void setup(java.util.Map<java.lang.String,byte[]> attributes)
setup
クラス内 BasePRNGStandalone
public void fillBlock()
fillBlock
クラス内 BasePRNGStandalone
public void addRandomByte(byte b)
IRandomStandalone
Supplement, or possibly replace, the random state of this PRNG with a random byte.
Implementations are not required to implement this method in any
meaningful way; this may be a no-operation, and implementations may
throw an UnsupportedOperationException
.
addRandomByte
インタフェース内 IRandomStandalone
addRandomByte
クラス内 BasePRNGStandalone
b
- The byte to add.public void addRandomBytes(byte[] buf, int offset, int length)
IRandomStandalone
Supplement, or possibly replace, the random state of this PRNG with a sequence of new random bytes.
Implementations are not required to implement this method in any
meaningful way; this may be a no-operation, and implementations may
throw an UnsupportedOperationException
.
addRandomBytes
インタフェース内 IRandomStandalone
addRandomBytes
クラス内 BasePRNGStandalone
buf
- The buffer of new random bytes to add.offset
- The offset from whence to begin reading random bytes.length
- The number of random bytes to add.public void addRandomEvent(RandomEventStandalone event)
addRandomEvent
インタフェース内 RandomEventListenerStandalone