public Paillier(BigInteger p,BigInteger q,int bitLength){
  this.bitLength=bitLength;
  int primeCertainty=SystemConfiguration.getIntProperty("pir.primeCertainty",128);
  BigInteger three=BigInteger.valueOf(3);
  if ((p.compareTo(three) < 0) || (q.compareTo(three) < 0) || p.equals(q)|| !p.isProbablePrime(primeCertainty)|| !q.isProbablePrime(primeCertainty)) {
    throw new IllegalArgumentException("p = " + p + " q = "+ q+ " do not satisfy primality constraints");
  }
  this.p=p;
  this.q=q;
  this.N=p.multiply(q);
  setDerivativeElements();
  logger.info("Parameters = " + parametersToString());
}

public Paillier ( BigInteger p , BigInteger q , int bitLength ) { this . bitLength = bitLength ; int primeCertainty = SystemConfiguration . getIntProperty ( "pir.primeCertainty" , 128 ) ; BigInteger three = BigInteger . valueOf ( 3 ) ; if ( ( p . compareTo ( three ) < 0 ) || ( q . compareTo ( three ) < 0 ) || p . equals ( q ) || ! p . isProbablePrime ( primeCertainty ) || ! q . isProbablePrime ( primeCertainty ) ) { throw new IllegalArgumentException ( "p = " + p + " q = " + q + " do not satisfy primality constraints" ) ; } this . p = p ; this . q = q ; this . N = p . multiply ( q ) ; setDerivativeElements ( ) ; logger . info ( "Parameters = " + parametersToString ( ) ) ; }
creates a paillier algorithm with all parameters specified .
