added revert reasons to the snark_scalar_field checks in verifier.sol templates
This commit is contained in:
parent
f8ba7cbfa7
commit
2e9be76932
@ -188,7 +188,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);
|
||||||
for (uint i = 0; i < input.length; i++) {
|
for (uint i = 0; i < input.length; i++) {
|
||||||
require(input[i] < snark_scalar_field);
|
require(input[i] < snark_scalar_field,"verifier-gte-snark-scalar-field");
|
||||||
vk_x = Pairing.addition(vk_x, Pairing.scalar_mul(vk.IC[i + 1], input[i]));
|
vk_x = Pairing.addition(vk_x, Pairing.scalar_mul(vk.IC[i + 1], input[i]));
|
||||||
}
|
}
|
||||||
vk_x = Pairing.addition(vk_x, vk.IC[0]);
|
vk_x = Pairing.addition(vk_x, vk.IC[0]);
|
||||||
|
@ -179,7 +179,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);
|
||||||
for (uint i = 0; i < input.length; i++) {
|
for (uint i = 0; i < input.length; i++) {
|
||||||
require(input[i] < snark_scalar_field);
|
require(input[i] < snark_scalar_field,"verifier-gte-snark-scalar-field");
|
||||||
vk_x = Pairing.addition(vk_x, Pairing.scalar_mul(vk.IC[i + 1], input[i]));
|
vk_x = Pairing.addition(vk_x, Pairing.scalar_mul(vk.IC[i + 1], input[i]));
|
||||||
}
|
}
|
||||||
vk_x = Pairing.addition(vk_x, vk.IC[0]);
|
vk_x = Pairing.addition(vk_x, vk.IC[0]);
|
||||||
|
@ -189,7 +189,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);
|
||||||
for (uint i = 0; i < input.length; i++) {
|
for (uint i = 0; i < input.length; i++) {
|
||||||
require(input[i] < snark_scalar_field);
|
require(input[i] < snark_scalar_field,"verifier-gte-snark-scalar-field");
|
||||||
vk_x = Pairing.addition(vk_x, Pairing.scalar_mul(vk.IC[i + 1], input[i]));
|
vk_x = Pairing.addition(vk_x, Pairing.scalar_mul(vk.IC[i + 1], input[i]));
|
||||||
}
|
}
|
||||||
vk_x = Pairing.addition(vk_x, vk.IC[0]);
|
vk_x = Pairing.addition(vk_x, vk.IC[0]);
|
||||||
|
Loading…
Reference in New Issue
Block a user