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
impl BinaryPcsConfig
Sourcepub fn try_new<F: EncodableLevel, EF: TowerLevel>(
num_variables: usize,
params: BinaryPcsParams,
) -> Result<Self, BinaryPcsConfigError>
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.
Sourcepub fn try_new_with_folding<F: EncodableLevel, EF: TowerLevel>(
num_variables: usize,
params: BinaryPcsParams,
log_folding_factor: usize,
) -> Result<Self, BinaryPcsConfigError>
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.
Sourcepub fn try_with_folding(
self,
log_folding_factor: usize,
) -> Result<Self, BinaryPcsConfigError>
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.
Sourcepub const fn log_folding_factor(&self) -> usize
pub const fn log_folding_factor(&self) -> usize
Maximum number of sequential variable challenges per committed fold batch.
Sourcepub const fn num_fold_batches(&self) -> usize
pub const fn num_fold_batches(&self) -> usize
Number of fold batches, including the final batch sent in the clear.
Sourcepub const fn num_variables(&self) -> usize
pub const fn num_variables(&self) -> usize
Number of variables of the committed polynomial.
Sourcepub const fn num_fold_rounds(&self) -> usize
pub const fn num_fold_rounds(&self) -> usize
Number of 2-to-1 codeword folds: one per residual sumcheck round.
Sourcepub const fn log_final_len(&self) -> usize
pub const fn log_final_len(&self) -> usize
Log length of the final codeword, which is sent in full.
Sourcepub const fn num_queries(&self) -> usize
pub const fn num_queries(&self) -> usize
Number of query indices sampled in the query phase.
Sourcepub const fn log_inv_rate(&self) -> usize
pub const fn log_inv_rate(&self) -> usize
Log of the inverse code rate.
Sourcepub const fn challenge_field_bits(&self) -> usize
pub const fn challenge_field_bits(&self) -> usize
Bit width of the field this schedule draws its challenges from.
Sourcepub const fn committed_field_bits(&self) -> usize
pub const fn committed_field_bits(&self) -> usize
Bit width of the alphabet this schedule commits its base codeword over.
Sourcepub fn check_alphabets<F: EncodableLevel, EF: TowerLevel>(
&self,
) -> Result<(), BinaryPcsConfigError>
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.
Sourcepub const fn security_regime(&self) -> BinaryPcsRegime
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.
Sourcepub const fn security_level(&self) -> usize
pub const fn security_level(&self) -> usize
Configured total algebraic opening-security target, excluding hash collisions.
Sourcepub fn max_opening_claims(&self) -> usize
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.
Sourcepub fn query_security_bits(&self) -> f64
pub fn query_security_bits(&self) -> f64
Query security before grinding; infinity when every base coset is queried.
Sourcepub const fn field_security_bits(&self) -> usize
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
impl Clone for BinaryPcsConfig
impl Copy for BinaryPcsConfig
Source§impl Debug for BinaryPcsConfig
impl Debug for BinaryPcsConfig
impl Eq for BinaryPcsConfig
Source§impl PartialEq for BinaryPcsConfig
impl PartialEq for BinaryPcsConfig
impl StructuralPartialEq for BinaryPcsConfig
Auto Trait Implementations§
impl Freeze for BinaryPcsConfig
impl RefUnwindSafe for BinaryPcsConfig
impl Send for BinaryPcsConfig
impl Sync for BinaryPcsConfig
impl Unpin for BinaryPcsConfig
impl UnsafeUnpin for BinaryPcsConfig
impl UnwindSafe for BinaryPcsConfig
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> ⓘ
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> ⓘ
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