pub struct GrandProductWitness<P: PackedField> { /* private fields */ }
Implementations§
Source§impl<P: PackedField> GrandProductWitness<P>
Grand product witness.
impl<P: PackedField> GrandProductWitness<P>
Grand product witness.
Constructs GKR multiplication circuit layers from an owned packed field witness,
which may be shorter than 2^n_vars
scalars, in which case the absent values are
assumed to be P::Scalar::ONE
. There is a total on n_vars + 1
layers, ordered
by decreasing size, with last layer containing a single grand product scalar.
pub fn new(n_vars: usize, input_layer: Vec<P>) -> Result<Self, Error>
Sourcepub fn n_vars(&self) -> usize
pub fn n_vars(&self) -> usize
Base-two logarithm of the number of inputs to the GKR grand product circuit
Sourcepub fn grand_product_evaluation(&self) -> P::Scalar
pub fn grand_product_evaluation(&self) -> P::Scalar
Final evaluation of the GKR grand product circuit
Sourcepub fn into_circuit_layers(self) -> Vec<Vec<P>>
pub fn into_circuit_layers(self) -> Vec<Vec<P>>
Consume the witness, returning the vector of layer multilinears in non-ascending length order.
Trait Implementations§
Source§impl<P: Clone + PackedField> Clone for GrandProductWitness<P>
impl<P: Clone + PackedField> Clone for GrandProductWitness<P>
Source§fn clone(&self) -> GrandProductWitness<P>
fn clone(&self) -> GrandProductWitness<P>
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl<P> Freeze for GrandProductWitness<P>
impl<P> RefUnwindSafe for GrandProductWitness<P>where
P: RefUnwindSafe,
impl<P> Send for GrandProductWitness<P>
impl<P> Sync for GrandProductWitness<P>
impl<P> Unpin for GrandProductWitness<P>where
P: Unpin,
impl<P> UnwindSafe for GrandProductWitness<P>where
P: 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,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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