From c81dfb07dd72cc9cc5e0653c2d6063761e19ff0d Mon Sep 17 00:00:00 2001 From: poma Date: Fri, 7 Feb 2020 22:55:41 +0800 Subject: [PATCH] move vk_x before the loop --- phase2/src/verifier_groth.sol | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/phase2/src/verifier_groth.sol b/phase2/src/verifier_groth.sol index 6baae3d..3f5d091 100644 --- a/phase2/src/verifier_groth.sol +++ b/phase2/src/verifier_groth.sol @@ -187,6 +187,7 @@ contract Verifier { // Compute the linear combination vk_x Pairing.G1Point memory vk_x = Pairing.G1Point(0, 0); + vk_x = Pairing.plus(vk_x, vk.IC[0]); // Make sure that every input is less than the snark scalar field for (uint256 i = 0; i < input.length; i++) { @@ -194,8 +195,6 @@ contract Verifier { vk_x = Pairing.plus(vk_x, Pairing.scalar_mul(vk.IC[i + 1], input[i])); } - vk_x = Pairing.plus(vk_x, vk.IC[0]); - return Pairing.pairing( Pairing.negate(_proof.A), _proof.B,