2024-01-10 15:12:06 +01:00
|
|
|
// SPDX-License-Identifier: MIT
|
2024-01-23 10:24:02 +01:00
|
|
|
pragma solidity 0.8.23;
|
2024-01-10 15:12:06 +01:00
|
|
|
|
2024-01-23 13:28:53 +01:00
|
|
|
import "./Groth16.sol";
|
2024-01-10 15:12:06 +01:00
|
|
|
|
2024-01-23 13:28:53 +01:00
|
|
|
contract TestVerifier is IGroth16Verifier {
|
|
|
|
function verify(
|
2024-01-25 09:59:01 +01:00
|
|
|
Groth16Proof calldata proof,
|
2024-01-23 12:50:14 +01:00
|
|
|
uint[] calldata
|
2024-01-25 09:59:01 +01: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 17:16:49 +01:00
|
|
|
proof.b.x.real == 0 &&
|
|
|
|
proof.b.x.imag == 0 &&
|
|
|
|
proof.b.y.real == 0 &&
|
|
|
|
proof.b.y.imag == 0 &&
|
2024-01-25 09:59:01 +01:00
|
|
|
proof.c.x == 0 &&
|
|
|
|
proof.c.y == 0);
|
2024-01-10 15:12:06 +01:00
|
|
|
}
|
|
|
|
}
|