pub struct ArithmeticCircuit<P>{Show 18 fields
pub dim_nm: usize,
pub dim_no: usize,
pub k: usize,
pub dim_nl: usize,
pub dim_nv: usize,
pub dim_nw: usize,
pub g: ProjectivePoint,
pub g_vec: Vec<ProjectivePoint>,
pub h_vec: Vec<ProjectivePoint>,
pub W_m: Vec<Vec<Scalar>>,
pub W_l: Vec<Vec<Scalar>>,
pub a_m: Vec<Scalar>,
pub a_l: Vec<Scalar>,
pub f_l: bool,
pub f_m: bool,
pub g_vec_: Vec<ProjectivePoint>,
pub h_vec_: Vec<ProjectivePoint>,
pub partition: P,
}
Expand description
Represents arithmetic circuit. P - partition function.
Fields§
§dim_nm: usize
§dim_no: usize
§k: usize
§dim_nl: usize
Equals to: dim_nv * k
dim_nv: usize
Count of witness vectors v.
dim_nw: usize
Equals to: dim_nm + dim_nm + n_o
g: ProjectivePoint
§g_vec: Vec<ProjectivePoint>
Dimension: dim_nm
h_vec: Vec<ProjectivePoint>
Dimension: dim_nv+9
W_m: Vec<Vec<Scalar>>
Dimension: dim_nm * dim_nw
W_l: Vec<Vec<Scalar>>
Dimension: dim_nl * dim_nw
a_m: Vec<Scalar>
Dimension: dim_nm
a_l: Vec<Scalar>
Dimension: dim_nl
f_l: bool
§f_m: bool
§g_vec_: Vec<ProjectivePoint>
Vector of points that will be used in WNLA protocol.
Dimension: 2^n - dim_nm
h_vec_: Vec<ProjectivePoint>
Vector of points that will be used in WNLA protocol.
Dimension: 2^n - (dim_nv+9)
partition: P
Partition function to map w_o
and corresponding parts of W_m
and W_l
Implementations§
Source§impl<P> ArithmeticCircuit<P>
impl<P> ArithmeticCircuit<P>
Sourcepub fn commit(&self, v: &[Scalar], s: &Scalar) -> ProjectivePoint
pub fn commit(&self, v: &[Scalar], s: &Scalar) -> ProjectivePoint
Creates commitment to the arithmetic circuit witness.
Sourcepub fn verify(
&self,
v: &[ProjectivePoint],
t: &mut Transcript,
proof: Proof,
) -> bool
pub fn verify( &self, v: &[ProjectivePoint], t: &mut Transcript, proof: Proof, ) -> bool
Verifies arithmetic circuit proof with respect to the v
commitments vector.
Sourcepub fn prove<R>(
&self,
v: &[ProjectivePoint],
witness: Witness,
t: &mut Transcript,
rng: &mut R,
) -> Proof
pub fn prove<R>( &self, v: &[ProjectivePoint], witness: Witness, t: &mut Transcript, rng: &mut R, ) -> Proof
Creates arithmetic circuit proof for the corresponding witness. Also, v
commitments vector
should correspond input witness in witness
argument.