l = params.getPrimeSize(); m = params.getExponentSize();
DHGenParameterSpec jceSpec = (DHGenParameterSpec) params; l = jceSpec.getPrimeSize(); m = jceSpec.getExponentSize(); } else if (params instanceof DHParameterSpec) { DHParameterSpec jceSpec = (DHParameterSpec) params; l = jceSpec.getP().bitLength(); m = jceSpec.getL();
  public void setup(Map attributes)  {    // do we have a SecureRandom, or should we use our own?    rnd = (SecureRandom) attributes.get(SOURCE_OF_RANDOMNESS);    // are we given a set of Diffie-Hellman generation parameters or we shall    // use our own?    DHGenParameterSpec params = (DHGenParameterSpec) attributes.get(DH_PARAMETERS);    // find out the desired sizes    if (params != null)      {        l = params.getPrimeSize();        m = params.getExponentSize();      }    else      {        Integer bi = (Integer) attributes.get(PRIME_SIZE);        l = (bi == null ? DEFAULT_PRIME_SIZE : bi.intValue());        bi = (Integer) attributes.get(EXPONENT_SIZE);        m = (bi == null ? DEFAULT_EXPONENT_SIZE : bi.intValue());      }    //      if ((L % 256) != 0 || L < 1024) {    if ((l % 256) != 0 || l < DEFAULT_PRIME_SIZE)      {        throw new IllegalArgumentException("invalid modulus size");      }    if ((m % 8) != 0 || m < DEFAULT_EXPONENT_SIZE)      {        throw new IllegalArgumentException("invalid exponent size");      }    if (m > l)      {        throw new IllegalArgumentException("exponent size > modulus size");      }    // what is the preferred encoding format    Integer formatID = (Integer) attributes.get(PREFERRED_ENCODING_FORMAT);    preferredFormat = formatID == null ? DEFAULT_ENCODING_FORMAT                                       : formatID.intValue();  }