pub struct And<A, B> {
pub lhs: A,
pub rhs: B,
}
Expand description
Combinator for proving that both A
and B
are true where A
and B
are not the same relation.
If A = B
it’s generally preferable to use all
instead.
Fields
lhs: A
The first statement
rhs: B
The second statement
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 = (A::AnnounceSecret, B::AnnounceSecret)
type AnnounceSecret = (A::AnnounceSecret, B::AnnounceSecret)
The type for the secret the prover creates when generating the proof.
The type for the response the prover sends in the last round of the protocol.
type ChallengeLength = A::ChallengeLength
type ChallengeLength = A::ChallengeLength
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 And<A, B> where
A: RefUnwindSafe,
B: RefUnwindSafe,
impl<A, B> UnwindSafe for And<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