pub struct ZKProver<P, H>{ /* private fields */ }Expand description
Zero-knowledge prover for Binius64 constraint systems.
Wraps the Binius64 IOP prover with a Spartan-based ZK wrapper. Call Self::setup with
a [ZKVerifier], then Self::prove with witness data and a proof transcript.
Implementations§
Source§impl<P, H> ZKProver<P, H>where
P: PackedField<Scalar = Ghash128b>,
H: ParallelHashSuite,
Output<H::LeafHash>: SerializeBytes,
impl<P, H> ZKProver<P, H>where
P: PackedField<Scalar = Ghash128b>,
H: ParallelHashSuite,
Output<H::LeafHash>: SerializeBytes,
Sourcepub fn setup(zk_verifier: &ZKVerifier<H>) -> Result<Self, Error>
pub fn setup(zk_verifier: &ZKVerifier<H>) -> Result<Self, Error>
Constructs a ZK prover from a [ZKVerifier].
Sourcepub const fn inner_iop_prover(&self) -> &IOPProver
pub const fn inner_iop_prover(&self) -> &IOPProver
Returns a reference to the inner IOP prover.
Sourcepub const fn key_collection(&self) -> &KeyCollection
pub const fn key_collection(&self) -> &KeyCollection
Returns a reference to the KeyCollection.
Sourcepub fn prove<Challenger_: Challenger>(
&self,
witness: &ValueVec,
rng: impl CryptoRng,
transcript: &mut ProverTranscript<Challenger_>,
) -> Result<(), Error>
pub fn prove<Challenger_: Challenger>( &self, witness: &ValueVec, rng: impl CryptoRng, transcript: &mut ProverTranscript<Challenger_>, ) -> Result<(), Error>
Generates a ZK proof for a witness.
Sourcepub fn prove_sig<Challenger_: Challenger>(
&self,
witness: &ValueVec,
message: &[u8],
rng: impl CryptoRng,
transcript: &mut ProverTranscript<Challenger_>,
) -> Result<(), Error>
pub fn prove_sig<Challenger_: Challenger>( &self, witness: &ValueVec, message: &[u8], rng: impl CryptoRng, transcript: &mut ProverTranscript<Challenger_>, ) -> Result<(), Error>
Generates a ZK signature of knowledge over message.
Binds message into the transcript before any other data, then runs the ordinary
Self::prove logic. See [binius_verifier::signature] for details.
Trait Implementations§
Source§impl<P, H> DeserializeBytes for ZKProver<P, H>where
P: PackedField<Scalar = Ghash128b>,
H: ParallelHashSuite,
Output<H::LeafHash>: SerializeBytes + DeserializeBytes,
impl<P, H> DeserializeBytes for ZKProver<P, H>where
P: PackedField<Scalar = Ghash128b>,
H: ParallelHashSuite,
Output<H::LeafHash>: SerializeBytes + DeserializeBytes,
fn deserialize(read_buf: impl Buf) -> Result<Self, SerializationError>
Source§impl<P, H> SerializeBytes for ZKProver<P, H>where
P: PackedField<Scalar = Ghash128b>,
H: ParallelHashSuite,
Output<H::LeafHash>: SerializeBytes + DeserializeBytes,
Serializes the seed a ZKProver is built from — constraint system, log_inv_rate, and the
prebuilt KeyCollection. On DeserializeBytes::deserialize the key collection (the
dominant setup cost) is reused as-is while the cheaper derived state is recomputed.
impl<P, H> SerializeBytes for ZKProver<P, H>where
P: PackedField<Scalar = Ghash128b>,
H: ParallelHashSuite,
Output<H::LeafHash>: SerializeBytes + DeserializeBytes,
Serializes the seed a ZKProver is built from — constraint system, log_inv_rate, and the
prebuilt KeyCollection. On DeserializeBytes::deserialize the key collection (the
dominant setup cost) is reused as-is while the cheaper derived state is recomputed.
Auto Trait Implementations§
impl<P, H> !Freeze for ZKProver<P, H>
impl<P, H> RefUnwindSafe for ZKProver<P, H>where
H: RefUnwindSafe,
P: RefUnwindSafe,
impl<P, H> Send for ZKProver<P, H>where
H: Send,
impl<P, H> Sync for ZKProver<P, H>where
H: Sync,
impl<P, H> Unpin for ZKProver<P, H>
impl<P, H> UnsafeUnpin for ZKProver<P, H>
impl<P, H> UnwindSafe for ZKProver<P, H>where
H: UnwindSafe,
P: 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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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