Queries

Struct Queries 

Source
pub struct Queries { /* private fields */ }
Expand description

Decommitments to evaluations of a set of functions at multiple points.

Given a set of functions evaluated over a domain D, a commitment is assumed to be a vector commitment where the i-th vector entry contains evaluations of all functions at xi. Thus, a query (i.e. a single decommitment) for position i includes evaluations of all functions at xi, accompanied by an opening proof of leaf i against the vector commitment string.

This struct can contain one or more queries. In cases when more than one query is stored, a batch opening proof is used in order to compress the individual opening proofs.

Internally, all opening proofs and query values are stored as a sequence of bytes. Thus, to retrieve query values and their corresponding opening proofs, parse() function should be used.

Implementations§

Source§

impl Queries

Source

pub fn new<H: Hasher, E: FieldElement, V: VectorCommitment<H>>( opening_proof: V::MultiProof, query_values: Vec<Vec<E>>, ) -> Self

Returns queries constructed from evaluations of a set of functions at some number of points in a domain and their corresponding batch opening proof.

For each evaluation point, the same number of values must be provided.

§Panics

Panics if:

  • No queries were provided (query_values is an empty vector).
  • Any of the queries does not contain any evaluations.
  • Not all queries contain the same number of evaluations.
Source

pub fn parse<E, H, V>( self, domain_size: usize, num_queries: usize, values_per_query: usize, ) -> Result<(V::MultiProof, Table<E>), DeserializationError>
where E: FieldElement, H: ElementHasher<BaseField = E::BaseField>, V: VectorCommitment<H>,

Convert internally stored bytes into a set of query values and the corresponding batch opening proof.

§Panics

Panics if:

  • domain_size is not a power of two.
  • num_queries is zero.
  • values_per_query is zero.

Trait Implementations§

Source§

impl Clone for Queries

Source§

fn clone(&self) -> Queries

Returns a duplicate 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 Debug for Queries

Source§

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

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

impl Deserializable for Queries

Source§

fn read_from<R: ByteReader>( source: &mut R, ) -> Result<Self, DeserializationError>

Reads a query struct from the specified source and returns the result

§Errors

Returns an error of a valid query struct could not be read from the specified source.

Source§

fn read_from_bytes(bytes: &[u8]) -> Result<Self, DeserializationError>

Attempts to deserialize the provided bytes into Self and returns the result. Read more
Source§

impl PartialEq for Queries

Source§

fn eq(&self, other: &Queries) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serializable for Queries

Source§

fn write_into<W: ByteWriter>(&self, target: &mut W)

Serializes self and writes the resulting bytes into the target.

Source§

fn get_size_hint(&self) -> usize

Returns an estimate of how many bytes are needed to represent self.

Source§

fn to_bytes(&self) -> Vec<u8>

Serializes self into a vector of bytes.
Source§

impl Eq for Queries

Source§

impl StructuralPartialEq for Queries

Auto Trait Implementations§

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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 T
where 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.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

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 T
where U: Into<T>,

Source§

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

Source§

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.