Struct sigma_fun::FiatShamir[][src]

pub struct FiatShamir<S, T> {
    pub transcript: T,
    pub sigma: S,
}

Applies the Fiat-Shamir transform to a given Sigma protocol given a Transcript.

Fields

transcript: T

The transcript

sigma: S

The sigma protocol

Implementations

impl<S: Sigma, T: Transcript<S>> FiatShamir<S, T>[src]

pub fn new(sigma: S, transcript: T, override_name: Option<&str>) -> Self[src]

Create a new non-interactive prover/verifier given a Sigma and a Transcript for that Sigma protocol.

pub fn prove<Rng: CryptoRng + RngCore>(
    &self,
    witness: &S::Witness,
    statement: &S::Statement,
    rng: Option<&mut Rng>
) -> CompactProof<S> where
    T: ProverTranscript<S>, 
[src]

Generates a proof given the witness, a statement and some optional additional randomness.

Optimistically, the proof should be secure without passing in rng but it is always recommended. to pass in secure system random number generator as rng.

#[must_use]pub fn verify(&self, statement: &S::Statement, proof: &CompactProof<S>) -> bool[src]

Verifies the proof given the statement.

Trait Implementations

impl<S: Clone, T: Clone> Clone for FiatShamir<S, T>[src]

impl<S: Debug, T: Debug> Debug for FiatShamir<S, T>[src]

impl<S: Default + Sigma, T: Transcript<S> + Default> Default for FiatShamir<S, T>[src]

Auto Trait Implementations

impl<S, T> RefUnwindSafe for FiatShamir<S, T> where
    S: RefUnwindSafe,
    T: RefUnwindSafe

impl<S, T> Send for FiatShamir<S, T> where
    S: Send,
    T: Send

impl<S, T> Sync for FiatShamir<S, T> where
    S: Sync,
    T: Sync

impl<S, T> Unpin for FiatShamir<S, T> where
    S: Unpin,
    T: Unpin

impl<S, T> UnwindSafe for FiatShamir<S, T> where
    S: UnwindSafe,
    T: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Mark for T[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,