pub trait CommitVerify<Msg, Protocol: CommitmentProtocol>where
    Self: Eq + Sized,{
    // Required method
    fn commit(msg: &Msg) -> Self;

    // Provided method
    fn verify(&self, msg: &Msg) -> bool { ... }
}
Expand description

Trait for 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 Methods§

source

fn commit(msg: &Msg) -> Self

Creates a commitment to a byte representation of a given message

Provided Methods§

source

fn verify(&self, msg: &Msg) -> bool

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

Implementations on Foreign Types§

source§

impl<T> CommitVerify<T, StrictEncodedProtocol> for Bytes32where T: StrictEncode,

source§

fn commit(msg: &T) -> Self

Implementors§