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 for Eq<A, B>
impl<A: PartialEq, B: PartialEq> PartialEq 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
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, 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.
impl<A, B> StructuralPartialEq for Eq<A, B>
Auto Trait Implementations§
impl<A, B> RefUnwindSafe for Eq<A, B>where
A: RefUnwindSafe,
B: RefUnwindSafe,
impl<A, B> Send for Eq<A, B>
impl<A, B> Sync for Eq<A, B>
impl<A, B> Unpin for Eq<A, B>
impl<A, B> UnwindSafe for Eq<A, B>where
A: UnwindSafe,
B: 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