EntropyHarvester
public class FortunaRandomSource extends RandomSource implements EntropyHarvester
_context
コンストラクタ | 説明 |
---|---|
FortunaRandomSource(I2PAppContext context) |
May block up to 10 seconds or forever
|
修飾子とタイプ | メソッド | 説明 |
---|---|---|
void |
feedEntropy(java.lang.String source,
byte[] data,
int offset,
int len) |
reseed the fortuna
|
void |
feedEntropy(java.lang.String source,
long data,
int bitoffset,
int bits) |
reseed the fortuna
|
EntropyHarvester |
harvester() |
|
static void |
main(java.lang.String[] args) |
Outputs to stdout for dieharder:
java -cp build/i2p.jar net.i2p.util.FortunaRandomSource | dieharder -a -g 200
|
protected int |
nextBits(int numBits) |
Pull the next numBits of random data off the fortuna instance (returning 0
through 2^numBits-1
Caller must synchronize!
|
boolean |
nextBoolean() |
|
byte |
nextByte() |
Not part of java.util.SecureRandom, but added for efficiency, since Fortuna supports it.
|
void |
nextBytes(byte[] buf) |
|
void |
nextBytes(byte[] buf,
int offset,
int length) |
Not part of java.util.SecureRandom, but added for efficiency, since Fortuna supports it.
|
double |
nextDouble() |
Implementation from sun's java.util.Random javadocs
|
float |
nextFloat() |
Implementation from sun's java.util.Random javadocs
|
double |
nextGaussian() |
Implementation from sun's java.util.Random javadocs
|
int |
nextInt() |
|
int |
nextInt(int n) |
According to the java docs (http://java.sun.com/j2se/1.4.1/docs/api/java/util/Random.html#nextInt(int))
nextInt(n) should return a number between 0 and n (including 0 and excluding n).
|
long |
nextLong() |
|
long |
nextLong(long n) |
Like the modified nextInt, nextLong(n) returns a random number from 0 through n,
including 0, excluding n.
|
void |
setSeed(byte[] buf) |
|
void |
shutdown() |
Note - methods may hang or NPE or throw IllegalStateExceptions after this
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
doubles, doubles, doubles, doubles, ints, ints, ints, ints, longs, longs, longs, longs
getInstance, initSeed, loadSeed, saveSeed, writeSeed
public FortunaRandomSource(I2PAppContext context)
public void shutdown()
public void setSeed(byte[] buf)
setSeed
クラス内 java.security.SecureRandom
public int nextInt(int n)
nextInt
クラス内 RandomSource
public int nextInt()
nextInt
クラス内 java.util.Random
public long nextLong(long n)
nextLong
クラス内 RandomSource
public long nextLong()
nextLong
クラス内 java.util.Random
public boolean nextBoolean()
nextBoolean
クラス内 java.util.Random
public void nextBytes(byte[] buf)
nextBytes
クラス内 java.security.SecureRandom
public void nextBytes(byte[] buf, int offset, int length)
nextBytes
クラス内 RandomSource
public byte nextByte()
public double nextDouble()
nextDouble
クラス内 java.util.Random
public float nextFloat()
nextFloat
クラス内 java.util.Random
public double nextGaussian()
nextGaussian
クラス内 java.util.Random
protected int nextBits(int numBits)
public EntropyHarvester harvester()
harvester
クラス内 RandomSource
public void feedEntropy(java.lang.String source, long data, int bitoffset, int bits)
feedEntropy
インタフェース内 EntropyHarvester
feedEntropy
クラス内 RandomSource
source
- origin of the entropy, allowing the harvester to
determine how much to value the databitoffset
- bit index into the data array to start
(using java standard big-endian)bits
- how many bits to usepublic void feedEntropy(java.lang.String source, byte[] data, int offset, int len)
feedEntropy
インタフェース内 EntropyHarvester
feedEntropy
クラス内 RandomSource
source
- origin of the entropy, allowing the harvester to
determine how much to value the dataoffset
- index into the data array to startlen
- how many bytes to usepublic static void main(java.lang.String[] args)
java -cp build/i2p.jar net.i2p.util.FortunaRandomSource | dieharder -a -g 200