Skip to main content

BooleanPcs

Struct BooleanPcs 

Source
pub struct BooleanPcs<EF: EncodableLevel, MT, MX> { /* private fields */ }
Expand description

A Boolean commitment built from the packing, the bit ring switch and the binary PCS.

The committed elements hold d bits each. The codeword is therefore d times shorter than an element-per-bit one.

Implementations§

Source§

impl<EF, MT, MX> BooleanPcs<EF, MT, MX>
where EF: ChallengeField<EF> + EncodableLevel + TranscriptField + TowerLevel + FoldAlphabet<EF> + Coordinates, MT: Mmcs<EF>, MX: Mmcs<EF, Error = MT::Error>,

Source

pub fn new( config: BinaryPcsConfig, mmcs: MT, round_mmcs: MX, num_variables: usize, ) -> Result<Self, BooleanPcsError<EF, MT::Error>>

Build a Boolean commitment over a bit witness of num_variables variables.

§Errors

Returns an error unless the schedule was derived for (EF, EF). Returns an error unless the schedule commits exactly the elements the packing holds.

Source

pub const fn num_variables(&self) -> usize

Variables the committed bit witness has, so 2^n bits in all.

The same number the trait reports, reachable without naming a challenger.

Source

pub fn reduction_security(&self, num_claims: usize) -> [SecurityTerm; 2]

Soundness cost of reducing this many bit claims to one claim about the packing.

    reduction        one batched ring switch, its rounds run once
    claim batching   lambda, of degree num_claims - 1
Source

pub fn opening_security(&self, num_claims: usize) -> PrescribedOpeningSecurity

Every labelled algebraic error one opening of this many points charges.

A point asks for the current reading alone, so no reduction sends successor elements.

Source

pub fn readings_security( &self, num_claims: usize, successor_tensors: bool, ) -> PrescribedOpeningSecurity

Every labelled algebraic error one opening of this many claims charges.

    commitment       the packed multilinear's own budget, at the one surviving point
    reduction        one batched bit ring switch, batching K elements under alpha
    claim batching   the claims folded under powers of lambda

K is three when successor_tensors holds, one otherwise. A claim sends carry and last when its successor view’s rows outrun one element. Charging three once any one claim sends them is an upper bound.

The one surviving claim is then closed by an equality, which carries no error.

The terms are independent draws, so a caller composes them by a union bound. Nothing here covers hash or transcript collisions, which the caller supplies.

Source

pub fn open_readings<Challenger>( &self, prover_data: BinaryPcsProverData<EF, EF, MT>, openings: &[BitOpening<EF>], challenger: &mut Challenger, ) -> Result<(Vec<BitReadings<EF>>, BooleanProof<EF, MT, MX>), BooleanPcsError<EF, MT::Error>>
where Challenger: FieldChallenger<EF> + GrindingChallenger<Witness = EF> + CanSampleUniformBits<EF> + CanObserve<MT::Commitment> + CanObserve<MX::Commitment>,

Open the bit witness with the readings every opening asks for, in one proof.

No point needs prior transcript binding: each reduction binds its own.

§Returns

One set of readings per opening, in the order the openings were supplied. Each holds a value exactly where its opening asks for one.

§Errors

Before the transcript moves, an opening that:

  • does not name the committed function’s variables,
  • asks for no reading,
  • or steps within more rows than the witness has.
Source

pub fn verify_readings<Challenger>( &self, commitment: &MT::Commitment, openings: &[BitOpening<EF>], readings: &[BitReadings<EF>], proof: &BooleanProof<EF, MT, MX>, challenger: &mut Challenger, ) -> Result<(), BooleanPcsError<EF, MT::Error>>
where Challenger: FieldChallenger<EF> + GrindingChallenger<Witness = EF> + CanSampleUniformBits<EF> + CanObserve<MT::Commitment> + CanObserve<MX::Commitment>,

Check one proof against the readings it claims at every opening.

The commitment’s binding is the caller’s, replayed before this is reached.

§Errors

Before the transcript moves:

  • An opening the proving side refuses.
  • Reading or reduction counts that differ from the opening count.
  • A reading present where its opening asks for none, or missing where it asks for one.

After it: a false reading, a failed reduction, the commitment, or an unclosed claim.

Trait Implementations§

Source§

impl<EF, MT, MX> BooleanBackend<EF> for BooleanPcs<EF, MT, MX>
where EF: EncodableLevel + TowerLevel, MT: Mmcs<EF>, MX: Mmcs<EF, Error = MT::Error>,

Source§

type Commitment = <MT as Mmcs<EF>>::Commitment

Succinct binding commitment sent to the verifier.
Source§

type ProverData = BinaryPcsProverData<EF, EF, MT>

Prover-side data retained between committing and opening.
Source§

type Proof = BooleanProof<EF, MT, MX>

The proof one opening carries.
Source§

type Error = BooleanPcsError<EF, <MT as Mmcs<EF>>::Error>

Why a commitment or an opening was refused.
Source§

fn num_variables(&self) -> usize

Variables the committed bit witness has, so 2^n bits in all.
Source§

impl<EF, MT, MX, Challenger> BooleanMultilinearPcs<EF, Challenger> for BooleanPcs<EF, MT, MX>
where EF: ChallengeField<EF> + EncodableLevel + TranscriptField + TowerLevel + FoldAlphabet<EF> + Coordinates, MT: Mmcs<EF>, MX: Mmcs<EF, Error = MT::Error>, Challenger: FieldChallenger<EF> + GrindingChallenger<Witness = EF> + CanSampleUniformBits<EF> + CanObserve<MT::Commitment> + CanObserve<MX::Commitment>,

Source§

fn observe_commitment( &self, commitment: &Self::Commitment, challenger: &mut Challenger, )

Bind a commitment into the transcript, as committing to one does. Read more
Source§

fn open_readings( &self, prover_data: Self::ProverData, openings: &[BitOpening<EF>], challenger: &mut Challenger, ) -> Result<(Vec<BitReadings<EF>>, Self::Proof), Self::Error>

Open the bit witness with the readings every opening asks for, in one proof. Read more
Source§

fn verify_readings( &self, commitment: &Self::Commitment, openings: &[BitOpening<EF>], readings: &[BitReadings<EF>], proof: &Self::Proof, challenger: &mut Challenger, ) -> Result<(), Self::Error>

Check one proof against the readings it claims at every opening. Read more
Source§

fn readings_security( &self, num_claims: usize, successor_tensors: bool, ) -> Option<PrescribedOpeningSecurity>

Every labelled algebraic error one opening of this many claims charges. Read more
Source§

fn commit_bits<U: Underlier>( &self, bits: &[PackedGf2<U>], challenger: &mut Challenger, ) -> Result<(Self::Commitment, Self::ProverData), Self::Error>

Commit to a bit witness supplied bit-sliced, lane j of block b being bit d*b + j. Read more
Source§

fn open_at_points( &self, prover_data: Self::ProverData, points: &[Point<EF>], challenger: &mut Challenger, ) -> Result<(Vec<EF>, Self::Proof), Self::Error>

Open the multilinear extension at every point, in one proof. Read more
Source§

fn verify_at_points( &self, commitment: &Self::Commitment, points: &[Point<EF>], values: &[EF], proof: &Self::Proof, challenger: &mut Challenger, ) -> Result<(), Self::Error>

Check one proof against the values it claims at every point. Read more

Auto Trait Implementations§

§

impl<EF, MT, MX> Freeze for BooleanPcs<EF, MT, MX>
where BinaryPcs<EF, EF, MT, MX>: Freeze,

§

impl<EF, MT, MX> RefUnwindSafe for BooleanPcs<EF, MT, MX>
where BinaryPcs<EF, EF, MT, MX>: RefUnwindSafe,

§

impl<EF, MT, MX> Send for BooleanPcs<EF, MT, MX>
where BinaryPcs<EF, EF, MT, MX>: Send,

§

impl<EF, MT, MX> Sync for BooleanPcs<EF, MT, MX>
where BinaryPcs<EF, EF, MT, MX>: Sync,

§

impl<EF, MT, MX> Unpin for BooleanPcs<EF, MT, MX>
where BinaryPcs<EF, EF, MT, MX>: Unpin,

§

impl<EF, MT, MX> UnsafeUnpin for BooleanPcs<EF, MT, MX>
where BinaryPcs<EF, EF, MT, MX>: UnsafeUnpin,

§

impl<EF, MT, MX> UnwindSafe for BooleanPcs<EF, MT, MX>
where BinaryPcs<EF, EF, MT, MX>: 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> 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, 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