1
0
Fork 0
mirror of synced 2025-09-24 04:40:05 +00:00

Merge pull request #1368 from Zokrates/fix-staticcall

Fix input/output size in staticcall for addition and scalar_mul
This commit is contained in:
Thibaut Schaeffer 2024-04-15 15:29:15 +02:00 committed by GitHub
commit 8699128ad0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 3 additions and 2 deletions

View file

@ -0,0 +1 @@
Fix staticcall input/output size in `addition` & `scalar_mul`

View file

@ -456,7 +456,7 @@ library Pairing {
input[3] = p2.Y; input[3] = p2.Y;
bool success; bool success;
assembly { 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 // Use "invalid" to make gas estimation work
switch success case 0 { invalid() } switch success case 0 { invalid() }
} }
@ -481,7 +481,7 @@ library Pairing {
input[2] = s; input[2] = s;
bool success; bool success;
assembly { 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 // Use "invalid" to make gas estimation work
switch success case 0 { invalid() } switch success case 0 { invalid() }
} }