|
Oracle Security Developer Tools Crypto Java API Reference 11g (11.1.1) E10668-02 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object
oracle.security.crypto.core.RandomBitsSource
oracle.security.crypto.core.DSARandomBitsSource
public class DSARandomBitsSource
A PRNG based on the algorithm described in Appendix 3.1 of FIPS PUB 186-2 and the modifications specified in the Random Number Generation and General Purpose Number Generation sections of Change Notice 1 for FIPS PUB 186-2. Use of the optional user input XSEED value is not supported by this class. An instance of this class will automatically reseed itself once it has generated 2 million x values (80 million bytes) since the last time it was seeded. This behavior is included to defend against the attack described in the Random Number Generation section of Change Notice 1 for FIPS PUB 186-2.
RandomBitsSource
, EntropySource
Constructor Summary | |
---|---|
DSARandomBitsSource() Creates a new seeded DSARandomBitsSource . |
|
DSARandomBitsSource(boolean seed) Creates a new, optionally seeded DSARandomBitsSource . |
Method Summary | |
---|---|
void |
clear() Returns the internal values used by this PRNG to their initial unseeded state. |
byte |
randomByte() Returns the next output byte. |
byte[] |
randomBytes(byte[] bytes) Fills the supplied array with the requsite number of output bytes. |
void |
seed(byte[] seed) Seeds this PRNG with the bytes in the given byte array. |
void |
seed(EntropySource es) Seed this PRNG with 20 bytes generated by the given EntropySource. |
Methods inherited from class oracle.security.crypto.core.RandomBitsSource |
---|
getDefault, getRNGTest, randomBigInt, randomBigInteger, seed, setDefault |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DSARandomBitsSource()
DSARandomBitsSource
.public DSARandomBitsSource(boolean seed)
DSARandomBitsSource
.
seed
- If true
, the seed(byte[])
method will be invoked by tis constructor.Method Detail |
---|
public void clear()
clear
in class RandomBitsSource
public void seed(byte[] seed)
seed
in class RandomBitsSource
seed
- The seeding material.java.lang.IllegalArgumentException
- If the the length of seed is less than 20 bytes or greater than 64 bytes.public void seed(EntropySource es)
seed
in class RandomBitsSource
es
- The EntropySource.EntropySource
public byte randomByte()
IllegalStateException is thrown.
Specified by:
randomByte
in class RandomBitsSource
java.lang.IllegalStateException
- If the PRNG is in an unseeded state.public byte[] randomBytes(byte[] bytes)
randomBytes
in class RandomBitsSource
|
Oracle Security Developer Tools Crypto Java API Reference 11g (11.1.1) E10668-02 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |