Struct kimchi_msm::witness::Witness

source ·
pub struct Witness<const N_WIT: usize, T> {
    pub cols: Box<[T; N_WIT]>,
}
Expand description

The witness columns used by a gate of the MSM circuits. It is generic over the number of columns, N_WIT, and the type of the witness, T. It is parametrized by a type T which can be either:

  • Vec<G::ScalarField> for the evaluations
  • PolyComm<G> for the commitments It can be used to represent the different subcircuits used by the project.

Fields§

§cols: Box<[T; N_WIT]>

A witness row is represented by an array of N witness columns When T is a vector, then the witness describes the rows of the circuit.

Implementations§

source§

impl<const N_WIT: usize, T> Witness<N_WIT, T>

source

pub fn len(&self) -> usize

source

pub fn is_empty(&self) -> bool

source§

impl<const N_WIT: usize, T: Zero + Clone> Witness<N_WIT, Vec<T>>

source

pub fn zero_vec(domain_size: usize) -> Self

source

pub fn to_pub_columns<const NPUB: usize>(&self) -> Witness<NPUB, Vec<T>>

Trait Implementations§

source§

impl<const N_WIT: usize, T: Clone> Clone for Witness<N_WIT, T>

source§

fn clone(&self) -> Witness<N_WIT, T>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<const N_WIT: usize, T: Debug> Debug for Witness<N_WIT, T>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<const N_WIT: usize, T: Zero + Clone> Default for Witness<N_WIT, T>

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl<const N: usize, F: FftField> Foldable<F> for Witness<N, Evaluations<F, Radix2EvaluationDomain<F>>>

source§

fn combine(a: Self, b: Self, challenge: F) -> Self

Combine two objects ‘a’ and ‘b’ into a new object using the challenge.
source§

impl<const N_WIT: usize, G: Send + Debug> FromParallelIterator<G> for Witness<N_WIT, G>

source§

fn from_par_iter<I>(par_iter: I) -> Selfwhere I: IntoParallelIterator<Item = G>,

Creates an instance of the collection from the parallel iterator par_iter. Read more
source§

impl<const N_WIT: usize, T: Hash> Hash for Witness<N_WIT, T>

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl<const N_WIT: usize, T> Index<usize> for Witness<N_WIT, T>

§

type Output = T

The returned type after indexing.
source§

fn index(&self, index: usize) -> &Self::Output

Performs the indexing (container[index]) operation. Read more
source§

impl<'lt, const N_WIT: usize, G> IntoIterator for &'lt Witness<N_WIT, G>

§

type Item = &'lt G

The type of the elements being iterated over.
§

type IntoIter = IntoIter<&'lt G, Global>

Which kind of iterator are we turning this into?
source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
source§

impl<const N_WIT: usize, F: Clone> IntoIterator for Witness<N_WIT, F>

source§

fn into_iter(self) -> Self::IntoIter

Iterate over the columns in the circuit.

§

type Item = F

The type of the elements being iterated over.
§

type IntoIter = IntoIter<F, Global>

Which kind of iterator are we turning this into?
source§

impl<'data, const N_WIT: usize, G> IntoParallelIterator for &'data Witness<N_WIT, G>where Vec<&'data G>: IntoParallelIterator,

§

type Iter = <Vec<&'data G, Global> as IntoParallelIterator>::Iter

The parallel iterator type that will be created.
§

type Item = <Vec<&'data G, Global> as IntoParallelIterator>::Item

The type of item that the parallel iterator will produce.
source§

fn into_par_iter(self) -> Self::Iter

Converts self into a parallel iterator. Read more
source§

impl<'data, const N_WIT: usize, G> IntoParallelIterator for &'data mut Witness<N_WIT, G>where Vec<&'data mut G>: IntoParallelIterator,

§

type Iter = <Vec<&'data mut G, Global> as IntoParallelIterator>::Iter

The parallel iterator type that will be created.
§

type Item = <Vec<&'data mut G, Global> as IntoParallelIterator>::Item

The type of item that the parallel iterator will produce.
source§

fn into_par_iter(self) -> Self::Iter

Converts self into a parallel iterator. Read more
source§

impl<const N_WIT: usize, G> IntoParallelIterator for Witness<N_WIT, G>where Vec<G>: IntoParallelIterator,

source§

fn into_par_iter(self) -> Self::Iter

Iterate over the columns in the circuit, in parallel.

§

type Iter = <Vec<G, Global> as IntoParallelIterator>::Iter

The parallel iterator type that will be created.
§

type Item = <Vec<G, Global> as IntoParallelIterator>::Item

The type of item that the parallel iterator will produce.
source§

impl<const N_WIT: usize, T: PartialEq> PartialEq<Witness<N_WIT, T>> for Witness<N_WIT, T>

source§

fn eq(&self, other: &Witness<N_WIT, T>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<const N_WIT: usize, T> TryFrom<Vec<T, Global>> for Witness<N_WIT, T>

§

type Error = String

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

fn try_from(value: Vec<T>) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl<const N_WIT: usize, T: Eq> Eq for Witness<N_WIT, T>

source§

impl<const N_WIT: usize, T> StructuralEq for Witness<N_WIT, T>

source§

impl<const N_WIT: usize, T> StructuralPartialEq for Witness<N_WIT, T>

source§

impl<const N: usize, G: CommitmentCurve> Witness<G> for Witness<N, Evaluations<G::ScalarField, Radix2EvaluationDomain<G::ScalarField>>>

Auto Trait Implementations§

§

impl<const N_WIT: usize, T> RefUnwindSafe for Witness<N_WIT, T>where T: RefUnwindSafe,

§

impl<const N_WIT: usize, T> Send for Witness<N_WIT, T>where T: Send,

§

impl<const N_WIT: usize, T> Sync for Witness<N_WIT, T>where T: Sync,

§

impl<const N_WIT: usize, T> Unpin for Witness<N_WIT, T>

§

impl<const N_WIT: usize, T> UnwindSafe for Witness<N_WIT, T>where T: UnwindSafe,

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. Read more
§

impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. 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 Twhere 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.

§

impl<'data, I> IntoParallelRefIterator<'data> for Iwhere I: 'data + ?Sized, &'data I: IntoParallelIterator,

§

type Iter = <&'data I as IntoParallelIterator>::Iter

The type of the parallel iterator that will be returned.
§

type Item = <&'data I as IntoParallelIterator>::Item

The type of item that the parallel iterator will produce. This will typically be an &'data T reference type.
§

fn par_iter(&'data self) -> <I as IntoParallelRefIterator<'data>>::Iter

Converts self into a parallel iterator. Read more
§

impl<'data, I> IntoParallelRefMutIterator<'data> for Iwhere I: 'data + ?Sized, &'data mut I: IntoParallelIterator,

§

type Iter = <&'data mut I as IntoParallelIterator>::Iter

The type of iterator that will be created.
§

type Item = <&'data mut I as IntoParallelIterator>::Item

The type of item that will be produced; this is typically an &'data mut T reference.
§

fn par_iter_mut( &'data mut self ) -> <I as IntoParallelRefMutIterator<'data>>::Iter

Creates the parallel iterator from self. Read more
§

impl<T> Pointable for T

§

const ALIGN: usize = mem::align_of::<T>()

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<G, W> RelaxableWitness<G, W> for Wwhere G: CommitmentCurve, W: Witness<G>,

§

fn relax( self, zero_poly: &Evaluations<<G as AffineRepr>::ScalarField, Radix2EvaluationDomain<<G as AffineRepr>::ScalarField>> ) -> RelaxedWitness<G, W>

This method takes a witness and a vector of evaluations to the zero polynomial, returning a relaxed witness which is composed by the extended witness and the error vector that is set to the zero polynomial.

source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

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

§

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 Twhere U: TryFrom<T>,

§

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.
§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

fn vzip(self) -> V