pub struct RoundCoeffs<F>(pub Vec<F>);Expand description
A univariate polynomial in monomial basis.
The coefficient at position i in the inner vector corresponds to the term $X^i$.
Tuple Fields§
§0: Vec<F>Implementations§
Source§impl<F> RoundCoeffs<F>
impl<F> RoundCoeffs<F>
Sourcepub fn truncate(self) -> RoundProof<F>
pub fn truncate(self) -> RoundProof<F>
Truncate the highest-degree coefficient to produce a more compact round proof.
§Pre-conditions
- The coefficient vector must be non-empty.
- A round polynomial always has degree at least one, so an empty vector signals a bug.
Source§impl<F: FieldOps> RoundCoeffs<F>
impl<F: FieldOps> RoundCoeffs<F>
Sourcepub fn batch(polys: Vec<Self>, batch_coeff: &F) -> Self
pub fn batch(polys: Vec<Self>, batch_coeff: &F) -> Self
Batches round polynomials into one, weighting polynomial i by batch_coeff^i.
The verifier weights the matching claims with the same coefficient. Each claim therefore stays tied to its own round polynomial.
An empty input is the zero polynomial.
Sourcepub fn sum_over_endpoints(&self) -> F
pub fn sum_over_endpoints(&self) -> F
The claimed sum $R(0) + R(1)$ that this round polynomial encodes.
For a sumcheck round polynomial, this is the round’s claimed sum.
The verifier expects the identity $s = R(0) + R(1)$ (see RoundProof::recover).
Sourcepub fn lerp_over_endpoints(&self, alpha: F) -> F
pub fn lerp_over_endpoints(&self, alpha: F) -> F
The claimed value $(1 - \alpha) R(0) + \alpha R(1)$ that this round polynomial encodes in an MLE-check.
This is the MLE-check analogue of Self::sum_over_endpoints.
An MLE-check round polynomial satisfies $s = (1 - \alpha) R(0) + \alpha R(1)$.
Here $\alpha$ is the round’s evaluation-point coordinate (see
crate::mlecheck::RoundProof::recover). Equivalently, this is the linear extrapolation
of $R$ from the endpoints $0$ and $1$ to $\alpha$.
Source§impl<F: Field> RoundCoeffs<F>
impl<F: Field> RoundCoeffs<F>
Sourcepub fn mul_by_eq(&self, alpha: F) -> Self
pub fn mul_by_eq(&self, alpha: F) -> Self
Multiplies this polynomial by the equality factor $\text{eq}(X, \alpha)$.
$$ \text{eq}(X, \alpha) = (1 - \alpha) + (2 \alpha - 1) X $$
An MLE-check prover interpolates the prime polynomial, which carries no equality factor. This multiplies the factor back in.
Monomial form makes that one scaling and one shift. Sampling the factored polynomial instead would cost an extra evaluation point.
The factor is linear, so the result has one more coefficient than self.
Trait Implementations§
Source§impl<F: FieldOps> Add<&RoundCoeffs<F>> for RoundCoeffs<F>
impl<F: FieldOps> Add<&RoundCoeffs<F>> for RoundCoeffs<F>
Source§impl<F: FieldOps> AddAssign<&RoundCoeffs<F>> for RoundCoeffs<F>
impl<F: FieldOps> AddAssign<&RoundCoeffs<F>> for RoundCoeffs<F>
Source§fn add_assign(&mut self, rhs: &Self)
fn add_assign(&mut self, rhs: &Self)
+= operation. Read moreSource§impl<F: Clone> Clone for RoundCoeffs<F>
impl<F: Clone> Clone for RoundCoeffs<F>
Source§fn clone(&self) -> RoundCoeffs<F>
fn clone(&self) -> RoundCoeffs<F>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<F: Debug> Debug for RoundCoeffs<F>
impl<F: Debug> Debug for RoundCoeffs<F>
Source§impl<F> Default for RoundCoeffs<F>
impl<F> Default for RoundCoeffs<F>
impl<F: Eq> Eq for RoundCoeffs<F>
Source§impl<F> Index<usize> for RoundCoeffs<F>
impl<F> Index<usize> for RoundCoeffs<F>
Source§impl<F: FieldOps> Mul<F> for RoundCoeffs<F>
impl<F: FieldOps> Mul<F> for RoundCoeffs<F>
Source§impl<F: FieldOps> MulAssign<F> for RoundCoeffs<F>
impl<F: FieldOps> MulAssign<F> for RoundCoeffs<F>
Source§fn mul_assign(&mut self, rhs: F)
fn mul_assign(&mut self, rhs: F)
*= operation. Read moreSource§impl<F: PartialEq> PartialEq for RoundCoeffs<F>
impl<F: PartialEq> PartialEq for RoundCoeffs<F>
Source§fn eq(&self, other: &RoundCoeffs<F>) -> bool
fn eq(&self, other: &RoundCoeffs<F>) -> bool
self and other values to be equal, and is used by ==.impl<F: PartialEq> StructuralPartialEq for RoundCoeffs<F>
Auto Trait Implementations§
impl<F> Freeze for RoundCoeffs<F>
impl<F> RefUnwindSafe for RoundCoeffs<F>where
F: RefUnwindSafe,
impl<F> Send for RoundCoeffs<F>where
F: Send,
impl<F> Sync for RoundCoeffs<F>where
F: Sync,
impl<F> Unpin for RoundCoeffs<F>where
F: Unpin,
impl<F> UnsafeUnpin for RoundCoeffs<F>
impl<F> UnwindSafe for RoundCoeffs<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
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>
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>
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