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>,
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>,
Sourcepub fn new(
config: BinaryPcsConfig,
mmcs: MT,
round_mmcs: MX,
num_variables: usize,
) -> Result<Self, BooleanPcsError<EF, MT::Error>>
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.
Sourcepub const fn num_variables(&self) -> usize
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.
Sourcepub fn reduction_security(&self, num_claims: usize) -> [SecurityTerm; 2]
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 - 1Sourcepub fn opening_security(&self, num_claims: usize) -> PrescribedOpeningSecurity
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.
Sourcepub fn readings_security(
&self,
num_claims: usize,
successor_tensors: bool,
) -> PrescribedOpeningSecurity
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 lambdaK 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.
Sourcepub 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>,
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.
Sourcepub 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>,
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>
impl<EF, MT, MX> BooleanBackend<EF> for BooleanPcs<EF, MT, MX>
Source§type Commitment = <MT as Mmcs<EF>>::Commitment
type Commitment = <MT as Mmcs<EF>>::Commitment
Source§type ProverData = BinaryPcsProverData<EF, EF, MT>
type ProverData = BinaryPcsProverData<EF, EF, MT>
Source§type Proof = BooleanProof<EF, MT, MX>
type Proof = BooleanProof<EF, MT, MX>
Source§type Error = BooleanPcsError<EF, <MT as Mmcs<EF>>::Error>
type Error = BooleanPcsError<EF, <MT as Mmcs<EF>>::Error>
Source§fn num_variables(&self) -> usize
fn num_variables(&self) -> usize
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>,
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,
)
fn observe_commitment( &self, commitment: &Self::Commitment, challenger: &mut Challenger, )
Source§fn open_readings(
&self,
prover_data: Self::ProverData,
openings: &[BitOpening<EF>],
challenger: &mut Challenger,
) -> Result<(Vec<BitReadings<EF>>, Self::Proof), Self::Error>
fn open_readings( &self, prover_data: Self::ProverData, openings: &[BitOpening<EF>], challenger: &mut Challenger, ) -> Result<(Vec<BitReadings<EF>>, Self::Proof), Self::Error>
Source§fn verify_readings(
&self,
commitment: &Self::Commitment,
openings: &[BitOpening<EF>],
readings: &[BitReadings<EF>],
proof: &Self::Proof,
challenger: &mut Challenger,
) -> Result<(), Self::Error>
fn verify_readings( &self, commitment: &Self::Commitment, openings: &[BitOpening<EF>], readings: &[BitReadings<EF>], proof: &Self::Proof, challenger: &mut Challenger, ) -> Result<(), Self::Error>
Source§fn readings_security(
&self,
num_claims: usize,
successor_tensors: bool,
) -> Option<PrescribedOpeningSecurity>
fn readings_security( &self, num_claims: usize, successor_tensors: bool, ) -> Option<PrescribedOpeningSecurity>
Source§fn commit_bits<U: Underlier>(
&self,
bits: &[PackedGf2<U>],
challenger: &mut Challenger,
) -> Result<(Self::Commitment, Self::ProverData), Self::Error>
fn commit_bits<U: Underlier>( &self, bits: &[PackedGf2<U>], challenger: &mut Challenger, ) -> Result<(Self::Commitment, Self::ProverData), Self::Error>
Source§fn open_at_points(
&self,
prover_data: Self::ProverData,
points: &[Point<EF>],
challenger: &mut Challenger,
) -> Result<(Vec<EF>, Self::Proof), Self::Error>
fn open_at_points( &self, prover_data: Self::ProverData, points: &[Point<EF>], challenger: &mut Challenger, ) -> Result<(Vec<EF>, Self::Proof), Self::Error>
Source§fn verify_at_points(
&self,
commitment: &Self::Commitment,
points: &[Point<EF>],
values: &[EF],
proof: &Self::Proof,
challenger: &mut Challenger,
) -> Result<(), Self::Error>
fn verify_at_points( &self, commitment: &Self::Commitment, points: &[Point<EF>], values: &[EF], proof: &Self::Proof, challenger: &mut Challenger, ) -> Result<(), Self::Error>
Auto Trait Implementations§
impl<EF, MT, MX> Freeze for BooleanPcs<EF, MT, MX>
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>
impl<EF, MT, MX> Sync for BooleanPcs<EF, MT, MX>
impl<EF, MT, MX> Unpin for BooleanPcs<EF, MT, MX>
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> 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> 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