Struct sigma_fun::All

source ·
pub struct All<S, N> { /* private fields */ }
Available on crate feature alloc only.
Expand description

Combinator for proving all of N statements of the same type is true.

Implementations§

source§

impl<S, N> All<S, N>

source

pub fn new(sigma: S) -> Self

Create a All<N,S> protocol from a Sigma protocol S.

Trait Implementations§

source§

impl<S: Clone, N: Clone> Clone for All<S, N>

source§

fn clone(&self) -> All<S, N>

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<S: Debug, N: Debug> Debug for All<S, N>

source§

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

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

impl<S: Default, N: Default> Default for All<S, N>

source§

fn default() -> All<S, N>

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

impl<S, N> Display for All<S, N>
where All<S, N>: Sigma,

source§

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

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

impl<S: PartialEq, N: PartialEq> PartialEq for All<S, N>

source§

fn eq(&self, other: &All<S, N>) -> 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<N: Unsigned, S: Sigma> Sigma for All<S, N>

§

type Witness = Vec<<S as Sigma>::Witness>

The witness for the relation.
§

type Statement = Vec<<S as Sigma>::Statement>

The elements of the statement the prover is proving.
§

type AnnounceSecret = Vec<<S as Sigma>::AnnounceSecret>

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

type Announcement = Vec<<S as Sigma>::Announcement>

The type for the public announcement the prover sends in the first round of the protocol.
§

type Response = Vec<<S as Sigma>::Response>

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

type ChallengeLength = <S 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, statements: &Self::Statement)

Hashes the statement.
source§

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

Hashes the announcement.
source§

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

Hashes the witness.
source§

impl<S: Writable, N: Unsigned> Writable for All<S, N>

source§

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

Asks the thing to write itself to W.
source§

impl<S, N> StructuralPartialEq for All<S, N>

Auto Trait Implementations§

§

impl<S, N> RefUnwindSafe for All<S, N>

§

impl<S, N> Send for All<S, N>
where N: Send, S: Send,

§

impl<S, N> Sync for All<S, N>
where N: Sync, S: Sync,

§

impl<S, N> Unpin for All<S, N>
where N: Unpin, S: Unpin,

§

impl<S, N> UnwindSafe for All<S, N>
where N: UnwindSafe, S: 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.