Skip to main content

IdealCheckProtocol

Struct IdealCheckProtocol 

Source
pub struct IdealCheckProtocol<U: Uair>(/* private fields */);
Expand description

Ideal-check subprotocol.

The evaluation point $r \in F^\mu$ at which the combined polynomial MLEs are pinned down is supplied by the caller rather than squeezed from the transcript inside this subprotocol:

The protocol layer samples a single shared integer vector $r \in [0, q^*)^\mu$ once and projects it into each family’s field, so all $n + 1$ families re-use the same underlying integers (just typed in their respective fields).

Implementations§

Source§

impl<U: Uair> IdealCheckProtocol<U>

Source

pub fn prove_mle_first<C, const DEGREE_PLUS_ONE: usize>( transcript: &mut impl Transcript, trace_matrix: &ColumnMajorTrace<C::Element>, projected_scalars: &ProjectedScalars<U::Scalar, DynamicPolynomial<C::Element>>, family_idx: usize, num_constraints: usize, evaluation_point: &[C::Element], field_cfg: &C, ) -> Result<Proof<C::Element>, IdealCheckError<C::Element>>
where C: BaseFieldConfig + ProjectPrimitiveIntegersWithConfig, C::Integer: ConstTranscribable,

Prover using MLE-first evaluation (column-indexed trace).

Routes each constraint through the most efficient evaluation path:

  • Linear constraints with non-zero ideals are batched through [evaluate_combined_polynomials], which evaluates trace column MLEs at the challenge point and then applies the constraints to the evaluated values.
  • Non-linear constraints with non-zero ideals fall back to the row-major [evaluate_for_constraints] path; the trace is transposed on demand via column_major_to_row_major.
  • Constraints with zero ideals are short-circuited to zero (their combined polynomial value is zero by construction for an honest prover).

For $F_{q_i}[X]$ constraints, trace_matrix and projected_scalars must already be projected mod $q_i$.

§Parameters
  • transcript: the Fiat-Shamir transcript.
  • trace_matrix: input trace for the UAIR U projected to DynamicPolynomialF<F>, column-indexed: trace_matrix[col][row].
  • projected_scalars: UAIR scalars projected to DynamicPolynomialF<F>.
  • family_idx: which constraint family to prove. 0 -> $Q[X]$; i >= 1 -> $F_{q_{i-1}}[X]$ (i.e. UAIR-level prime_idx = i - 1).
  • num_constraints: number of constraints this UAIR encodes.
  • evaluation_point: pre-sampled MLE evaluation point, shared for all families of constraints ($Q[X]$ and $F_q[X]$).
  • field_cfg: random field configuration sampled on the previous steps of the overall protocol.
Source

pub fn prove_combined<C, const DEGREE_PLUS_ONE: usize>( transcript: &mut impl Transcript, trace_matrix: &RowMajorTrace<C::Element>, projected_scalars: &ProjectedScalars<U::Scalar, DynamicPolynomial<C::Element>>, family_idx: usize, num_constraints: usize, evaluation_point: &[C::Element], field_cfg: &C, ) -> Result<Proof<C::Element>, IdealCheckError<C::Element>>
where C: BaseFieldConfig + ProjectPrimitiveIntegersWithConfig, C::Integer: ConstTranscribable,

Prover for any UAIR using combined polynomial construction.

Uses row-indexed (transposed) trace for efficient row-by-row combined polynomial construction.

For $F_{q_i}[X]$ constraints, trace_matrix and projected_scalars must already be projected mod $q_i$.

§Parameters
  • transcript: the Fiat-Shamir transcript.
  • trace_matrix: input trace for the UAIR U projected to DynamicPolynomialF<F>, row-indexed: trace_matrix[row][col].
  • projected_scalars: UAIR scalars projected to DynamicPolynomialF<F>.
  • family_idx: which constraint family to prove. 0 -> $Q[X]$; i >= 1 -> $F_{q_{i-1}}[X]$.
  • num_constraints: number of constraints this UAIR encodes.
  • evaluation_point: pre-sampled MLE evaluation point, shared for all families of constraints ($Q[X]$ and $F_q[X]$).
  • field_cfg: random field configuration sampled on the previous steps of the overall protocol.
Source

pub fn verify_as_subprotocol<'cfg, C, IdealOverF, IdealOverFFromRef, IdealOverFFromFqRef>( transcript: &mut impl Transcript, proof: Proof<C::Element>, family_idx: usize, num_constraints: usize, evaluation_point: &[C::Element], ideal_over_f_from_ref: IdealOverFFromRef, ideal_over_f_from_fq_ref: IdealOverFFromFqRef, field_cfg: &'cfg C, ) -> Result<VerifierSubclaim<C::Element>, IdealCheckError<C::Element>>
where C: BaseFieldConfig, C::Integer: ConstTranscribable, IdealOverF: Ideal + IdealCheck<DynamicPolynomialConfig<'cfg, C>>, IdealOverFFromRef: Fn(&IdealOrZero<U::Ideal>) -> IdealOverF, IdealOverFFromFqRef: Fn(&IdealOrZero<U::FqIdeal>) -> IdealOverF,

The verifier part of the ideal-check subprotocol.

Mirrors the prover: receives the prover’s combined_mle_values, absorbs them into the transcript, then checks each non-trivial constraint’s value against the corresponding lifted ideal.

§Parameters
  • transcript: the Fiat-Shamir transcript.
  • proof: a purported proof produced by the prover.
  • family_idx: which constraint family to verify. 0 -> $Q[X]$; i >= 1 -> $F_{q_{i-1}}[X]$.
  • num_constraints: the number of constraints the UAIR U encodes.
  • evaluation_point: pre-sampled MLE evaluation point matching the one used by the prover. The caller is responsible for ensuring transcript ordering matches the prover.
  • ideal_over_f_from_ref: since the UAIR U is not aware of the field the ideal check is operating on it defines ideals over the ring IcTypes::Witness. ideal_over_f_from_ref allows to convert the ideals over IcTypes::Witness into ideals over the field IcTypes::F. Think of this as a projection for ideals.
  • field_cfg: random field configuration sampled on the previous steps of the overall protocol.

Trait Implementations§

Source§

impl<U: Clone + Uair> Clone for IdealCheckProtocol<U>

Source§

fn clone(&self) -> IdealCheckProtocol<U>

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<U: Default + Uair> Default for IdealCheckProtocol<U>

Source§

fn default() -> IdealCheckProtocol<U>

Returns the “default value” for a type. Read more
Source§

impl<U: Copy + Uair> Copy for IdealCheckProtocol<U>

Auto Trait Implementations§

§

impl<U> Freeze for IdealCheckProtocol<U>

§

impl<U> RefUnwindSafe for IdealCheckProtocol<U>
where U: RefUnwindSafe,

§

impl<U> Send for IdealCheckProtocol<U>
where U: Send,

§

impl<U> Sync for IdealCheckProtocol<U>
where U: Sync,

§

impl<U> Unpin for IdealCheckProtocol<U>
where U: Unpin,

§

impl<U> UnsafeUnpin for IdealCheckProtocol<U>

§

impl<U> UnwindSafe for IdealCheckProtocol<U>
where U: UnwindSafe,

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

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

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

Initializes a with the given initializer. Read more
§

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

Dereferences the given pointer. Read more
§

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

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

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