pub struct ZKVerifier<H: HashSuite> { /* private fields */ }Expand description
Zero-knowledge verifier for Binius64 constraint systems.
Wraps the Binius64 IOP verifier with a Spartan-based ZK wrapper. Call Self::setup with
a constraint system, then Self::verify with public inputs and a proof transcript.
Implementations§
Source§impl<H> ZKVerifier<H>
impl<H> ZKVerifier<H>
Sourcepub fn setup(
constraint_system: ConstraintSystem,
log_inv_rate: usize,
) -> Result<Self, Error>
pub fn setup( constraint_system: ConstraintSystem, log_inv_rate: usize, ) -> Result<Self, Error>
Constructs a ZK verifier for a constraint system.
Sourcepub const fn inner_iop_verifier(&self) -> &IOPVerifier
pub const fn inner_iop_verifier(&self) -> &IOPVerifier
Returns a reference to the inner IOP verifier.
Sourcepub const fn outer_iop_verifier(&self) -> &IronSpartanIOPVerifier<B128>
pub const fn outer_iop_verifier(&self) -> &IronSpartanIOPVerifier<B128>
Returns a reference to the outer spartan IOP verifier.
Sourcepub fn outer_layout(&self) -> &WitnessLayout<B128>
pub fn outer_layout(&self) -> &WitnessLayout<B128>
Returns the witness layout of the outer Spartan constraint system.
The layout maps each logical wire to its position in the witness vector.
Sourcepub fn outer_layout_arc(&self) -> Arc<WitnessLayout<B128>>
pub fn outer_layout_arc(&self) -> Arc<WitnessLayout<B128>>
Returns the shared handle to the outer witness layout.
The prover clones this Arc to share the layout instead of deep-cloning it.
Sourcepub const fn basefold_compiler(&self) -> &BaseFoldVerifierCompiler<B128>
pub const fn basefold_compiler(&self) -> &BaseFoldVerifierCompiler<B128>
Returns the BaseFold ZK verifier compiler.
Sourcepub const fn constraint_system(&self) -> &ConstraintSystem
pub const fn constraint_system(&self) -> &ConstraintSystem
Returns the constraint system.
Sourcepub const fn log_public_words(&self) -> usize
pub const fn log_public_words(&self) -> usize
Returns log2 of the number of public words.
Sourcepub fn log_inv_rate(&self) -> usize
pub fn log_inv_rate(&self) -> usize
Returns the log of the inverse Reed–Solomon rate this verifier was set up with.
Sourcepub fn verify<Challenger_: Challenger>(
&self,
inout: &[Word],
transcript: &mut VerifierTranscript<Challenger_>,
) -> Result<(), Error>
pub fn verify<Challenger_: Challenger>( &self, inout: &[Word], transcript: &mut VerifierTranscript<Challenger_>, ) -> Result<(), Error>
Verifies a ZK proof against the constraint system.
Sourcepub fn verify_sig<Challenger_: Challenger>(
&self,
inout: &[Word],
message: &[u8],
transcript: &mut VerifierTranscript<Challenger_>,
) -> Result<(), Error>
pub fn verify_sig<Challenger_: Challenger>( &self, inout: &[Word], message: &[u8], transcript: &mut VerifierTranscript<Challenger_>, ) -> Result<(), Error>
Verifies a ZK signature of knowledge over message.
Binds message into the transcript before any other data, then runs the ordinary
Self::verify checks. See crate::signature for details.
Trait Implementations§
Source§impl<H: Clone + HashSuite> Clone for ZKVerifier<H>
impl<H: Clone + HashSuite> Clone for ZKVerifier<H>
Source§fn clone(&self) -> ZKVerifier<H>
fn clone(&self) -> ZKVerifier<H>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<H> DeserializeBytes for ZKVerifier<H>
impl<H> DeserializeBytes for ZKVerifier<H>
fn deserialize(read_buf: impl Buf) -> Result<Self, SerializationError>
Source§impl<H> SerializeBytes for ZKVerifier<H>
Serializes the seed a ZKVerifier is built from — its constraint system and
log_inv_rate. The derived state (outer constraint system, oracle specs, BaseFold compiler)
is recomputed on DeserializeBytes::deserialize, which is cheap relative to proving.
impl<H> SerializeBytes for ZKVerifier<H>
Serializes the seed a ZKVerifier is built from — its constraint system and
log_inv_rate. The derived state (outer constraint system, oracle specs, BaseFold compiler)
is recomputed on DeserializeBytes::deserialize, which is cheap relative to proving.
Auto Trait Implementations§
impl<H> Freeze for ZKVerifier<H>
impl<H> RefUnwindSafe for ZKVerifier<H>where
H: RefUnwindSafe,
impl<H> Send for ZKVerifier<H>where
H: Send,
impl<H> Sync for ZKVerifier<H>where
H: Sync,
impl<H> Unpin for ZKVerifier<H>where
H: Unpin,
impl<H> UnsafeUnpin for ZKVerifier<H>
impl<H> UnwindSafe for ZKVerifier<H>where
H: 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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§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