Class YYrandom

java.lang.Object
  extended by YYrandom

public final class YYrandom
extends java.lang.Object


Constructor Summary
YYrandom(java.lang.String path, java.lang.String alias, boolean supplementovertime)
          When supplementovertime is true the states of the PRNGs are supplemented over time.
 
Method Summary
 java.lang.String generateRandomASCIIString(int length)
           
 ByteArray generatestrongseed(int length)
          Generates and returns random bytes using the internal SecureRandom object and using /dev/random if it is available.
 boolean genrandboolean()
           
 Reg16 genrandrangereg16(Reg16 in)
           
 Reg32 genrandrangereg32(Reg32 in)
           
 Reg16 genrandreg16()
           
 Reg32 genrandreg32()
           
 Reg32 genrandreg32even()
          Returns a random 32-bit value that is even.
 boolean genrationalprobability(byte n, byte m)
           
 ByteArray getbytes(int length)
          Returns random bytes generated based on internal SecureRandom object and internal ISAAC PRNG.
static void main()
           
 void supplementISAAC(ByteArray ent)
          Supplements entropy of internal ISAAC PRNG using supplied entropy in ent.
 void supplementsecurerandom(ByteArray ent)
          Supplements entropy of internal SecureRandom object using supplied entropy in ent.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

YYrandom

public YYrandom(java.lang.String path,
                java.lang.String alias,
                boolean supplementovertime)
         throws FeralcoreException,
                java.security.NoSuchAlgorithmException,
                java.io.FileNotFoundException,
                java.io.IOException,
                java.lang.InterruptedException
When supplementovertime is true the states of the PRNGs are supplemented over time.

Throws:
FeralcoreException
java.security.NoSuchAlgorithmException
java.io.FileNotFoundException
java.io.IOException
java.lang.InterruptedException
Method Detail

generateRandomASCIIString

public java.lang.String generateRandomASCIIString(int length)
                                           throws FeralcoreException,
                                                  java.io.FileNotFoundException,
                                                  java.io.IOException,
                                                  java.io.UnsupportedEncodingException
Throws:
FeralcoreException
java.io.FileNotFoundException
java.io.IOException
java.io.UnsupportedEncodingException

generatestrongseed

public ByteArray generatestrongseed(int length)
                             throws FeralcoreException,
                                    java.io.FileNotFoundException,
                                    java.io.IOException,
                                    java.lang.InterruptedException
Generates and returns random bytes using the internal SecureRandom object and using /dev/random if it is available.

Throws:
FeralcoreException
java.io.FileNotFoundException
java.io.IOException
java.lang.InterruptedException

getbytes

public ByteArray getbytes(int length)
                   throws FeralcoreException,
                          java.io.FileNotFoundException,
                          java.io.IOException
Returns random bytes generated based on internal SecureRandom object and internal ISAAC PRNG. An exception is thrown if length is <= 0.

Throws:
FeralcoreException
java.io.FileNotFoundException
java.io.IOException

supplementsecurerandom

public void supplementsecurerandom(ByteArray ent)
Supplements entropy of internal SecureRandom object using supplied entropy in ent.


supplementISAAC

public void supplementISAAC(ByteArray ent)
                     throws FeralcoreException
Supplements entropy of internal ISAAC PRNG using supplied entropy in ent.

Throws:
FeralcoreException

genrandboolean

public boolean genrandboolean()
                       throws FeralcoreException,
                              java.io.FileNotFoundException,
                              java.io.IOException
Throws:
FeralcoreException
java.io.FileNotFoundException
java.io.IOException

genrationalprobability

public boolean genrationalprobability(byte n,
                                      byte m)
                               throws FeralcoreException,
                                      java.io.FileNotFoundException,
                                      java.io.IOException
Throws:
FeralcoreException
java.io.FileNotFoundException
java.io.IOException

genrandreg16

public Reg16 genrandreg16()
                   throws FeralcoreException,
                          java.io.FileNotFoundException,
                          java.io.IOException
Throws:
FeralcoreException
java.io.FileNotFoundException
java.io.IOException

genrandreg32

public Reg32 genrandreg32()
                   throws FeralcoreException,
                          java.io.FileNotFoundException,
                          java.io.IOException
Throws:
FeralcoreException
java.io.FileNotFoundException
java.io.IOException

genrandreg32even

public Reg32 genrandreg32even()
                       throws FeralcoreException,
                              java.io.FileNotFoundException,
                              java.io.IOException
Returns a random 32-bit value that is even.

Throws:
FeralcoreException
java.io.FileNotFoundException
java.io.IOException

genrandrangereg16

public Reg16 genrandrangereg16(Reg16 in)
                        throws FeralcoreException,
                               java.io.FileNotFoundException,
                               java.io.IOException
Throws:
FeralcoreException
java.io.FileNotFoundException
java.io.IOException

genrandrangereg32

public Reg32 genrandrangereg32(Reg32 in)
                        throws FeralcoreException,
                               java.io.FileNotFoundException,
                               java.io.IOException
Throws:
FeralcoreException
java.io.FileNotFoundException
java.io.IOException

main

public static void main()
                 throws FeralcoreException,
                        java.security.NoSuchAlgorithmException,
                        java.io.FileNotFoundException,
                        java.io.IOException,
                        java.lang.InterruptedException
Throws:
FeralcoreException
java.security.NoSuchAlgorithmException
java.io.FileNotFoundException
java.io.IOException
java.lang.InterruptedException