pub trait TryCommitVerify<Msg, Protocol: CommitmentProtocol>where
    Self: Eq + Sized,{
    type Error: Error;

    // Required method
    fn try_commit(msg: &Msg) -> Result<Self, Self::Error>;

    // Provided method
    fn try_verify(&self, msg: &Msg) -> Result<bool, Self::Error> { ... }
}
Expand description

Trait for a failable version of commit-verify scheme. A message for the commitment may be any structure that can be represented as a byte array (i.e. implements AsRef<[u8]>).

Required Associated Types§

source

type Error: Error

Error type that may be reported during TryCommitVerify::try_commit and TryCommitVerify::try_verify procedures

Required Methods§

source

fn try_commit(msg: &Msg) -> Result<Self, Self::Error>

Tries to create commitment to a byte representation of a given message

Provided Methods§

source

fn try_verify(&self, msg: &Msg) -> Result<bool, Self::Error>

Tries to verify commitment against the message; default implementation just repeats the commitment to the message and check it against the self.

Implementors§