ark_poly_commit/multilinear_pc/
data_structures.rs1use ark_ec::pairing::Pairing;
2use ark_serialize::{CanonicalDeserialize, CanonicalSerialize};
3#[cfg(not(feature = "std"))]
4use ark_std::vec::Vec;
5#[allow(type_alias_bounds)]
6pub type EvaluationHyperCubeOnG1<E: Pairing> = Vec<E::G1Affine>;
8#[allow(type_alias_bounds)]
9pub type EvaluationHyperCubeOnG2<E: Pairing> = Vec<E::G2Affine>;
11
12#[derive(CanonicalSerialize, CanonicalDeserialize, Clone, Debug)]
14pub struct UniversalParams<E: Pairing> {
15 pub num_vars: usize,
17 pub powers_of_g: Vec<EvaluationHyperCubeOnG1<E>>,
19 pub powers_of_h: Vec<EvaluationHyperCubeOnG2<E>>,
21 pub g: E::G1Affine,
23 pub h: E::G2Affine,
25 pub g_mask: Vec<E::G1Affine>,
27}
28
29#[derive(CanonicalSerialize, CanonicalDeserialize, Clone, Debug)]
31pub struct CommitterKey<E: Pairing> {
32 pub nv: usize,
34 pub powers_of_g: Vec<EvaluationHyperCubeOnG1<E>>,
36 pub powers_of_h: Vec<EvaluationHyperCubeOnG2<E>>,
38 pub g: E::G1Affine,
40 pub h: E::G2Affine,
42}
43
44#[derive(CanonicalSerialize, CanonicalDeserialize, Clone, Debug)]
46pub struct VerifierKey<E: Pairing> {
47 pub nv: usize,
49 pub g: E::G1Affine,
51 pub h: E::G2Affine,
53 pub g_mask_random: Vec<E::G1Affine>,
55}
56
57#[derive(CanonicalSerialize, CanonicalDeserialize, Clone, Debug)]
58pub struct Commitment<E: Pairing> {
60 pub nv: usize,
62 pub g_product: E::G1Affine,
64}
65
66#[derive(CanonicalSerialize, CanonicalDeserialize, Clone, Debug)]
67pub struct Proof<E: Pairing> {
69 pub proofs: Vec<E::G2Affine>,
71}