gnu.crypto.key.dss

Class FIPS186

public class FIPS186 extends Object

An implementation of the DSA parameters generation as described in FIPS-186.

References:
Digital Signature Standard (DSS), Federal Information Processing Standards Publication 186. National Institute of Standards and Technology.

Version: $Revision: 1.2 $

Field Summary
static intDSA_PARAMS_COUNTER
static intDSA_PARAMS_E
static intDSA_PARAMS_G
static intDSA_PARAMS_P
static intDSA_PARAMS_Q
static intDSA_PARAMS_SEED
Constructor Summary
FIPS186(int L, SecureRandom rnd)
Method Summary
BigInteger[]generateParameters()
This method generates the DSS p, q, and g parameters only when L (the modulus length) is not one of the following: 512, 768 and 1024.

Field Detail

DSA_PARAMS_COUNTER

public static final int DSA_PARAMS_COUNTER

DSA_PARAMS_E

public static final int DSA_PARAMS_E

DSA_PARAMS_G

public static final int DSA_PARAMS_G

DSA_PARAMS_P

public static final int DSA_PARAMS_P

DSA_PARAMS_Q

public static final int DSA_PARAMS_Q

DSA_PARAMS_SEED

public static final int DSA_PARAMS_SEED

Constructor Detail

FIPS186

public FIPS186(int L, SecureRandom rnd)

Method Detail

generateParameters

public BigInteger[] generateParameters()
This method generates the DSS p, q, and g parameters only when L (the modulus length) is not one of the following: 512, 768 and 1024. For those values of L, this implementation uses pre-computed values of p, q, and g given in the document CryptoSpec included in the security guide documentation of the standard JDK distribution.

The DSS requires two primes , p and q, satisfying the following three conditions:

The algorithm used to find these primes is as described in FIPS-186, section 2.2: GENERATION OF PRIMES. This prime generation scheme starts by using the Sha160 and a user supplied SEED to construct a prime, q, in the range 2159 < q < 2160. Once this is accomplished, the same SEED value is used to construct an X in the range 2L-1 < X < 2L. The prime, p, is then formed by rounding X to a number congruent to 1 mod 2q. In this implementation we use the same SEED value given in FIPS-186, Appendix 5.
Copyright © 2001, 2002, 2003 Free Software Foundation, Inc. All Rights Reserved.