test_class.declarator: curve = CommonConfiguration.CURVE
test_class.modifier: public static final
test_class.original_string: public static final EcCurve curve = CommonConfiguration.CURVE;
test_class.type: EcCurve
test_class.var_name: curve
test_class.declarator: g = CommonConfiguration.g
test_class.modifier: public static final
test_class.original_string: public static final EcPoint g = CommonConfiguration.g;
test_class.type: EcPoint
test_class.var_name: g
test_class.declarator: h = CommonConfiguration.h
test_class.modifier: public static final
test_class.original_string: public static final EcPoint h = CommonConfiguration.h;
test_class.type: EcPoint
test_class.var_name: h
test_class.file: pross-common/src/test/java/com/ibm/pross/common/util/crypto/zkp/feldman/FeldmanEqRangeProofTest.java
test_class.identifier: FeldmanEqRangeProofTest
test_case.body: @Test
  	public void testAll() {
  
  		// Generate encryption key
  		System.out.println("Generating key...");
  		final PaillierKeyGenerator keyGenerator = new PaillierKeyGenerator(2048);
  		long s1 = System.nanoTime();
  		final PaillierKeyPair keyPair = keyGenerator.generate();
  		long e1 = System.nanoTime();
  		System.out.println("Done. Took: " + ((e1 - s1) / 1_000_000.0) + " ms");
  		System.out.println();
  
  		// Get public and private keys
  		final PaillierPublicKey publicKey = keyPair.getPublicKey();
  		final PaillierPrivateKey privateKey = keyPair.getPrivateKey();
  
  		final BigInteger share = BigInteger.valueOf(12345);
  
  		System.out.println("Encrypting share...");
  
  		// Generate randomness: r
  		final BigInteger n = publicKey.getN();
  
  		// Warm up
  		PaillierCipher.encrypt(publicKey, share);
  
  		// Encrypt value
  		long s2 = System.nanoTime();
  		final BigInteger r1 = RandomNumberGenerator.generateRandomCoprimeInRange(n);
  		final BigInteger E = PaillierCipher.encrypt(publicKey, share, r1);
  		long e2 = System.nanoTime();
  		System.out.println("Done. Took: " + ((e2 - s2) / 1_000_000.0) + " ms");
  		System.out.println();
  
  		// Create commitment
  		System.out.println("Creating Pedersen commitment...");
  		long s3 = System.nanoTime();
  		final BigInteger r2 = RandomNumberGenerator.generateRandomPositiveInteger(curve.getR());
  		final EcPoint S = curve.addPoints(curve.multiply(g, share), curve.multiply(h, r2));
  		long e3 = System.nanoTime();
  		System.out.println("Done. Took: " + ((e3 - s3) / 1_000_000.0) + " ms");
  		System.out.println();
  
  		// Generating zero knowledge proof
  		System.out.println("Generating zero knowledge proof...");
  		long s4 = System.nanoTime();
  		final FeldmanEqRangeProof proof = FeldmanEqRangeProofGenerator.generate(publicKey, share, r1, r2, E, S);
  		long e4 = System.nanoTime();
  		System.out.println("Done. Took: " + ((e4 - s4) / 1_000_000.0) + " ms");
  		System.out.println();
  
  		// Print proof
  		// System.out.println("Sizes: ");
  		// System.out.println("E1: " + proof.getE1().toByteArray().length);
  		// System.out.println("S1: " + proof.getS1().getX().toByteArray().length);
  		// System.out.println("Z: " + proof.getZ().toByteArray().length);
  		// System.out.println("Z1: " + proof.getZ1().toByteArray().length);
  		// System.out.println("Z2: " + proof.getZ2().toByteArray().length);
  
  		// Validate proof
  		System.out.println("Verifying zero knowledge proof...");
  		long s5 = System.nanoTime();
  		final boolean valid = FeldmanEqRangeProofVerifier.isValid(proof, E, S, publicKey);
  		long e5 = System.nanoTime();
  		System.out.println("Done. Took: " + ((e5 - s5) / 1_000_000.0) + " ms");
  		System.out.println("Proof is valid: " + valid);
  		Assert.assertTrue(valid);
  		System.out.println();
  
  		// Validate decryption
  		System.out.println("Decrypting share...");
  		long s6 = System.nanoTime();
  		final BigInteger decryptedShare = PaillierCipher.decrypt(privateKey, E);
  		long e6 = System.nanoTime();
  		System.out.println("Done. Took: " + ((e6 - s6) / 1_000_000.0) + " ms");
  		System.out.println("Recovered plaintext: " + share.equals(decryptedShare));
  		System.out.println("Result: " + decryptedShare);
  		Assert.assertEquals(share, decryptedShare);
  		System.out.println();
  
  	}
test_case.class_method_signature: FeldmanEqRangeProofTest.testAll()
test_case.full_signature: @Test public void testAll()
test_case.identifier: testAll
test_case.invocations: println nanoTime generate nanoTime println println getPublicKey getPrivateKey valueOf println getN encrypt nanoTime generateRandomCoprimeInRange encrypt nanoTime println println println nanoTime generateRandomPositiveInteger getR addPoints multiply multiply nanoTime println println println nanoTime generate nanoTime println println println nanoTime isValid nanoTime println println assertTrue println println nanoTime decrypt nanoTime println println equals println assertEquals println
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testAll()
focal_class.declarator: serialVersionUID = 968857084310495016L
focal_class.modifier: private static final
focal_class.original_string: private static final long serialVersionUID = 968857084310495016L;
focal_class.type: long
focal_class.var_name: serialVersionUID
focal_class.declarator: E1
focal_class.modifier: private final
focal_class.original_string: private final BigInteger E1;
focal_class.type: BigInteger
focal_class.var_name: E1
focal_class.declarator: S1
focal_class.modifier: private final
focal_class.original_string: private final EcPoint S1;
focal_class.type: EcPoint
focal_class.var_name: S1
focal_class.declarator: z
focal_class.modifier: private final
focal_class.original_string: private final BigInteger z;
focal_class.type: BigInteger
focal_class.var_name: z
focal_class.declarator: z1
focal_class.modifier: private final
focal_class.original_string: private final BigInteger z1;
focal_class.type: BigInteger
focal_class.var_name: z1
focal_class.declarator: z2
focal_class.modifier: private final
focal_class.original_string: private final BigInteger z2;
focal_class.type: BigInteger
focal_class.var_name: z2
focal_class.file: pross-common/src/main/java/com/ibm/pross/common/util/crypto/zkp/feldman/FeldmanEqRangeProof.java
focal_class.identifier: FeldmanEqRangeProof
focal_class.interfaces: implements Serializable
focal_class.class_method_signature: FeldmanEqRangeProof.FeldmanEqRangeProof(final BigInteger E1, final EcPoint S1, final BigInteger z, final BigInteger z1,
  			final BigInteger z2)
focal_class.full_signature: public  FeldmanEqRangeProof(final BigInteger E1, final EcPoint S1, final BigInteger z, final BigInteger z1,
  			final BigInteger z2)
focal_class.identifier: FeldmanEqRangeProof
focal_class.modifiers: public
focal_class.parameters: (final BigInteger E1, final EcPoint S1, final BigInteger z, final BigInteger z1,
  			final BigInteger z2)
focal_class.signature:  FeldmanEqRangeProof(final BigInteger E1, final EcPoint S1, final BigInteger z, final BigInteger z1,
  			final BigInteger z2)
focal_class.class_method_signature: FeldmanEqRangeProof.toString()
focal_class.full_signature: @Override public String toString()
focal_class.identifier: toString
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String toString()
focal_class.class_method_signature: FeldmanEqRangeProof.getE1()
focal_class.full_signature: public BigInteger getE1()
focal_class.identifier: getE1
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: BigInteger
focal_class.signature: BigInteger getE1()
focal_class.class_method_signature: FeldmanEqRangeProof.getS1()
focal_class.full_signature: public EcPoint getS1()
focal_class.identifier: getS1
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: EcPoint
focal_class.signature: EcPoint getS1()
focal_class.class_method_signature: FeldmanEqRangeProof.getZ()
focal_class.full_signature: public BigInteger getZ()
focal_class.identifier: getZ
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: BigInteger
focal_class.signature: BigInteger getZ()
focal_class.class_method_signature: FeldmanEqRangeProof.getZ1()
focal_class.full_signature: public BigInteger getZ1()
focal_class.identifier: getZ1
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: BigInteger
focal_class.signature: BigInteger getZ1()
focal_class.class_method_signature: FeldmanEqRangeProof.getZ2()
focal_class.full_signature: public BigInteger getZ2()
focal_class.identifier: getZ2
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: BigInteger
focal_class.signature: BigInteger getZ2()
focal_class.class_method_signature: FeldmanEqRangeProof.hashCode()
focal_class.full_signature: @Override public int hashCode()
focal_class.identifier: hashCode
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: int
focal_class.signature: int hashCode()
focal_class.class_method_signature: FeldmanEqRangeProof.equals(Object obj)
focal_class.full_signature: @Override public boolean equals(Object obj)
focal_class.identifier: equals
focal_class.modifiers: @Override public
focal_class.parameters: (Object obj)
focal_class.return: boolean
focal_class.signature: boolean equals(Object obj)
focal_class.class_method_signature: FeldmanEqRangeProof.getSize()
focal_class.full_signature: public long getSize()
focal_class.identifier: getSize
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: long
focal_class.signature: long getSize()
focal_method.body: @Override
  	public boolean equals(Object obj) {
  		if (this == obj)
  			return true;
  		if (obj == null)
  			return false;
  		if (getClass() != obj.getClass())
  			return false;
  		FeldmanEqRangeProof other = (FeldmanEqRangeProof) obj;
  		if (E1 == null) {
  			if (other.E1 != null)
  				return false;
  		} else if (!E1.equals(other.E1))
  			return false;
  		if (S1 == null) {
  			if (other.S1 != null)
  				return false;
  		} else if (!S1.equals(other.S1))
  			return false;
  		if (z == null) {
  			if (other.z != null)
  				return false;
  		} else if (!z.equals(other.z))
  			return false;
  		if (z1 == null) {
  			if (other.z1 != null)
  				return false;
  		} else if (!z1.equals(other.z1))
  			return false;
  		if (z2 == null) {
  			if (other.z2 != null)
  				return false;
  		} else if (!z2.equals(other.z2))
  			return false;
  		return true;
  	}
focal_method.class_method_signature: FeldmanEqRangeProof.equals(Object obj)
focal_method.full_signature: @Override public boolean equals(Object obj)
focal_method.identifier: equals
focal_method.invocations: getClass getClass equals equals equals equals equals
focal_method.modifiers: @Override public
focal_method.parameters: (Object obj)
focal_method.return: boolean
focal_method.signature: boolean equals(Object obj)