From a77407237213833473365b73d24be6d255cccab8 Mon Sep 17 00:00:00 2001 From: dark64 Date: Wed, 3 Apr 2024 19:45:01 +0200 Subject: [PATCH 1/3] fix input/output size in staticcall for addition/scalar_mul --- zokrates_proof_systems/src/solidity.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zokrates_proof_systems/src/solidity.rs b/zokrates_proof_systems/src/solidity.rs index f30e27f85..1a4d9c81f 100644 --- a/zokrates_proof_systems/src/solidity.rs +++ b/zokrates_proof_systems/src/solidity.rs @@ -456,7 +456,7 @@ library Pairing { input[3] = p2.Y; bool success; assembly { - success := staticcall(sub(gas(), 2000), 6, input, 0xc0, r, 0x60) + success := staticcall(sub(gas(), 2000), 6, input, 0x80, r, 0x40) // Use "invalid" to make gas estimation work switch success case 0 { invalid() } } From 56fa4f7eb01b046e0f4ec0b7cd8f7131011a416f Mon Sep 17 00:00:00 2001 From: dark64 Date: Wed, 3 Apr 2024 20:30:45 +0200 Subject: [PATCH 2/3] add changelog --- changelogs/unreleased/1368-dark64 | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelogs/unreleased/1368-dark64 diff --git a/changelogs/unreleased/1368-dark64 b/changelogs/unreleased/1368-dark64 new file mode 100644 index 000000000..00fe5cf44 --- /dev/null +++ b/changelogs/unreleased/1368-dark64 @@ -0,0 +1 @@ +Fix staticcall input/output size in `addition` & `scalar_mul` \ No newline at end of file From a1e4d660f6d08f7f75d28803c75b1577a3d4a6a1 Mon Sep 17 00:00:00 2001 From: dark64 Date: Mon, 15 Apr 2024 14:36:02 +0200 Subject: [PATCH 3/3] fix sizes in scalar_mul --- zokrates_proof_systems/src/solidity.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zokrates_proof_systems/src/solidity.rs b/zokrates_proof_systems/src/solidity.rs index 1a4d9c81f..bc6985482 100644 --- a/zokrates_proof_systems/src/solidity.rs +++ b/zokrates_proof_systems/src/solidity.rs @@ -481,7 +481,7 @@ library Pairing { input[2] = s; bool success; assembly { - success := staticcall(sub(gas(), 2000), 7, input, 0x80, r, 0x60) + success := staticcall(sub(gas(), 2000), 7, input, 0x60, r, 0x40) // Use "invalid" to make gas estimation work switch success case 0 { invalid() } }