Package org.bouncycastle.crypto.prng
Class DigestRandomGenerator
- java.lang.Object
 - 
- org.bouncycastle.crypto.prng.DigestRandomGenerator
 
 
- 
- All Implemented Interfaces:
 RandomGenerator
public class DigestRandomGenerator extends java.lang.Object implements RandomGenerator
Random generation based on the digest with counter. Calling addSeedMaterial will always increase the entropy of the hash.Internal access to the digest is synchronized so a single one of these can be shared.
 
- 
- 
Constructor Summary
Constructors Constructor Description DigestRandomGenerator(Digest digest) 
- 
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddSeedMaterial(byte[] inSeed)Add more seed material to the generator.voidaddSeedMaterial(long rSeed)Add more seed material to the generator.voidnextBytes(byte[] bytes)Fill bytes with random values.voidnextBytes(byte[] bytes, int start, int len)Fill part of bytes with random values. 
 - 
 
- 
- 
Constructor Detail
- 
DigestRandomGenerator
public DigestRandomGenerator(Digest digest)
 
 - 
 
- 
Method Detail
- 
addSeedMaterial
public void addSeedMaterial(byte[] inSeed)
Description copied from interface:RandomGeneratorAdd more seed material to the generator.- Specified by:
 addSeedMaterialin interfaceRandomGenerator- Parameters:
 inSeed- a byte array to be mixed into the generator's state.
 
- 
addSeedMaterial
public void addSeedMaterial(long rSeed)
Description copied from interface:RandomGeneratorAdd more seed material to the generator.- Specified by:
 addSeedMaterialin interfaceRandomGenerator- Parameters:
 rSeed- a long value to be mixed into the generator's state.
 
- 
nextBytes
public void nextBytes(byte[] bytes)
Description copied from interface:RandomGeneratorFill bytes with random values.- Specified by:
 nextBytesin interfaceRandomGenerator- Parameters:
 bytes- byte array to be filled.
 
- 
nextBytes
public void nextBytes(byte[] bytes, int start, int len)Description copied from interface:RandomGeneratorFill part of bytes with random values.- Specified by:
 nextBytesin interfaceRandomGenerator- Parameters:
 bytes- byte array to be filled.start- index to start filling at.len- length of segment to fill.
 
 - 
 
 -