pub trait SigmaProtocol {
type Statement: Clone + Send + Sync;
type Witness: Clone + Send + Sync;
type Commitment: Commitment;
type Challenge: Challenge;
type Response: Response;
// Required methods
fn prover_commit(
statement: &Self::Statement,
witness: &Self::Witness,
) -> (Self::Commitment, Vec<u8>);
fn prover_response(
statement: &Self::Statement,
witness: &Self::Witness,
state: &[u8],
challenge: &Self::Challenge,
) -> Result<Self::Response>;
fn verifier(
statement: &Self::Statement,
commitment: &Self::Commitment,
challenge: &Self::Challenge,
response: &Self::Response,
) -> Result<()>;
}Expand description
Core trait for SIGMA protocols.
A SIGMA protocol is a three-round interactive proof system with:
- Commitment: Prover sends initial commitment
- Challenge: Verifier sends random challenge
- Response: Prover responds to challenge
Required Associated Types§
Sourcetype Commitment: Commitment
type Commitment: Commitment
The commitment message type.
Required Methods§
Sourcefn prover_commit(
statement: &Self::Statement,
witness: &Self::Witness,
) -> (Self::Commitment, Vec<u8>)
fn prover_commit( statement: &Self::Statement, witness: &Self::Witness, ) -> (Self::Commitment, Vec<u8>)
Generate the prover’s initial commitment.
Returns the commitment and internal state for later use.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.