pub trait ConvolveCommitProof<Msg, Source, Protocol>where
    Self: Sized + VerifyEq,
    Source: ConvolveCommit<Msg, Self, Protocol>,
    Msg: CommitEncode,
    Protocol: CommitmentProtocol,
{ type Suppl; fn restore_original(&self, commitment: &Source::Commitment) -> Source; fn extract_supplement(&self) -> &Self::Suppl; fn verify(
        &self,
        msg: &Msg,
        commitment: Source::Commitment
    ) -> Result<bool, Source::CommitError>
    where
        Self: VerifyEq
, { ... } }
Expand description

Proof type used by [ConvolveCommitVerify] protocol.

Required Associated Types

Supplement is a part of the proof data provided during commitment procedure.

Required Methods

Restores the original source before the commitment from the supplement (the self) and commitment.

Extract supplement from the proof.

Provided Methods

Verifies commitment using proof (the self) against the message.

Default implementation repeats [ConvolveCommitVerify::convolve_commit] procedure, restoring the original value out of proof data, checking that the resulting commitment matches the provided one in the commitment parameter.

Errors if the commitment can’t be created, i.e. the [ConvolveCommitVerify::convolve_commit] procedure for the original, restored from the proof, can’t be performed. This means that the verification has failed and the commitment and/or the proof are invalid. The function returns error in this case (ano not simply false) since this usually means the software error in managing container and proof data, or selection of a different commitment protocol parameters comparing to the ones used during commitment creation. In all these cases we’d like to provide devs with more information for debugging.

The proper way of using the function in a well-debugged software should be if commitment.verify(...).expect("proof managing system") { .. }. However if the proofs are provided by some sort of user/network input from an untrusted party, a proper form would be if commitment.verify(...).unwrap_or(false) { .. }.

Implementors