From 91388096c13aec09c486cbf96fa3a0f3d44c37d7 Mon Sep 17 00:00:00 2001 From: Mark Spanbroek Date: Tue, 30 Jan 2024 09:34:56 +0100 Subject: [PATCH] Fix: size in bytes of input and output were too high --- contracts/Groth16Verifier.sol | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/contracts/Groth16Verifier.sol b/contracts/Groth16Verifier.sol index cb84825..a656179 100644 --- a/contracts/Groth16Verifier.sol +++ b/contracts/Groth16Verifier.sol @@ -44,7 +44,7 @@ library Pairing { bool success; // solhint-disable-next-line no-inline-assembly assembly { - success := staticcall(sub(gas(), 2000), 6, input, 0xc0, r, 0x60) + success := staticcall(sub(gas(), 2000), 6, input, 128, sum, 64) } require(success, "pairing-add-failed"); } @@ -62,7 +62,7 @@ library Pairing { bool success; // solhint-disable-next-line no-inline-assembly assembly { - success := staticcall(sub(gas(), 2000), 7, input, 0x80, r, 0x60) + success := staticcall(sub(gas(), 2000), 7, input, 96, product, 64) } require(success, "pairing-mul-failed"); } @@ -94,10 +94,10 @@ library Pairing { success := staticcall( sub(gas(), 2000), 8, - add(input, 0x20), - mul(inputSize, 0x20), + add(input, 32), + mul(inputSize, 32), out, - 0x20 + 32 ) } require(success, "pairing-opcode-failed");