pub struct Eq<A, B> { /* private fields */ }Expand description
Combinator for showing that two Sigma protocols have the same witness.
Note: right now checking whether A and B support secure eq composition is done heurisitically. In the future there will be an explicit trait for this.
Implementations§
Trait Implementations§
source§impl<A: PartialEq, B: PartialEq> PartialEq<Eq<A, B>> for Eq<A, B>
impl<A: PartialEq, B: PartialEq> PartialEq<Eq<A, B>> for Eq<A, B>
source§impl<A, B> Sigma for Eq<A, B>where
A: Sigma,
B: Sigma<ChallengeLength = A::ChallengeLength, Witness = A::Witness, Response = A::Response, AnnounceSecret = A::AnnounceSecret>,
impl<A, B> Sigma for Eq<A, B>where
A: Sigma,
B: Sigma<ChallengeLength = A::ChallengeLength, Witness = A::Witness, Response = A::Response, AnnounceSecret = A::AnnounceSecret>,
§type Statement = (<A as Sigma>::Statement, <B as Sigma>::Statement)
type Statement = (<A as Sigma>::Statement, <B as Sigma>::Statement)
The elements of the statement the prover is proving.
§type AnnounceSecret = <A as Sigma>::AnnounceSecret
type AnnounceSecret = <A as Sigma>::AnnounceSecret
The type for the secret the prover creates when generating the proof.
§type Announcement = (<A as Sigma>::Announcement, <B as Sigma>::Announcement)
type Announcement = (<A as Sigma>::Announcement, <B as Sigma>::Announcement)
The type for the public announcement the prover sends in the first round of the protocol.
§type Response = <A as Sigma>::Response
type Response = <A as Sigma>::Response
The type for the response the prover sends in the last round of the protocol.
§type ChallengeLength = <A as Sigma>::ChallengeLength
type ChallengeLength = <A as Sigma>::ChallengeLength
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, statement: &Self::Statement)
fn hash_statement<H: Update>(&self, hash: &mut H, statement: &Self::Statement)
Hashes the statement.
source§fn hash_announcement<H: Update>(
&self,
hash: &mut H,
announcement: &Self::Announcement
)
fn hash_announcement<H: Update>(
&self,
hash: &mut H,
announcement: &Self::Announcement
)
Hashes the announcement.