Struct sigma_fun::HashTranscript
source[−]pub struct HashTranscript<H, R = ()> { /* private fields */ }
Expand description
A transcript which consists of a hash with fixed length output and a seedable RNG.
The SeedableRng
specified must have the same seed length as the hash’s output length.
R
may be set to ()
but the it won’t implement ProverTranscript
.
Trait Implementations
impl<S, H, R> ProverTranscript<S> for HashTranscript<H, R> where
S: Sigma,
H: Update + FixedOutput<OutputSize = U32> + Clone,
R: SeedableRng + CryptoRng + RngCore + Clone,
R::Seed: From<GenericArray<u8, U32>>,
impl<S, H, R> ProverTranscript<S> for HashTranscript<H, R> where
S: Sigma,
H: Update + FixedOutput<OutputSize = U32> + Clone,
R: SeedableRng + CryptoRng + RngCore + Clone,
R::Seed: From<GenericArray<u8, U32>>,
Implements a prover transcript for a 32-byte hash with a rng that takes a 32-byte seed.
type Rng = R
type Rng = R
The type of Rng the transcript generates.
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: BlockInput<BlockSize = U64> + FixedOutput<OutputSize = U32> + Update + Default + Clone,
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: BlockInput<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.
The name unambigiously determines the semantics of the statement and announcement which are subsequently added to the transcript. Read more
Adds the prover’s statement to the transcript. This must be called before get_challenge
. Read more
fn get_challenge(
self,
sigma: &S,
announce: &S::Announcement
) -> GenericArray<u8, S::ChallengeLength>
fn get_challenge(
self,
sigma: &S,
announce: &S::Announcement
) -> GenericArray<u8, S::ChallengeLength>
Gets the verifier’s synthetic challenge for the non-interactive proof.
Auto Trait Implementations
impl<H, R> RefUnwindSafe for HashTranscript<H, R> where
H: RefUnwindSafe,
R: RefUnwindSafe,
impl<H, R> Send for HashTranscript<H, R> where
H: Send,
R: Send,
impl<H, R> Sync for HashTranscript<H, R> where
H: Sync,
R: Sync,
impl<H, R> Unpin for HashTranscript<H, R> where
H: Unpin,
R: Unpin,
impl<H, R> UnwindSafe for HashTranscript<H, R> where
H: UnwindSafe,
R: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more
Returns a new instance of the invocant that will be marked with M
. Read more