pub struct Witness<F> { /* private fields */ }Expand description
The witness contains the actual vectors a_i and b_i for the inner product argument.
This struct guarantees that their lengths are equal, and a power of two.
Implementations§
Source§impl<F> Witness<F>
impl<F> Witness<F>
Sourcepub fn new(elements: impl IntoIterator<Item = (F, F)>) -> Option<Self>
pub fn new(elements: impl IntoIterator<Item = (F, F)>) -> Option<Self>
Create a new witness, from the two vectors whose product we’re taking.
This function returns None if the iterator does not produce a power of
two number of elements.
Source§impl<F: Field> Witness<F>
impl<F: Field> Witness<F>
Sourcepub fn new_with_claim<G: Space<F>>(
setup: &Setup<G>,
y: F,
elements: impl IntoIterator<Item = (F, F)>,
) -> Option<(Self, Claim<F, G>)>
pub fn new_with_claim<G: Space<F>>( setup: &Setup<G>, y: F, elements: impl IntoIterator<Item = (F, F)>, ) -> Option<(Self, Claim<F, G>)>
Like Self::new, but also produces a Claim, for convenience.
In some situations, you have a claim from somewhere else, using the proof system in this module as just one step in some larger proof.
If you don’t have a claim, this lets you compute a valid one.
To do so, you need a Setup, which can be reused across different
witnesses.
Trait Implementations§
Auto Trait Implementations§
impl<F> Freeze for Witness<F>
impl<F> RefUnwindSafe for Witness<F>where
F: RefUnwindSafe,
impl<F> Send for Witness<F>where
F: Send,
impl<F> Sync for Witness<F>where
F: Sync,
impl<F> Unpin for Witness<F>where
F: Unpin,
impl<F> UnsafeUnpin for Witness<F>
impl<F> UnwindSafe for Witness<F>where
F: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more