[][src]Trait lnpbp::commit_verify::TryCommitVerify

pub trait TryCommitVerify<MSG> where
    Self: Eq + Sized
{ type Error: Error; fn try_commit(msg: &MSG) -> Result<Self, Self::Error>; fn try_verify(&self, msg: &MSG) -> Result<bool, Self::Error> { ... } }

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]>).

Associated Types

type Error: Error

Error type that may be reported during [commit] and [verify] procedures

Loading content...

Required methods

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

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

Loading content...

Provided methods

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.

Loading content...

Implementors

Loading content...