Class cryptiX.rsa.RandomPrimeGenerator
All Packages Class Hierarchy This Package Previous Next Index
Class cryptiX.rsa.RandomPrimeGenerator
java.lang.Object
|
+----java.util.Observable
|
+----cryptiX.rsa.RandomPrimeGenerator
- public class RandomPrimeGenerator
- extends Observable
The generation of random and random prime numbers should be in BigInt class.
But BigInt is derived from Number and therefore could not extend Oberservable because
Java doesn't support multiple inheritance. If somebody knows a better solution let me know.
-
random(BigInt)
- Generate a random BigInt less a specified limit
-
random(Random, int)
- Generate a random BigInt with specified length
-
randomPrime(int)
- Generate a prime BigInt.
random
public BigInt random(BigInt limit)
- Generate a random BigInt less a specified limit
- Parameters:
- rng - the random number generator to use.
It is called an unspecified number of times.
- limit - specifies the range of the result.
- Returns:
- a BigInt in the range 0..limit-1 inclusive.
random
public BigInt random(Random rng,
int bitlen)
- Generate a random BigInt with specified length
- Parameters:
- rng - the random number generator to use.
It is called an unspecified number of times.
- bitlen - specifies the length of the result.
- Returns:
- a BigInt with bitlen bits
randomPrime
public BigInt randomPrime(int bitlen)
- Generate a prime BigInt.
- Parameters:
- rng - the random number generator to use.
It is called an unspecified number of times.
- limit - specifies the range of the result.
- Returns:
- a BigInt in the range 0..limit-1 inclusive.
All Packages Class Hierarchy This Package Previous Next Index