pub struct CommittedSparsePolynomial { /* private fields */ }Expand description
Canonical externally supplied sparse multilinear polynomial.
Implementations§
Source§impl CommittedSparsePolynomial
impl CommittedSparsePolynomial
Sourcepub fn new(
num_vars: usize,
terms: Vec<SparseMonomial>,
) -> Result<Self, SparseProofError>
pub fn new( num_vars: usize, terms: Vec<SparseMonomial>, ) -> Result<Self, SparseProofError>
Creates and validates an externally supplied sparse polynomial.
Sourcepub fn terms(&self) -> &[SparseMonomial]
pub fn terms(&self) -> &[SparseMonomial]
Canonical sparse monomials.
Sourcepub fn max_degree(&self) -> usize
pub fn max_degree(&self) -> usize
Maximum monomial degree.
Sourcepub fn commitment(&self) -> TranscriptDigest
pub fn commitment(&self) -> TranscriptDigest
Domain-separated BLAKE2b-256 commitment to the canonical polynomial.
Sourcepub fn to_bytes(&self) -> Vec<u8> ⓘ
pub fn to_bytes(&self) -> Vec<u8> ⓘ
Encodes the polynomial into the canonical PHSMv1 binary format.
Sourcepub fn from_bytes(bytes: &[u8]) -> Result<Self, SparseProofError>
pub fn from_bytes(bytes: &[u8]) -> Result<Self, SparseProofError>
Decodes and validates a canonical PHSMv1 polynomial.
Trait Implementations§
Source§impl Clone for CommittedSparsePolynomial
impl Clone for CommittedSparsePolynomial
Source§fn clone(&self) -> CommittedSparsePolynomial
fn clone(&self) -> CommittedSparsePolynomial
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CommittedSparsePolynomial
impl Debug for CommittedSparsePolynomial
impl Eq for CommittedSparsePolynomial
Source§impl PartialEq for CommittedSparsePolynomial
impl PartialEq for CommittedSparsePolynomial
Source§fn eq(&self, other: &CommittedSparsePolynomial) -> bool
fn eq(&self, other: &CommittedSparsePolynomial) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for CommittedSparsePolynomial
Auto Trait Implementations§
impl Freeze for CommittedSparsePolynomial
impl RefUnwindSafe for CommittedSparsePolynomial
impl Send for CommittedSparsePolynomial
impl Sync for CommittedSparsePolynomial
impl Unpin for CommittedSparsePolynomial
impl UnsafeUnpin for CommittedSparsePolynomial
impl UnwindSafe for CommittedSparsePolynomial
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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