pub struct All<S, N> { /* private fields */ }
Available on crate feature
alloc
only.Expand description
Combinator for proving all of N statements of the same type is true.
Implementations§
Trait Implementations§
source§impl<S: PartialEq, N: PartialEq> PartialEq for All<S, N>
impl<S: PartialEq, N: PartialEq> PartialEq for All<S, N>
source§impl<N: Unsigned, S: Sigma> Sigma for All<S, N>
impl<N: Unsigned, S: Sigma> Sigma for All<S, N>
§type AnnounceSecret = Vec<<S as Sigma>::AnnounceSecret>
type AnnounceSecret = Vec<<S as Sigma>::AnnounceSecret>
The type for the secret the prover creates when generating the proof.
§type Announcement = Vec<<S as Sigma>::Announcement>
type Announcement = Vec<<S as Sigma>::Announcement>
The type for the public announcement the prover sends in the first round of the protocol.
§type Response = Vec<<S as Sigma>::Response>
type Response = Vec<<S as Sigma>::Response>
The type for the response the prover sends in the last round of the protocol.
§type ChallengeLength = <S as Sigma>::ChallengeLength
type ChallengeLength = <S as Sigma>::ChallengeLength
The length as a
typenum
source§fn respond(
&self,
witness: &Self::Witness,
statement: &Self::Statement,
announce_secret: Self::AnnounceSecret,
announce: &Self::Announcement,
challenge: &GenericArray<u8, Self::ChallengeLength>
) -> Self::Response
fn respond( &self, witness: &Self::Witness, statement: &Self::Statement, announce_secret: Self::AnnounceSecret, announce: &Self::Announcement, challenge: &GenericArray<u8, Self::ChallengeLength> ) -> Self::Response
Generates the prover’s response for the verifier’s challenge.
source§fn announce(
&self,
statement: &Self::Statement,
announce_secret: &Self::AnnounceSecret
) -> Self::Announcement
fn announce( &self, statement: &Self::Statement, announce_secret: &Self::AnnounceSecret ) -> Self::Announcement
Generates the prover’s announcement message.
source§fn gen_announce_secret<Rng: CryptoRng + RngCore>(
&self,
witness: &Self::Witness,
rng: &mut Rng
) -> Self::AnnounceSecret
fn gen_announce_secret<Rng: CryptoRng + RngCore>( &self, witness: &Self::Witness, rng: &mut Rng ) -> Self::AnnounceSecret
Generates the secret data to create the announcement
source§fn sample_response<Rng: CryptoRng + RngCore>(
&self,
rng: &mut Rng
) -> Self::Response
fn sample_response<Rng: CryptoRng + RngCore>( &self, rng: &mut Rng ) -> Self::Response
Uniformly samples a response from the response space of the Sigma protocol.
source§fn implied_announcement(
&self,
statement: &Self::Statement,
challenge: &GenericArray<u8, Self::ChallengeLength>,
response: &Self::Response
) -> Option<Self::Announcement>
fn implied_announcement( &self, statement: &Self::Statement, challenge: &GenericArray<u8, Self::ChallengeLength>, response: &Self::Response ) -> Option<Self::Announcement>
Computes what the announcement must be for the
response
to be valid.source§fn hash_statement<H: Update>(&self, hash: &mut H, statements: &Self::Statement)
fn hash_statement<H: Update>(&self, hash: &mut H, statements: &Self::Statement)
Hashes the statement.
source§fn hash_announcement<H: Update>(
&self,
hash: &mut H,
announcements: &Self::Announcement
)
fn hash_announcement<H: Update>( &self, hash: &mut H, announcements: &Self::Announcement )
Hashes the announcement.
impl<S, N> StructuralPartialEq for All<S, N>
Auto Trait Implementations§
impl<S, N> RefUnwindSafe for All<S, N>where
N: RefUnwindSafe,
S: RefUnwindSafe,
impl<S, N> Send for All<S, N>
impl<S, N> Sync for All<S, N>
impl<S, N> Unpin for All<S, N>
impl<S, N> UnwindSafe for All<S, N>where
N: UnwindSafe,
S: 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
Mutably borrows from an owned value. Read more