Struct ArithmeticCircuit

Source
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>

Source

pub fn commit(&self, v: &[Scalar], s: &Scalar) -> ProjectivePoint

Creates commitment to the arithmetic circuit witness.

Source

pub fn verify( &self, v: &[ProjectivePoint], t: &mut Transcript, proof: Proof, ) -> bool

Verifies arithmetic circuit proof with respect to the v commitments vector.

Source

pub fn prove<R>( &self, v: &[ProjectivePoint], witness: Witness, t: &mut Transcript, rng: &mut R, ) -> Proof
where R: RngCore + CryptoRng,

Creates arithmetic circuit proof for the corresponding witness. Also, v commitments vector should correspond input witness in witness argument.

Auto Trait Implementations§

§

impl<P> Freeze for ArithmeticCircuit<P>
where P: Freeze,

§

impl<P> RefUnwindSafe for ArithmeticCircuit<P>
where P: RefUnwindSafe,

§

impl<P> Send for ArithmeticCircuit<P>
where P: Send,

§

impl<P> Sync for ArithmeticCircuit<P>
where P: Sync,

§

impl<P> Unpin for ArithmeticCircuit<P>
where P: Unpin,

§

impl<P> UnwindSafe for ArithmeticCircuit<P>
where P: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.