com.motorola.iden.provider
Class FIPS186

java.lang.Object
  |
  +--com.motorola.iden.security.SecureRandomSpi
        |
        +--com.motorola.iden.provider.FIPS186

public final class FIPS186
extends SecureRandomSpi

This class provides a crytpographically strong pseudo-random number generator based on the SHA-1 hash algorithm.

Note that if a seed is not provided, we attempt to provide sufficient seed bytes to completely randomize the internal state of the generator (20 bytes).

MOTOROLA and the Stylized M Logo are registered trademarks of Motorola, Inc. Reg. U.S. Pat. & Tm. Off.
© Copyright 2002 - 2004 Motorola, Inc. All Rights Reserved.

See Also:
[CipherSpi]

Constructor Summary
FIPS186()
          Create new FIPS186 instance.
 
Method Summary
protected  byte[] engineGenerateSeed(int numBytes)
          Returns the given number of seed bytes, computed using the seed generation algorithm based on handset background enviroment.
protected  void engineNextBytes(byte[] result)
          Generates a user-specified number of random bytes.
protected  void engineSetSeed(byte[] newseed)
          Reseeds this random object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FIPS186

public FIPS186()
Create new FIPS186 instance.
Method Detail

engineGenerateSeed

protected byte[] engineGenerateSeed(int numBytes)
Returns the given number of seed bytes, computed using the seed generation algorithm based on handset background enviroment. This call may be used to seed other random number generators. While we attempt to return a "truly random" sequence of bytes, we do not know exactly how random the bytes returned by this call are.
Overrides:
engineGenerateSeed in class SecureRandomSpi
Parameters:
numBytes - the number of seed bytes to generate.
Returns:
the seed bytes as many as numBytes.

engineSetSeed

protected void engineSetSeed(byte[] newseed)
Reseeds this random object. The given seed supplements, rather than replaces, the existing seed. Thus, repeated calls are guaranteed never to reduce randomness.
Overrides:
engineSetSeed in class SecureRandomSpi
Parameters:
seed - the seed.If null is present, default seed shall be picked up.

engineNextBytes

protected void engineNextBytes(byte[] result)
Generates a user-specified number of random bytes.
Overrides:
engineNextBytes in class SecureRandomSpi
Parameters:
bytes - the array to be filled in with random bytes.