pub struct Transcript(/* private fields */);Expand description
Transcript wrapper for Fiat-Shamir transformation.
Provides domain-separated, transcript-based challenge generation using Merlin.
Implementations§
Source§impl Transcript
impl Transcript
Sourcepub fn append_context(&mut self, context: &[u8])
pub fn append_context(&mut self, context: &[u8])
Appends application-specific context to prevent cross-protocol attacks.
§Security
This should be called before generating proofs in application-specific contexts to ensure proofs from one context cannot be replayed in another. Examples: session ID, domain separator, purpose string.
Sourcepub fn append_parameters(&mut self, generator_g: &[u8], generator_h: &[u8])
pub fn append_parameters(&mut self, generator_g: &[u8], generator_h: &[u8])
Appends protocol parameters (generators) to the transcript.
Sourcepub fn append_statement(&mut self, y1: &[u8], y2: &[u8])
pub fn append_statement(&mut self, y1: &[u8], y2: &[u8])
Appends the statement (public values) to the transcript.
Sourcepub fn append_commitment(&mut self, r1: &[u8], r2: &[u8])
pub fn append_commitment(&mut self, r1: &[u8], r2: &[u8])
Appends the commitment values to the transcript.
Sourcepub fn challenge_scalar(&mut self) -> Scalar
pub fn challenge_scalar(&mut self) -> Scalar
Generates a challenge scalar for Ristretto255.
Uses wide reduction (64 bytes) to ensure uniform distribution.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Transcript
impl RefUnwindSafe for Transcript
impl Send for Transcript
impl Sync for Transcript
impl Unpin for Transcript
impl UnwindSafe for Transcript
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
Mutably borrows from an owned value. Read more