test_class.file: pross-common/src/test/java/com/ibm/pross/common/util/crypto/paillier/PaillierCipherTest.java
test_class.identifier: PaillierCipherTest
test_case.body: @Test
  	public void testEncryptPerformance() {
  		
  		final PaillierKeyGenerator keyGenerator = new PaillierKeyGenerator(2048);
  		final PaillierKeyPair keyPair = keyGenerator.generate();
  		
  		// Generate random input
  		final BigInteger n = keyPair.getPublicKey().getN();
  		
  		
  		// Warm up
  		BigInteger encrypted = null;
  		for (int i = 0; i < 20; i++)
  		{
  			final BigInteger x = RandomNumberGenerator.generateRandomInteger(n);
  			encrypted = PaillierCipher.encrypt(keyPair.getPublicKey(), x);
  		}
  		System.out.println("size: " + (encrypted.toByteArray().length));
  		
  		// Do test
  		long timeNs = 0;
  		final int iterations = 1000;
  		final PaillierPublicKey publicKey = keyPair.getPublicKey();
  		for (int i = 0; i < iterations; i++)
  		{
  			final BigInteger x = RandomNumberGenerator.generateRandomInteger(n);
  			final long start = System.nanoTime();
  			PaillierCipher.encrypt(publicKey, x);
  			final long end = System.nanoTime();
  			timeNs += (end - start);
  		}
  		
  		System.out.println("Total time (ms): " + timeNs / (((long)iterations) * 1_000_000.0));
  	}
test_case.class_method_signature: PaillierCipherTest.testEncryptPerformance()
test_case.full_signature: @Test public void testEncryptPerformance()
test_case.identifier: testEncryptPerformance
test_case.invocations: generate getN getPublicKey generateRandomInteger encrypt getPublicKey println toByteArray getPublicKey generateRandomInteger nanoTime encrypt nanoTime println
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testEncryptPerformance()
focal_class.file: pross-common/src/main/java/com/ibm/pross/common/util/crypto/paillier/PaillierCipher.java
focal_class.identifier: PaillierCipher
focal_class.class_method_signature: PaillierCipher.l(final BigInteger u, final BigInteger n)
focal_class.full_signature: private static BigInteger l(final BigInteger u, final BigInteger n)
focal_class.identifier: l
focal_class.modifiers: private static
focal_class.parameters: (final BigInteger u, final BigInteger n)
focal_class.return: BigInteger
focal_class.signature: BigInteger l(final BigInteger u, final BigInteger n)
focal_class.class_method_signature: PaillierCipher.encrypt(final PaillierPublicKey encryptionKey, final BigInteger message)
focal_class.full_signature: public static BigInteger encrypt(final PaillierPublicKey encryptionKey, final BigInteger message)
focal_class.identifier: encrypt
focal_class.modifiers: public static
focal_class.parameters: (final PaillierPublicKey encryptionKey, final BigInteger message)
focal_class.return: BigInteger
focal_class.signature: BigInteger encrypt(final PaillierPublicKey encryptionKey, final BigInteger message)
focal_class.class_method_signature: PaillierCipher.encrypt(final PaillierPublicKey encryptionKey, final BigInteger message,
  			final BigInteger r)
focal_class.full_signature: public static BigInteger encrypt(final PaillierPublicKey encryptionKey, final BigInteger message,
  			final BigInteger r)
focal_class.identifier: encrypt
focal_class.modifiers: public static
focal_class.parameters: (final PaillierPublicKey encryptionKey, final BigInteger message,
  			final BigInteger r)
focal_class.return: BigInteger
focal_class.signature: BigInteger encrypt(final PaillierPublicKey encryptionKey, final BigInteger message,
  			final BigInteger r)
focal_class.class_method_signature: PaillierCipher.decrypt(final PaillierPrivateKey decryptionKey, final BigInteger ciphertext)
focal_class.full_signature: public static BigInteger decrypt(final PaillierPrivateKey decryptionKey, final BigInteger ciphertext)
focal_class.identifier: decrypt
focal_class.modifiers: public static
focal_class.parameters: (final PaillierPrivateKey decryptionKey, final BigInteger ciphertext)
focal_class.return: BigInteger
focal_class.signature: BigInteger decrypt(final PaillierPrivateKey decryptionKey, final BigInteger ciphertext)
focal_method.body: public static BigInteger encrypt(final PaillierPublicKey encryptionKey, final BigInteger message) {
  		final BigInteger n = encryptionKey.getN();
  		final BigInteger r = RandomNumberGenerator.generateRandomCoprimeInRange(n);
  		return encrypt(encryptionKey, message, r);
  	}
focal_method.class_method_signature: PaillierCipher.encrypt(final PaillierPublicKey encryptionKey, final BigInteger message)
focal_method.full_signature: public static BigInteger encrypt(final PaillierPublicKey encryptionKey, final BigInteger message)
focal_method.identifier: encrypt
focal_method.invocations: getN generateRandomCoprimeInRange encrypt
focal_method.modifiers: public static
focal_method.parameters: (final PaillierPublicKey encryptionKey, final BigInteger message)
focal_method.return: BigInteger
focal_method.signature: BigInteger encrypt(final PaillierPublicKey encryptionKey, final BigInteger message)