codex-contracts-eth/contracts/TestVerifier.sol
Mark Spanbroek f413f1ea64 Represent elements from field F_{p^2} as real + i * imag
Reason: Circom and Ethereum EIP-197 both represent these
elements as arrays of two elements, but they do it in
reverse order of each other. This change makes it explicit
which number is the real part, and which number is the
imaginary part.
2024-02-21 10:42:41 +01:00

23 lines
541 B
Solidity

// SPDX-License-Identifier: MIT
pragma solidity 0.8.23;
import "./Groth16.sol";
contract TestVerifier is IGroth16Verifier {
function verify(
Groth16Proof calldata proof,
uint[] calldata
) external pure returns (bool) {
// accepts any proof, except the proof with all zero values
return
!(proof.a.x == 0 &&
proof.a.y == 0 &&
proof.b.x.real == 0 &&
proof.b.x.imag == 0 &&
proof.b.y.real == 0 &&
proof.b.y.imag == 0 &&
proof.c.x == 0 &&
proof.c.y == 0);
}
}