Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Cryptix V3.1
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## cryptix.provider.elgamal
Class GenericElGamalParameterSet

    java.lang.Object
      |
      +--cryptix.provider.elgamal.GenericElGamalParameterSet

Direct Known Subclasses:
  DefaultElGamalParameterSet

public class GenericElGamalParameterSet
extends Object

This class represents a set of ElGamal parameters for various prime lengths.

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:

1. Bruce Schneier, "Section 11.3 Number Theory" (heading "Calculating Discrete Logarithms in a Finite Group," pages 262-263), Applied Cryptography, 2nd edition, John Wiley & Sons, 1996.

Copyright © 1997 Systemics Ltd on behalf of the Cryptix Development Team.
All rights reserved.

$Revision: 1.3 $

Since:
  Cryptix 2.2.2
Author:
  David Hopwood
See Also:
  `cryptix.examples.CreateElGamalParameterSet`, `cryptix.security.elgamal.BaseElGamalKeyPairGenerator`

Constructor Summary
`protected` | `GenericElGamalParameterSet(int[] primeLengths, String[][] precomputed)` Subclasses should call this constructor to determine the parameters that will be returned by `getParameters`.

Method Summary
`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.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### GenericElGamalParameterSet

    protected GenericElGamalParameterSet(int[] primeLengths,
                                         String[][] precomputed)

  Subclasses should call this constructor to determine the parameters that will be returned by `getParameters`.
  Parameters:
    `primeLengths` - an array of bit lengths for each prime
    `precomputedP` - an array of hex strings representing each prime
    `precomputedG` - an array of hex strings representing each base
  Throws:
    IllegalArgumentException - if the arrays are not all the same length.

Method Detail

### getParameters

    public ElGamalParams getParameters(int primeLength)

  If primeLength corresponds to one of the precomputed prime lengths, this method returns a corresponding ElGamalParams object. Otherwise, it returns null.

### checkSane

    public void checkSane()
                   throws InvalidParameterException

  Throws an InvalidParameterException if any of the parameters are obviously incorrect.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Cryptix V3.1
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright (C) 1995-2000 The Cryptix Foundation Ltd. All rights reserved.