move vk_x before the loop
This commit is contained in:
parent
f85e53b925
commit
c81dfb07dd
@ -187,6 +187,7 @@ contract Verifier {
|
|||||||
|
|
||||||
// Compute the linear combination vk_x
|
// Compute the linear combination vk_x
|
||||||
Pairing.G1Point memory vk_x = Pairing.G1Point(0, 0);
|
Pairing.G1Point memory vk_x = Pairing.G1Point(0, 0);
|
||||||
|
vk_x = Pairing.plus(vk_x, vk.IC[0]);
|
||||||
|
|
||||||
// Make sure that every input is less than the snark scalar field
|
// Make sure that every input is less than the snark scalar field
|
||||||
for (uint256 i = 0; i < input.length; i++) {
|
for (uint256 i = 0; i < input.length; i++) {
|
||||||
@ -194,8 +195,6 @@ contract Verifier {
|
|||||||
vk_x = Pairing.plus(vk_x, Pairing.scalar_mul(vk.IC[i + 1], input[i]));
|
vk_x = Pairing.plus(vk_x, Pairing.scalar_mul(vk.IC[i + 1], input[i]));
|
||||||
}
|
}
|
||||||
|
|
||||||
vk_x = Pairing.plus(vk_x, vk.IC[0]);
|
|
||||||
|
|
||||||
return Pairing.pairing(
|
return Pairing.pairing(
|
||||||
Pairing.negate(_proof.A),
|
Pairing.negate(_proof.A),
|
||||||
_proof.B,
|
_proof.B,
|
||||||
|
Loading…
Reference in New Issue
Block a user