Skip to main content

BinaryPcsConfig

Struct BinaryPcsConfig 

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

The round schedule derived from BinaryPcsParams and the polynomial’s arity.

The schedule uses p3-security to budget all algebraic opening errors and queries. Opening protocols are checked against the remaining claim-batching capacity. In particular it does not price the commitment scheme, which is supplied separately. A digest narrower than 2 * security_level bits leaves the reported level undeliverable. Supplying one wide enough is the caller’s obligation.

Implementations§

Source§

impl BinaryPcsConfig

Source

pub fn try_new<F: EncodableLevel, EF: TowerLevel>( num_variables: usize, params: BinaryPcsParams, ) -> Result<Self, BinaryPcsConfigError>

Derive the round schedule for a polynomial in num_variables variables.

Every variable is folded: the commit phase lays the whole polynomial out as a single codeword column. By default each variable fold commits its own word; use Self::try_with_folding to batch several folds between commitments.

§Errors

Returns a BinaryPcsConfigError in each of these cases.

  • The codeword length does not fit in a usize.
  • The polynomial has no variables.
  • The codeword is longer than the committed alphabet’s additive domain.
  • Grinding exceeds what the challenger can witness.
  • Grinding exceeds the security budget.
  • The target exceeds what the field can deliver.
  • The derived query count is zero.
  • The challenge field is not a width the security model prices.

The domain cap is the one a caller at a narrow alphabet meets first. The arity and the rate expansion together must stay within the alphabet’s bit width.

Source

pub fn try_new_with_folding<F: EncodableLevel, EF: TowerLevel>( num_variables: usize, params: BinaryPcsParams, log_folding_factor: usize, ) -> Result<Self, BinaryPcsConfigError>

Derive a schedule with batching selected before validating its security target.

Unlike starting with try_new and then changing the folding factor, this admits targets that need exhaustive batched queries to release the query-error reserve. Returns the same configuration errors as Self::try_new, or an invalid fold factor.

Source

pub fn try_with_folding( self, log_folding_factor: usize, ) -> Result<Self, BinaryPcsConfigError>

Batch up to log_folding_factor sequential variable folds between commitments. The last batch folds the remaining variables, even when shorter.

For batching, charge every deterministic virtual fold, including those without roots. The UDR mutual-agreement bound lifts agreement through each omitted fold: the input word is fixed before its challenge, and the query authenticates the whole coset. See Appendix A, Theorem 8 of https://eprint.iacr.org/2024/1553. Sequential independent challenges are used, not powers of one sampled challenge.

Sum (N / 2^r + 1) / |F| over every variable fold, plus 2 / |F| per sumcheck round. Reserve one bit each for that sum and the query error so their sum meets the requested budget. Query PoW is credited only to the query error. Single and batched schedules use the same summed field budget. Exhaustive queries have zero error and need no query reserve.

§Errors

Rejects an empty/oversized batch or a target exceeding the batched field budget.

Source

pub const fn log_folding_factor(&self) -> usize

Maximum number of sequential variable challenges per committed fold batch.

Source

pub const fn num_fold_batches(&self) -> usize

Number of fold batches, including the final batch sent in the clear.

Source

pub const fn num_variables(&self) -> usize

Number of variables of the committed polynomial.

Source

pub const fn num_fold_rounds(&self) -> usize

Number of 2-to-1 codeword folds: one per residual sumcheck round.

Source

pub const fn log_final_len(&self) -> usize

Log length of the final codeword, which is sent in full.

Source

pub const fn num_queries(&self) -> usize

Number of query indices sampled in the query phase.

Source

pub const fn log_inv_rate(&self) -> usize

Log of the inverse code rate.

Source

pub const fn pow_bits(&self) -> usize

Grinding bits demanded before the query phase.

Source

pub const fn challenge_field_bits(&self) -> usize

Bit width of the field this schedule draws its challenges from.

Source

pub const fn committed_field_bits(&self) -> usize

Bit width of the alphabet this schedule commits its base codeword over.

Source

pub fn check_alphabets<F: EncodableLevel, EF: TowerLevel>( &self, ) -> Result<(), BinaryPcsConfigError>

Check that this schedule was derived for exactly this pair of levels.

A level is determined by its width, so comparing the two widths identifies the pair.

Passing means every cap the derivation applied was applied to these two levels.

§Errors

Returns an error if either width differs from the one the schedule was derived for.

Source

pub const fn security_regime(&self) -> BinaryPcsRegime

Validated security model for this exact fold and query schedule.

§Panics

Never for a configuration this type built. Its constructor rejects every shape the model declines to price.

Source

pub const fn security_level(&self) -> usize

Configured total algebraic opening-security target, excluding hash collisions.

Source

pub fn max_opening_claims(&self) -> usize

Conservative capacity for scalar evaluations, counting current and successor columns.

The validated configuration always leaves room for at least one claim. Query grinding does not increase this alpha budget: it happens after the batching challenge.

Source

pub fn query_security_bits(&self) -> f64

Query security before grinding; infinity when every base coset is queried.

Source

pub const fn field_security_bits(&self) -> usize

Whole-bit lower bound for all fold and sumcheck errors, before opening batching.

Trait Implementations§

Source§

impl Clone for BinaryPcsConfig

Source§

fn clone(&self) -> Self

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 Copy for BinaryPcsConfig

Source§

impl Debug for BinaryPcsConfig

Source§

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

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

impl Eq for BinaryPcsConfig

Source§

impl PartialEq for BinaryPcsConfig

Source§

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

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for BinaryPcsConfig

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> Dup for T
where T: Copy + Clone,

Source§

fn dup(&self) -> T

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> 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 = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

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<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more