2024-01-10 14:12:06 +00:00
|
|
|
// SPDX-License-Identifier: MIT
|
2024-01-23 09:24:02 +00:00
|
|
|
pragma solidity 0.8.23;
|
2024-01-10 14:12:06 +00:00
|
|
|
|
2024-01-23 12:28:53 +00:00
|
|
|
import "./Groth16.sol";
|
2024-01-10 14:12:06 +00:00
|
|
|
|
2024-01-23 12:28:53 +00:00
|
|
|
contract TestVerifier is IGroth16Verifier {
|
|
|
|
function verify(
|
2024-01-25 08:59:01 +00:00
|
|
|
Groth16Proof calldata proof,
|
2024-01-23 11:50:14 +00:00
|
|
|
uint[] calldata
|
2024-01-25 08:59:01 +00:00
|
|
|
) external pure returns (bool) {
|
|
|
|
// accepts any proof, except the proof with all zero values
|
|
|
|
return
|
|
|
|
!(proof.a.x == 0 &&
|
|
|
|
proof.a.y == 0 &&
|
2024-02-20 16:16:49 +00:00
|
|
|
proof.b.x.real == 0 &&
|
|
|
|
proof.b.x.imag == 0 &&
|
|
|
|
proof.b.y.real == 0 &&
|
|
|
|
proof.b.y.imag == 0 &&
|
2024-01-25 08:59:01 +00:00
|
|
|
proof.c.x == 0 &&
|
|
|
|
proof.c.y == 0);
|
2024-01-10 14:12:06 +00:00
|
|
|
}
|
|
|
|
}
|