Package gnu.crypto.prng
Class AsyncFortunaStandalone
- java.lang.Object
-
- gnu.crypto.prng.BasePRNGStandalone
-
- gnu.crypto.prng.FortunaStandalone
-
- gnu.crypto.prng.AsyncFortunaStandalone
-
- All Implemented Interfaces:
IRandomStandalone,Serializable,Cloneable,Runnable
public class AsyncFortunaStandalone extends FortunaStandalone implements Runnable
fortuna instance that tries to avoid blocking if at all possible by using separate filled buffer segments rather than one buffer (and blocking when that buffer's data has been eaten) Note that this class is not fully Thread safe! The following methods must be synchronized externally, they are not synced here or in super(): addRandomByte(), addRandomBytes(), nextByte(), nextBytes(), seed()- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class gnu.crypto.prng.FortunaStandalone
FortunaStandalone.Generator
-
-
Field Summary
-
Fields inherited from class gnu.crypto.prng.FortunaStandalone
generator, lastReseed, MIN_POOL_SIZE, NUM_POOLS, pool, pool0Count, pools, reseedCount, SEED
-
Fields inherited from class gnu.crypto.prng.BasePRNGStandalone
buffer, initialised, name, ndx
-
-
Constructor Summary
Constructors Constructor Description AsyncFortunaStandalone(I2PAppContext context)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidallocBuffer()Unused, see AsyncFortunaStandalonevoidfillBlock()Unused, see AsyncFortunaStandaloneprotected voidrotateBuffer()make the next available filled buffer current, scheduling any unfilled buffers for refill, and blocking until at least one buffer is readyvoidrun()The refiller threadvoidseed(byte[] val)the seed is only propogated once the prng is started with startup()voidshutdown()Note - methods may hang or NPE or throw IllegalStateExceptions after thisvoidstartup()-
Methods inherited from class gnu.crypto.prng.FortunaStandalone
addRandomByte, addRandomBytes, setup
-
Methods inherited from class gnu.crypto.prng.BasePRNGStandalone
addRandomBytes, clone, init, isInitialised, name, nextByte, nextBytes, nextBytes
-
-
-
-
Constructor Detail
-
AsyncFortunaStandalone
public AsyncFortunaStandalone(I2PAppContext context)
-
-
Method Detail
-
startup
public void startup()
-
shutdown
public void shutdown()
Note - methods may hang or NPE or throw IllegalStateExceptions after this- Since:
- 0.8.8
-
seed
public void seed(byte[] val)
the seed is only propogated once the prng is started with startup()- Overrides:
seedin classFortunaStandalone
-
allocBuffer
protected void allocBuffer()
Description copied from class:FortunaStandaloneUnused, see AsyncFortunaStandalone- Overrides:
allocBufferin classFortunaStandalone
-
rotateBuffer
protected void rotateBuffer()
make the next available filled buffer current, scheduling any unfilled buffers for refill, and blocking until at least one buffer is ready
-
fillBlock
public void fillBlock()
Description copied from class:FortunaStandaloneUnused, see AsyncFortunaStandalone- Overrides:
fillBlockin classFortunaStandalone
-
-