test_class.file: pross-common/src/test/java/com/ibm/pross/common/util/crypto/paillier/PaillierKeyGeneratorTest.java
test_class.identifier: PaillierKeyGeneratorTest
test_case.body: @Test
  	public void testGenerate() {
  		fail("Not yet implemented");
  	}
test_case.class_method_signature: PaillierKeyGeneratorTest.testGenerate()
test_case.full_signature: @Test public void testGenerate()
test_case.identifier: testGenerate
test_case.invocations: fail
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testGenerate()
focal_class.declarator: DEFAULT_KEY_LEN = 2048
focal_class.modifier: public static final
focal_class.original_string: public static final int DEFAULT_KEY_LEN = 2048;
focal_class.type: int
focal_class.var_name: DEFAULT_KEY_LEN
focal_class.declarator: keyLength
focal_class.modifier: private final
focal_class.original_string: private final int keyLength;
focal_class.type: int
focal_class.var_name: keyLength
focal_class.file: pross-common/src/main/java/com/ibm/pross/common/util/crypto/paillier/PaillierKeyGenerator.java
focal_class.identifier: PaillierKeyGenerator
focal_class.class_method_signature: PaillierKeyGenerator.PaillierKeyGenerator()
focal_class.full_signature: public  PaillierKeyGenerator()
focal_class.identifier: PaillierKeyGenerator
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.signature:  PaillierKeyGenerator()
focal_class.class_method_signature: PaillierKeyGenerator.PaillierKeyGenerator(final int keyLength)
focal_class.full_signature: public  PaillierKeyGenerator(final int keyLength)
focal_class.identifier: PaillierKeyGenerator
focal_class.modifiers: public
focal_class.parameters: (final int keyLength)
focal_class.signature:  PaillierKeyGenerator(final int keyLength)
focal_class.class_method_signature: PaillierKeyGenerator.generate()
focal_class.full_signature: public PaillierKeyPair generate()
focal_class.identifier: generate
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: PaillierKeyPair
focal_class.signature: PaillierKeyPair generate()
focal_method.body: public PaillierKeyPair generate() {
  		final SecureRandom random = new SecureRandom();
  
  		final BigInteger p = BigInteger.probablePrime(this.keyLength / 2, random); // random prime
  		final BigInteger q = BigInteger.probablePrime(this.keyLength / 2, random); // random prime
  
  		final BigInteger n = p.multiply(q); // p*q
  		final BigInteger nSquared = n.multiply(n); // n^2
  
  		final BigInteger pMinusOne = p.subtract(BigInteger.ONE); // p - 1
  		final BigInteger qMinusOne = q.subtract(BigInteger.ONE); // q - 1
  
  		final BigInteger lambda = pMinusOne.multiply(qMinusOne); // totient(n)
  		final BigInteger g = n.add(BigInteger.ONE); // n + 1
  		final BigInteger mu = lambda.modInverse(n); // lambda^-1 % n
  
  		final PaillierPublicKey publicKey = new PaillierPublicKey(n, g, nSquared);
  		final PaillierPrivateKey privateKey = new PaillierPrivateKey(lambda, mu, n, nSquared);
  		
  		return new PaillierKeyPair(publicKey, privateKey);
  	}
focal_method.class_method_signature: PaillierKeyGenerator.generate()
focal_method.full_signature: public PaillierKeyPair generate()
focal_method.identifier: generate
focal_method.invocations: probablePrime probablePrime multiply multiply subtract subtract multiply add modInverse
focal_method.modifiers: public
focal_method.parameters: ()
focal_method.return: PaillierKeyPair
focal_method.signature: PaillierKeyPair generate()