mirror of
https://github.com/codex-storage/codex-contracts-eth.git
synced 2025-01-10 03:45:41 +00:00
f413f1ea64
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.
23 lines
541 B
Solidity
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);
|
|
}
|
|
}
|