public class GenericElGamalParameterSet
extends java.lang.Object
The best methods for computing discrete logarithms in GF(p) have an expensive pre-computation stage, but once the pre-computation has been done, individual logarithms can be calculated quickly. In order to make sure that a particular set of parameters does not become too much of a target because it is used in more than one application, you may wish to generate your own set of parameters.
References:
Copyright © 1997
Systemics Ltd on behalf of the
Cryptix Development Team.
All rights reserved.
$Revision: 1.4 $
cryptix.examples.CreateElGamalParameterSet
,
cryptix.security.elgamal.BaseElGamalKeyPairGenerator
Modifier | Constructor and Description |
---|---|
protected |
GenericElGamalParameterSet(int[] primeLengths,
java.lang.String[][] precomputed)
Subclasses should call this constructor to determine the parameters
that will be returned by
getParameters . |
Modifier and Type | Method and Description |
---|---|
void |
checkSane()
Throws an InvalidParameterException if any of the parameters are obviously
incorrect.
|
ElGamalParams |
getParameters(int primeLength)
If primeLength corresponds to one of the precomputed prime lengths,
this method returns a corresponding ElGamalParams object.
|
protected GenericElGamalParameterSet(int[] primeLengths, java.lang.String[][] precomputed)
getParameters
.primeLengths
- an array of bit lengths for each primeprecomputedP
- an array of hex strings representing each primeprecomputedG
- an array of hex strings representing each basejava.lang.IllegalArgumentException
- if the arrays are not all the
same length.public ElGamalParams getParameters(int primeLength)
public void checkSane() throws java.security.InvalidParameterException
java.security.InvalidParameterException