Struct sigma_fun::Eq

source ·
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§

source§

impl<A, B> Eq<A, B>

source

pub fn new(lhs: A, rhs: B) -> Self

Create a Eq<A,B> protocol from two other Sigma protocols.

Trait Implementations§

source§

impl<A: Clone, B: Clone> Clone for Eq<A, B>

source§

fn clone(&self) -> Eq<A, B>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<A: Debug, B: Debug> Debug for Eq<A, B>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<A: Default, B: Default> Default for Eq<A, B>

source§

fn default() -> Eq<A, B>

Returns the “default value” for a type. Read more
source§

impl<A, B> Display for Eq<A, B>
where Eq<A, B>: Sigma,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<A: PartialEq, B: PartialEq> PartialEq for Eq<A, B>

source§

fn eq(&self, other: &Eq<A, B>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
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>,

§

type Witness = <A as Sigma>::Witness

The witness for the relation.
§

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

The type for the secret the prover creates when generating the proof.
§

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

The type for the response the prover sends in the last round of the protocol.
§

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

Generates the prover’s response for the verifier’s challenge.
source§

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

Generates the secret data to create the announcement
source§

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>

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)

Hashes the statement.
source§

fn hash_announcement<H: Update>( &self, hash: &mut H, announcement: &Self::Announcement )

Hashes the announcement.
source§

fn hash_witness<H: Update>(&self, hash: &mut H, witness: &Self::Witness)

Hashes the witness.
source§

impl<A: Writable, B: Writable> Writable for Eq<A, B>

source§

fn write_to<W: Write>(&self, w: &mut W) -> Result

Asks the thing to write itself to W.
source§

impl<A, B> StructuralPartialEq for Eq<A, B>

Auto Trait Implementations§

§

impl<A, B> RefUnwindSafe for Eq<A, B>

§

impl<A, B> Send for Eq<A, B>
where A: Send, B: Send,

§

impl<A, B> Sync for Eq<A, B>
where A: Sync, B: Sync,

§

impl<A, B> Unpin for Eq<A, B>
where A: Unpin, B: Unpin,

§

impl<A, B> UnwindSafe for Eq<A, B>
where A: UnwindSafe, B: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for T
where T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.