From c558e7821a1b865bf85b409f69d017660b1ac06b Mon Sep 17 00:00:00 2001 From: arnaucube Date: Tue, 9 Apr 2024 16:01:15 +0200 Subject: [PATCH] solidity-verifiers: groth16 template: port the fix from https://github.com/iden3/snarkjs/pull/480 & https://github.com/iden3/snarkjs/issues/479 --- solidity-verifiers/templates/groth16_verifier.askama.sol | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/solidity-verifiers/templates/groth16_verifier.askama.sol b/solidity-verifiers/templates/groth16_verifier.askama.sol index 5d466bd5..e8e12035 100644 --- a/solidity-verifiers/templates/groth16_verifier.askama.sol +++ b/solidity-verifiers/templates/groth16_verifier.askama.sol @@ -56,7 +56,7 @@ contract Groth16Verifier { function verifyProof(uint[2] calldata _pA, uint[2][2] calldata _pB, uint[2] calldata _pC, uint[{{ gamma_abc_len - 1 }}] calldata _pubSignals) public view returns (bool) { assembly { function checkField(v) { - if iszero(lt(v, q)) { + if iszero(lt(v, r)) { mstore(0, 0) return(0, 0x20) } @@ -166,4 +166,4 @@ contract Groth16Verifier { return(0, 0x20) } } -} \ No newline at end of file +}