de.flexiprovider.ec
Class ECPRNG
java.lang.Object
|
+--java.security.SecureRandomSpi
|
+--de.flexiprovider.api.SecureRandom
|
+--de.flexiprovider.ec.ECPRNG
- All Implemented Interfaces:
- java.io.Serializable
- public class ECPRNG
- extends SecureRandom
This class implements a pseudorandom number generator as proposed by Kaliski.
Its security bases on the elliptic curve discrete logarithm problem. For
details, we refer to the ICICS 2002 paper of H. Baier.
The curve parameters are stored in a file named 'curve_parameters'. This file
has to be stored in the same directory as the Java-class containing the
main(...)-method . The validity of the parameters is not checked!!! Thus the
user is responsible for a good choice.
- Author:
- Harald Baier
- See Also:
EllipticCurveGFP, Serialized Form
|
Field Summary |
(package private) static long |
counter
Computes the required random bytes. |
|
Constructor Summary |
ECPRNG()
Constructor. |
|
Method Summary |
byte[] |
generateSeed(int numBytes)
Generate a seed of the given length. |
void |
nextBytes(byte[] randomBytes)
|
void |
setSeed(byte[] seed)
Sets the seed to the given argument. |
| Methods inherited from class java.lang.Object |
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
counter
static long counter
- Computes the required random bytes.
ECPRNG
public ECPRNG()
throws InvalidPointException
- Constructor.
- Throws:
InvalidPointException - should not happen with the default parameters.
generateSeed
public byte[] generateSeed(int numBytes)
- Generate a seed of the given length.
- Overrides:
generateSeed in class SecureRandom
- Parameters:
numBytes - -
the intended number of seed bytes- Returns:
- the seed as array of bytes
setSeed
public void setSeed(byte[] seed)
- Sets the seed to the given argument.
- Overrides:
setSeed in class SecureRandom
- Parameters:
seed - -
the seed
nextBytes
public void nextBytes(byte[] randomBytes)
- Overrides:
nextBytes in class SecureRandom