Skip navigation links

Oracle Fusion Middleware Crypto Java API Reference for Oracle Security Developer Tools
11g Release 1 (11.1.1)

E10668-03


oracle.security.crypto.core
Class DSARandomBitsSource

java.lang.Object
  extended by oracle.security.crypto.core.RandomBitsSource
      extended by oracle.security.crypto.core.DSARandomBitsSource


public class DSARandomBitsSource
extends RandomBitsSource

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.

Since:
3.0
See Also:
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

DSARandomBitsSource

public DSARandomBitsSource()
Creates a new seeded DSARandomBitsSource.

DSARandomBitsSource

public DSARandomBitsSource(boolean seed)
Creates a new, optionally seeded DSARandomBitsSource.
Parameters:
seed - If true, the seed(byte[]) method will be invoked by tis constructor.

Method Detail

clear

public void clear()
Returns the internal values used by this PRNG to their initial unseeded state. After calling this method, the PRNG must be re-seeded before it can be used to generate additional random values.
Specified by:
clear in class RandomBitsSource

seed

public void seed(byte[] seed)
Seeds this PRNG with the bytes in the given byte array. The byte array must be no less than 20 bytes in length and no greater than 64 bytes in length.
Specified by:
seed in class RandomBitsSource
Parameters:
seed - The seeding material.
Throws:
java.lang.IllegalArgumentException - If the the length of seed is less than 20 bytes or greater than 64 bytes.

seed

public void seed(EntropySource es)
Seed this PRNG with 20 bytes generated by the given EntropySource.
Specified by:
seed in class RandomBitsSource
Parameters:
es - The EntropySource.
See Also:
EntropySource

randomByte

public byte randomByte()
Returns the next output byte. If the PRNG is in an unseeded state, an IllegalStateException is thrown.
Specified by:
randomByte in class RandomBitsSource
Throws:
java.lang.IllegalStateException - If the PRNG is in an unseeded state.

randomBytes

public byte[] randomBytes(byte[] bytes)
Fills the supplied array with the requsite number of output bytes. (If the PRNG is in an unseeded state, an exception will be thrown.)
Overrides:
randomBytes in class RandomBitsSource

Skip navigation links

Oracle Fusion Middleware Crypto Java API Reference for Oracle Security Developer Tools
11g Release 1 (11.1.1)

E10668-03


Copyright © 2005, 2011 , Oracle. All rights reserved.