Struct sigma_fun::FiatShamir
source · pub struct FiatShamir<S, T> {
pub transcript: T,
pub sigma: S,
}
Expand description
Applies the Fiat-Shamir transform to a given Sigma
protocol given a Transcript
.
Fields§
§transcript: T
The transcript
sigma: S
The sigma protocol
Implementations§
source§impl<S: Sigma, T: Transcript<S>> FiatShamir<S, T>
impl<S: Sigma, T: Transcript<S>> FiatShamir<S, T>
sourcepub fn new(sigma: S, transcript: T, override_name: Option<&str>) -> Self
pub fn new(sigma: S, transcript: T, override_name: Option<&str>) -> Self
Create a new non-interactive prover/verifier given a Sigma
and a Transcript
for that
Sigma protocol.
sourcepub fn prove<Rng: CryptoRng + RngCore>(
&self,
witness: &S::Witness,
statement: &S::Statement,
rng: Option<&mut Rng>
) -> CompactProof<S>where
T: ProverTranscript<S>,
pub fn prove<Rng: CryptoRng + RngCore>(
&self,
witness: &S::Witness,
statement: &S::Statement,
rng: Option<&mut Rng>
) -> CompactProof<S>where
T: ProverTranscript<S>,
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
.
sourcepub fn verify(&self, statement: &S::Statement, proof: &CompactProof<S>) -> bool
pub fn verify(&self, statement: &S::Statement, proof: &CompactProof<S>) -> bool
Verifies the proof given the statement.
Trait Implementations§
source§impl<S: Clone, T: Clone> Clone for FiatShamir<S, T>
impl<S: Clone, T: Clone> Clone for FiatShamir<S, T>
source§fn clone(&self) -> FiatShamir<S, T>
fn clone(&self) -> FiatShamir<S, T>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl<S, T> RefUnwindSafe for FiatShamir<S, T>where
S: RefUnwindSafe,
T: RefUnwindSafe,
impl<S, T> Send for FiatShamir<S, T>
impl<S, T> Sync for FiatShamir<S, T>
impl<S, T> Unpin for FiatShamir<S, T>
impl<S, T> UnwindSafe for FiatShamir<S, T>where
S: UnwindSafe,
T: 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