From a4ce10f4dea11f025a18531eff5d0a3955c682b3 Mon Sep 17 00:00:00 2001 From: Mark Spanbroek Date: Tue, 30 Jan 2024 15:09:15 +0100 Subject: [PATCH] One less addition --- contracts/Groth16Verifier.sol | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/contracts/Groth16Verifier.sol b/contracts/Groth16Verifier.sol index 2a8390e..b5b5b9b 100644 --- a/contracts/Groth16Verifier.sol +++ b/contracts/Groth16Verifier.sol @@ -139,7 +139,7 @@ contract Groth16Verifier { } } // Compute the linear combination vkX - G1Point memory vkX = G1Point(0, 0); + G1Point memory vkX = _verifyingKey.ic[0]; for (uint i = 0; i < input.length; i++) { G1Point memory product; (success, product) = _multiply(_verifyingKey.ic[i + 1], input[i]); @@ -151,10 +151,6 @@ contract Groth16Verifier { return false; } } - (success, vkX) = _add(vkX, _verifyingKey.ic[0]); - if (!success) { - return false; - } uint outcome; (success, outcome) = _checkPairing( _negate(proof.a),