pub struct Or<A, B> { /* private fields */ }
Expand description
Combinator for proving that A
OR B
is true.
Implementations
Trait Implementations
type Announcement = (A::Announcement, B::Announcement)
type Announcement = (A::Announcement, B::Announcement)
The type for the public announcement the prover sends in the first round of the protocol.
type AnnounceSecret = (Either<(A::AnnounceSecret, B::Response), (A::Response, B::AnnounceSecret)>, GenericArray<u8, Self::ChallengeLength>)
type AnnounceSecret = (Either<(A::AnnounceSecret, B::Response), (A::Response, B::AnnounceSecret)>, GenericArray<u8, Self::ChallengeLength>)
The type for the secret the prover creates when generating the proof.
type ChallengeLength = A::ChallengeLength
type ChallengeLength = A::ChallengeLength
type Response = ((A::Response, GenericArray<u8, Self::ChallengeLength>), B::Response)
type Response = ((A::Response, GenericArray<u8, Self::ChallengeLength>), B::Response)
The type for the response the prover sends in the last round of the protocol.
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.
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.
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
Uniformly samples a response from the response space of the Sigma protocol.
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.
Hashes the statement.
Hashes the announcement.
Hashes the witness.
Auto Trait Implementations
impl<A, B> RefUnwindSafe for Or<A, B> where
A: RefUnwindSafe,
B: RefUnwindSafe,
impl<A, B> UnwindSafe for Or<A, B> where
A: UnwindSafe,
B: 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