Trait sigma_fun::Transcript
source · pub trait Transcript<S: Sigma>: Clone {
// Required methods
fn add_name<N: Writable + ?Sized>(&mut self, name: &N);
fn add_statement(&mut self, sigma: &S, statement: &S::Statement);
fn get_challenge(
self,
sigma: &S,
announcement: &S::Announcement
) -> GenericArray<u8, S::ChallengeLength>;
}
Expand description
A trait for a Fiat-Shamir proof transcript.
Really this is just a trait around a cryptographic hash that can produce a Fiat-Shamir challenge
from the statement and the announcement. The usual workflow is to call add_name
and then clone
the transcript for each new statement.
Required Methods§
sourcefn add_name<N: Writable + ?Sized>(&mut self, name: &N)
fn add_name<N: Writable + ?Sized>(&mut self, name: &N)
The name unambigiously determines the semantics of the statement and announcement which are subsequently added to the transcript.
sourcefn add_statement(&mut self, sigma: &S, statement: &S::Statement)
fn add_statement(&mut self, sigma: &S, statement: &S::Statement)
Adds the prover’s statement to the transcript. This must be called before get_challenge
.
sourcefn get_challenge(
self,
sigma: &S,
announcement: &S::Announcement
) -> GenericArray<u8, S::ChallengeLength>
fn get_challenge( self, sigma: &S, announcement: &S::Announcement ) -> GenericArray<u8, S::ChallengeLength>
Gets the verifier’s synthetic challenge for the non-interactive proof.
Object Safety§
Implementors§
impl<H, S: Sigma, R: Clone> Transcript<S> for HashTranscript<H, R>where
S::ChallengeLength: IsLessOrEqual<U32>,
<S::ChallengeLength as IsLessOrEqual<U32>>::Output: NonZero,
H: BlockSizeUser<BlockSize = U64> + FixedOutput<OutputSize = U32> + Update + Default + Clone,
Implements a transcript for any hash that outputs 32 bytes but with a block size of 64 bytes (e.g. SHA256).
The implementation first BIP-340 tags the SHA256 instance with the Sigma protocol’s name.