add verifyProof overload that accepts a single array of snark proof params

This commit is contained in:
poma 2019-09-07 16:34:28 -04:00
parent f2e5bc56b3
commit 8415055588
3 changed files with 26 additions and 0 deletions

View File

@ -220,4 +220,11 @@ contract Verifier {
return false;
}
}
function verifyProof(uint[8] memory proof, uint[<%vk_input_length%>] memory inputs) public view returns (bool r) {
return verifyProof(
[proof[0], proof[1]],
[[proof[2], proof[3]], [proof[4], proof[5]]],
[proof[6], proof[7]],
inputs);
}
}

View File

@ -211,4 +211,11 @@ contract Verifier {
return false;
}
}
function verifyProof(uint[8] memory proof, uint[<%vk_input_length%>] memory inputs) public view returns (bool r) {
return verifyProof(
[proof[0], proof[1]],
[[proof[2], proof[3]], [proof[4], proof[5]]],
[proof[6], proof[7]],
inputs);
}
}

View File

@ -238,6 +238,18 @@ contract Verifier {
return false;
}
}
function verifyProof(uint[18] memory proof, uint[<%vk_input_length%>] memory inputs) public view returns (bool r) {
return verifyProof(
[proof[0], proof[1]],
[proof[2], proof[3]],
[[proof[4], proof[5]], [proof[6], proof[7]]],
[proof[8], proof[9]],
[proof[10], proof[11]],
[proof[12], proof[13]],
[proof[14], proof[15]],
[proof[16], proof[17]],
inputs);
}
}