tasm_lib::verifier::fri::verify

Struct FriVerify

Source
pub struct FriVerify {
    pub expansion_factor: u32,
    pub num_collinearity_checks: u32,
    pub domain_length: u32,
    pub domain_offset: BFieldElement,
    pub domain_generator: BFieldElement,
}
Expand description

FRI verification of a Reed-Solomon codeword.

FriVerify checks that a Reed-Solomon codeword, provided as an oracle, has a low degree interpolant. Specifically, the algorithm takes a ProofStream object, runs the verifier of the FRI protocol, and (if successful) returns the lists of indices at which the codeword is probed along with the values of the codeword at those indices. The test succeeds with probability 1 if the codeword is of low degree; and with probability soundness error if the codeword is far from low-degree. If the test is not successful, the VM crashes.

Fields§

§expansion_factor: u32§num_collinearity_checks: u32§domain_length: u32§domain_offset: BFieldElement§domain_generator: BFieldElement

Implementations§

Source§

impl FriVerify

Source

pub fn dummy() -> Self

Return a dummy FRI verify structure that can be used when an instance is not needed but the compiler thinks it is. Is probably only needed when the FRI snippet is used in an external test.

Source

pub fn extract_digests_required_for_proving( &self, proof_stream: &ProofStream, ) -> Vec<Digest>

Source

pub fn to_fri(self) -> Fri

Source

pub fn num_rounds(&self) -> usize

Computes the number of rounds

Source

pub fn last_round_max_degree(&self) -> usize

Computes the max degree of the codeword interpolant after the last round

Source

pub fn first_round_max_degree(&self) -> usize

Computes the max degree of the very first codeword interpolant

Source

pub fn get_collinearity_check_x(&self, idx: u32, round: usize) -> XFieldElement

Get the x-coordinate of an A or B point in a collinearity check, given the point’s index and the round number in which the check takes place. In Triton VM, this method is called get_evaluation_argument.

Trait Implementations§

Source§

impl BFieldCodec for FriVerify

Source§

type Error = FriVerifyBFieldDecodingError

Source§

fn decode(sequence: &[BFieldElement]) -> Result<Box<Self>, Self::Error>

Source§

fn encode(&self) -> Vec<BFieldElement>

Source§

fn static_length() -> Option<usize>

Returns the length in number of BFieldElements if it is known at compile-time. Otherwise, None.
Source§

impl Clone for FriVerify

Source§

fn clone(&self) -> FriVerify

Returns a copy 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 FriVerify

Source§

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

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

impl From<Fri> for FriVerify

Source§

fn from(fri: Fri) -> Self

Converts to this type from the input type.
Source§

impl PartialEq for FriVerify

Source§

fn eq(&self, other: &FriVerify) -> 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 TasmObject for FriVerify

Source§

fn label_friendly_name() -> String

Source§

fn get_field(field_name: &str) -> Vec<LabelledInstruction>

Returns tasm code that returns a pointer the field of the object, assuming: Read more
Source§

fn get_field_with_size(field_name: &str) -> Vec<LabelledInstruction>

Returns tasm code that returns a pointer the field of the object, along with the size of that field in number of BFieldElements, assuming: Read more
Source§

fn get_field_start_with_jump_distance( field_name: &str, ) -> Vec<LabelledInstruction>

Returns tasm code that returns a pointer to the start of the field of the object, along with the jump distance to the next field. Note that: Read more
Source§

fn compute_size_and_assert_valid_size_indicator( library: &mut Library, ) -> Vec<LabelledInstruction>

Return the size of a struct and crash if any contained size-indicator is not valid. Read more
Source§

fn decode_iter<Itr: Iterator<Item = BFieldElement>>( iterator: &mut Itr, ) -> Result<Box<Self>, Box<dyn Error + Send + Sync>>

Decode as Self.
Source§

const MAX_OFFSET: u32 = 268_435_456u32

Maximum jump distance for encoded size and length indicators. The field getters will compare any length or size indicator read from memory against this value and crash the VM if the indicator is larger or equal.
Source§

fn decode_from_memory( memory: &HashMap<BFieldElement, BFieldElement>, address: BFieldElement, ) -> Result<Box<Self>, Box<dyn Error + Send + Sync>>

Source§

impl Copy for FriVerify

Source§

impl Eq for FriVerify

Source§

impl StructuralPartialEq for FriVerify

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, dst: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
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> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize = _

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V