Merge pull request #1368 from Zokrates/fix-staticcall
Fix input/output size in staticcall for addition and scalar_mul
This commit is contained in:
commit
8699128ad0
2 changed files with 3 additions and 2 deletions
1
changelogs/unreleased/1368-dark64
Normal file
1
changelogs/unreleased/1368-dark64
Normal file
|
@ -0,0 +1 @@
|
||||||
|
Fix staticcall input/output size in `addition` & `scalar_mul`
|
|
@ -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() }
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue