2024-01-18 12:50:54 +00:00
|
|
|
// SPDX-License-Identifier: MIT
|
2024-01-23 09:24:02 +00:00
|
|
|
pragma solidity 0.8.23;
|
2024-01-18 12:50:54 +00:00
|
|
|
|
|
|
|
struct G1Point {
|
2024-01-31 10:55:32 +00:00
|
|
|
uint256 x;
|
|
|
|
uint256 y;
|
2024-01-18 12:50:54 +00:00
|
|
|
}
|
|
|
|
|
2024-02-20 16:16:49 +00:00
|
|
|
// A field element F_{p^2} encoded as `real + i * imag`.
|
|
|
|
// We chose to not represent this as an array of 2 numbers, because both Circom
|
|
|
|
// and Ethereum EIP-197 encode to an array, but with conflicting encodings.
|
|
|
|
struct Fp2Element {
|
2024-01-31 10:55:32 +00:00
|
|
|
uint256 real;
|
|
|
|
uint256 imag;
|
2024-02-20 16:16:49 +00:00
|
|
|
}
|
|
|
|
|
2024-01-18 12:50:54 +00:00
|
|
|
struct G2Point {
|
2024-02-20 16:16:49 +00:00
|
|
|
Fp2Element x;
|
|
|
|
Fp2Element y;
|
2024-01-18 12:50:54 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
struct Groth16Proof {
|
2024-01-23 12:26:05 +00:00
|
|
|
G1Point a;
|
|
|
|
G2Point b;
|
|
|
|
G1Point c;
|
2024-01-18 12:50:54 +00:00
|
|
|
}
|
2024-01-23 12:28:53 +00:00
|
|
|
|
|
|
|
interface IGroth16Verifier {
|
|
|
|
function verify(
|
|
|
|
Groth16Proof calldata proof,
|
2024-01-31 10:55:32 +00:00
|
|
|
uint256[] calldata pubSignals
|
2024-01-23 12:28:53 +00:00
|
|
|
) external view returns (bool);
|
|
|
|
}
|