pub struct PcsVerifierTranscript {
pub fs_transcript: Blake3Transcript,
pub stream: Cursor<Vec<u8>>,
}Expand description
Version of [PcsProverTranscript] used for proof verification.
Fields§
§fs_transcript: Blake3TranscriptHandles Fiat-Shamir transformations for non-interactive zero-knowledge proofs. Used to absorb field elements and generate cryptographic challenges.
stream: Cursor<Vec<u8>>Manages serialization and deserialization of proof data as a byte stream.
Implementations§
Source§impl PcsVerifierTranscript
impl PcsVerifierTranscript
Sourcepub fn squeeze_challenge_idx(&mut self, cap: usize) -> usize
pub fn squeeze_challenge_idx(&mut self, cap: usize) -> usize
Generates a pseudorandom index based on the current transcript state. Used to create deterministic challenges for zero-knowledge protocols. Returns an index between 0 and cap-1.
Sourcepub fn check_eof(&self) -> Result<(), TranscriptError>
pub fn check_eof(&self) -> Result<(), TranscriptError>
Returns an error unless the whole proof stream has been consumed.
Call this once at the end of verification, after every component sharing the stream has read its section.
Sourcepub fn read_field_elements<C>(
&mut self,
cfg: &C,
n: usize,
) -> Result<Vec<C::Element>, TranscriptError>where
C: BaseFieldConfig,
C::Integer: ConstTranscribable,
pub fn read_field_elements<C>(
&mut self,
cfg: &C,
n: usize,
) -> Result<Vec<C::Element>, TranscriptError>where
C: BaseFieldConfig,
C::Integer: ConstTranscribable,
Reads canonical lifted integers from the proof stream, strictly
validates them against the field modulus, projects them into the
field, and absorbs the resulting elements into the transcript. The
mirror of PcsProverTranscript::write_field_elements.
Rejects any integer >= modulus: every field value has exactly one
accepted encoding on the wire.
pub fn read<T: Transcribable>(&mut self) -> Result<T, TranscriptError>
pub fn read_const_many<T: ConstTranscribable>( &mut self, n: usize, ) -> Result<Vec<T>, TranscriptError>
pub fn read_merkle_proof(&mut self) -> Result<MerkleProof, TranscriptError>
Trait Implementations§
Source§impl Clone for PcsVerifierTranscript
impl Clone for PcsVerifierTranscript
Source§fn clone(&self) -> PcsVerifierTranscript
fn clone(&self) -> PcsVerifierTranscript
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for PcsVerifierTranscript
impl RefUnwindSafe for PcsVerifierTranscript
impl Send for PcsVerifierTranscript
impl Sync for PcsVerifierTranscript
impl Unpin for PcsVerifierTranscript
impl UnsafeUnpin for PcsVerifierTranscript
impl UnwindSafe for PcsVerifierTranscript
Blanket Implementations§
§impl<T> AsMaybeUninit for T
impl<T> AsMaybeUninit for T
§type Uninit = MaybeUninit<T>
type Uninit = MaybeUninit<T>
§fn as_ref_uninit(&self) -> &<T as AsMaybeUninit>::Uninit
fn as_ref_uninit(&self) -> &<T as AsMaybeUninit>::Uninit
&self to its maybe-initialized equivalent.§unsafe fn as_mut_uninit(&mut self) -> &mut <T as AsMaybeUninit>::Uninit
unsafe fn as_mut_uninit(&mut self) -> &mut <T as AsMaybeUninit>::Uninit
&mut T to its maybe-initialized equivalent. Read more§unsafe fn raw_as_uninit<'a>(raw: *const T) -> &'a <T as AsMaybeUninit>::Uninit
unsafe fn raw_as_uninit<'a>(raw: *const T) -> &'a <T as AsMaybeUninit>::Uninit
§unsafe fn raw_mut_as_uninit<'a>(
raw: *mut T,
) -> &'a mut <T as AsMaybeUninit>::Uninit
unsafe fn raw_mut_as_uninit<'a>( raw: *mut T, ) -> &'a mut <T as AsMaybeUninit>::Uninit
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> 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