SunSPOT host API V3.0


com.sun.squawk.security.signing
Class PseudoRand

java.lang.Object
  extended by com.sun.squawk.security.signing.PseudoRand

public final class PseudoRand
extends Object

Implements a pseudo random number generator.


Constructor Summary
PseudoRand()
          Constructor for random data.
 
Method Summary
 void generateData(byte[] b, int off, int len)
          This does a reasonable job of producing unpredictable random data by using a one way hash as a mixing function and the current time in milliseconds as a source of entropy.
 void setSeed(byte[] b, int off, int len)
          Set the random number seed.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PseudoRand

public PseudoRand()
           throws CryptoException
Constructor for random data.

Throws:
CryptoException
Method Detail

generateData

public void generateData(byte[] b,
                         int off,
                         int len)
This does a reasonable job of producing unpredictable random data by using a one way hash as a mixing function and the current time in milliseconds as a source of entropy.

Parameters:
b - buffer of input data
off - offset into the provided buffer
len - length of the data to be processed

setSeed

public void setSeed(byte[] b,
                    int off,
                    int len)
Set the random number seed.

Parameters:
b - initial data to use as the seed
off - offset into the provided buffer
len - length of the data to be used

SunSPOT host API V3.0


Copyright © 2006, 2007 Sun Microsystems, Inc. All Rights Reserved.